portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r412761 - /portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
Date Thu, 08 Jun 2006 14:24:20 GMT
Author: ate
Date: Thu Jun  8 07:24:20 2006
New Revision: 412761

URL: http://svn.apache.org/viewvc?rev=412761&view=rev
Log:
Fix for JS2-541: Log initialization failures when deploying on Websphere 6.0.2.x
See: http://issues.apache.org/jira/browse/JS2-541

Modified:
    portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java

Modified: portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java?rev=412761&r1=412760&r2=412761&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
(original)
+++ portals/jetspeed-2/trunk/components/portal/src/java/org/apache/jetspeed/engine/JetspeedServlet.java
Thu Jun  8 07:24:20 2006
@@ -58,8 +58,8 @@
 extends HttpServlet 
 implements JetspeedEngineConstants, HttpSessionListener
 {
-    private final static Log log = LogFactory.getLog(JetspeedServlet.class);
-    private final static Log console = LogFactory.getLog(CONSOLE_LOGGER);
+    private static Log log;
+    private static Log console;
 
     /**
      * In certain situations the init() method is called more than once,
@@ -98,6 +98,12 @@
     {
         synchronized (this.getClass())
         {
+            if ( log == null )
+            {
+                log = LogFactory.getLog(JetspeedServlet.class);
+                console = LogFactory.getLog(CONSOLE_LOGGER);                
+            }
+            
             console.info(INIT_START_MSG);
 
             super.init(config);
@@ -324,7 +330,14 @@
     {
         Subject subject = (Subject)se.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
         if (subject == null)
-            return;        
+            return;
+        if (firstInit)
+        {
+            // Servlet already destroyed, 
+            // Can't reliably access ComponentManager (Spring) anymore
+            // as for instance WAS 6.0.2 has a bug invoking this method with a wrong classLoader
(not the one for the WebApp)
+            return;
+        }        
         Principal subjectUserPrincipal = SecurityHelper.getPrincipal(subject, UserPrincipal.class);
         PortalStatistics statistics = (PortalStatistics)engine.getComponentManager().getComponent("PortalStatistics");
         long sessionLength = System.currentTimeMillis() - se.getSession().getCreationTime();



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message