Browse Source

Merge remote-tracking branch 'origin/master'

Jason Rivard 9 years ago
parent
commit
4e25f7cd0e

+ 1 - 1
README.md

@@ -8,7 +8,7 @@ Official project page is at [https://github.com/pwm-project/pwm/](https://github
 * [Release Downloads](https://drive.google.com/folderview?id=0B3oHdiTrftrGV3ZrMi1LUzVCY1U&usp=sharing#list) - the release versions are quite dated, consider using a current build.
 * [Current Builds](http://www.pwm-project.org/artifacts/pwm/) - Current downloads built from recent github project commits
 * [Google Groups](https://groups.google.com/group/pwm-general) - please ask for assistance here.
-* [PWM Admin Guide](http://pwm.googlecode.com/svn/trunk/pwm/supplemental/PWMAdministrationGuide.pdf)
+* [PWM Admin Guide](http://pwm.googlecode.com/svn/trunk/pwm/supplemental/PWMAdministrationGuide.pdf) - guide for 1.7.  For current documentation, please help us migrate to the [PWM Wiki](https://github.com/pwm-project/pwm/wiki) 
 
 Features
 * Web based configuration manager with over 400 configurable settings

+ 6 - 6
pom.xml

@@ -336,14 +336,14 @@
             <version>6.4.9</version>
         </dependency>
         <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-servlet</artifactId>
-            <version>1.19</version>
+            <groupId>org.glassfish.jersey.containers</groupId>
+            <artifactId>jersey-container-servlet</artifactId>
+            <version>2.22.2</version>
         </dependency>
         <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-json</artifactId>
-            <version>1.19</version>
+            <groupId>org.glassfish.jersey.media</groupId>
+            <artifactId>jersey-media-json-jackson</artifactId>
+            <version>2.22.2</version>
         </dependency>
         <dependency>
             <groupId>org.jasig.cas.client</groupId>

+ 21 - 0
src/main/java/password/pwm/util/PwmServletContextListener.java

@@ -0,0 +1,21 @@
+package password.pwm.util;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+public class PwmServletContextListener implements ServletContextListener {
+
+    @Override
+    public void contextInitialized(ServletContextEvent sce) {
+        // Doing this here so the level will be set before any calls are made to LogManager or Logger.
+        Logger.getLogger("org.glassfish.jersey").setLevel(Level.SEVERE);
+    }
+
+    @Override
+    public void contextDestroyed(ServletContextEvent sce) {
+    }
+
+}

+ 3 - 2
src/main/java/password/pwm/util/logging/PwmLogManager.java

@@ -23,8 +23,10 @@
 package password.pwm.util.logging;
 
 import com.novell.ldapchai.ChaiUser;
+
 import org.apache.log4j.*;
 import org.apache.log4j.xml.DOMConfigurator;
+
 import password.pwm.AppProperty;
 import password.pwm.PwmApplication;
 import password.pwm.PwmApplicationMode;
@@ -97,8 +99,7 @@ public class PwmLogManager {
         initFileLogger(config, fileLogLevel, pwmApplicationPath);
 
         // disable jersey warnings.
-        java.util.logging.LogManager.getLogManager().addLogger(java.util.logging.Logger.getLogger("com.sun.jersey.spi.container.servlet.WebComponent"));
-        java.util.logging.LogManager.getLogManager().getLogger("com.sun.jersey.spi.container.servlet.WebComponent").setLevel(java.util.logging.Level.OFF);
+        java.util.logging.Logger.getLogger("org.glassfish.jersey").setLevel(java.util.logging.Level.SEVERE);
     }
 
     private static void initConsoleLogger(

+ 12 - 0
src/main/java/password/pwm/ws/server/rest/PwmResourceConfig.java

@@ -0,0 +1,12 @@
+package password.pwm.ws.server.rest;
+
+import org.glassfish.jersey.message.DeflateEncoder;
+import org.glassfish.jersey.message.GZipEncoder;
+import org.glassfish.jersey.server.ResourceConfig;
+import org.glassfish.jersey.server.filter.EncodingFilter;
+
+public class PwmResourceConfig extends ResourceConfig {
+    public PwmResourceConfig() {
+        registerClasses(EncodingFilter.class, GZipEncoder.class, DeflateEncoder.class);
+    }
+}

+ 7 - 12
src/main/webapp/WEB-INF/web.xml

@@ -28,6 +28,9 @@
     <display-name>PWM Password Management</display-name>
     <!-- <distributable/> Clustering/Session replication is not supported -->
     <description>Password Management Servlet</description>
+    <listener>
+        <listener-class>password.pwm.util.PwmServletContextListener</listener-class>
+    </listener>
     <context-param>
         <description>
             Explicit location of application working directory. If a relative path is specified, it is relative to the
@@ -49,22 +52,14 @@
     </welcome-file-list>
     <servlet>
         <servlet-name>Jersey REST Service</servlet-name>
-        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-        <init-param>
-            <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
-            <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
-        </init-param>
-        <init-param>
-            <param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
-            <param-value>com.sun.jersey.api.container.filter.GZIPContentEncodingFilter</param-value>
-        </init-param>
+        <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
         <init-param>
-            <param-name>com.sun.jersey.config.property.packages</param-name>
+            <param-name>jersey.config.server.provider.packages</param-name>
             <param-value>password.pwm.ws.server.rest</param-value>
         </init-param>
         <init-param>
-            <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
-            <param-value>true</param-value>
+            <param-name>javax.ws.rs.Application</param-name>
+            <param-value>password.pwm.ws.server.rest.PwmResourceConfig</param-value>
         </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>