8 Replies Latest reply on Oct 31, 2002 6:33 AM by jules

    JBossWeb HTTP Session Clustering - Null Pointer Exception

    wingba

      I'm attempting to get the JBossWeb Http Session Clustering working. I'm not modifying any of the configurations in the all/deploy directory. JBoss starts with no ERRORS and the DefaultPartition appears to have started okay.
      I can deploy the template application and everything works fine. If I add the tag to the template's web.xml file and deploy I get the following exception:

      14:41:06,078 INFO [MainDeployer] Starting deployment of package: file:/endeca/jboss-3.0.3/server/all/deploy/web-client.wa
      r
      14:41:06,403 INFO [jbossweb] Registered jboss.web:Jetty=0,JBossWebApplicationContext=4,context=/web-client
      14:41:07,356 INFO [jbossweb] Extract jar:file:/endeca/jboss-3.0.3/server/all/tmp/deploy/server/all/deploy/web-client.war/
      79.web-client.war!/ to /var/tmp/Jetty_0_0_0_0_8080__web-client/webapp
      14:41:08,301 INFO [JBossWebApplicationContext#/web-client] using Distributable HttpSession Manager: org.mortbay.j2ee.sess
      ion.Manager@8ef117
      14:41:08,334 INFO [jbossweb] Stopped WebApplicationContext[/web-client,Web Client]
      14:41:08,341 INFO [jbossweb] Deregister jboss.web:Jetty=0,JBossWebApplicationContext=4,context=/web-client
      14:41:08,342 INFO [jbossweb] Successfully undeployed file:/endeca/jboss-3.0.3/server/all/tmp/deploy/server/all/deploy/web
      -client.war/79.web-client.war
      14:41:08,375 ERROR [URLDeploymentScanner] Failed to deploy: org.jboss.deployment.scanner.URLDeploymentScanner$DeployedURL@
      3a90ff0a{ url=file:/endeca/jboss-3.0.3/server/all/deploy/web-client.war, deployedLastModified=1035232778000 }
      org.jboss.deployment.DeploymentException: - nested throwable: (java.lang.NullPointerException)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:434)
      at org.jboss.jetty.JettyService.performDeploy(JettyService.java:243)
      at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:300)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
      at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:427)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:553)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:212)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:225)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:202)
      Caused by: java.lang.NullPointerException
      at org.mortbay.j2ee.session.Manager.start(Manager.java:159)
      at org.mortbay.jetty.servlet.ServletHandler.start(ServletHandler.java:409)
      at org.mortbay.jetty.servlet.WebApplicationHandler.start(WebApplicationHandler.java:142)
      at org.mortbay.http.HttpContext.startHandlers(HttpContext.java:1780)
      at org.jboss.jetty.JBossWebApplicationContext.startHandlers(JBossWebApplicationContext.java:280)
      at org.mortbay.http.HttpContext.start(HttpContext.java:1750)
      at org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:471)
      at org.mortbay.j2ee.J2EEWebApplicationContext.start(J2EEWebApplicationContext.java:85)
      at org.jboss.jetty.Jetty.deploy(Jetty.java:412)
      ... 17 more

      I've tried both the Java Groups and CMP blocks in the jboss-service.xml of jbossweb.sar. I get the same errors. I can deploy my own application and verify that the HA-JNDI clustering works fine. If I remove the tag on my app, it also works but without HTTP Session Clustering.
      I'm running this on Sparc Solaris 8. I've tried setting all the attributes from the clustering PDF document in the cluster-service.xml. This gives me better control for the HA-JNDI, but didn't help the HTTP Clustering.
      Any ideas of what I'm doing wrong? Thanks in advance.

        • 1. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio

          it's an unfortunate bug that got introduced in 3.0.3 - it is now fixed in cvs.

          cvs co jboss-3.0 -r Branch_3_0, build and try again. Let me know if you have any further problems.

          Someone else has reported that the JG based stack does not work for them (I suspect JG setup), but that CMP works fine.

          Please report back on you success/failure.

          Jules

          • 2. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio
            dcartier

            Jules,

            That would be me.

            I have been busy preparing for a dog and pony show, which went fine thank God, so now I can get back to making an example that I can send to you.

            I will work on it tonight and will email you once I have something concrete.

            Dennis

            • 3. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio
              wingba

              The branch did cure the problem with the Null Pointer Exception, but I still can't get HTTP Session Clustering to work with JBossWeb.
              The J.G. option will not duplicate on fail over. The jsession ID is the same, but nothing is attached to it.
              The CMP option will not even work with a single server. It keeps the same jsession ID, but nothing will stick to the session (setAttribute). The jsession ID is not carried over to the other server on failover.
              I tried the Tomcat 4.0.5 and was able to get sticky sessions to work between two JBoss instances when a failover occurs. My problems is that I need non-sticky sessions. Our requirements are to load balance each HTTP request, not each session.
              What I think I see with Tomcat is that if an app server (AS1) gets an unknown jsession id, it will not look in storage if the other app server (AS2) is running and visable through the multi-cast. If the other app server (AS2) is down, the first app server (AS1) will look in storage.
              I hope this makes sense. Is there a way to make a app server (AS1) to look in storage if it receives an unknown jsession id regardless if the other app server (AS2) is running or not?

              • 4. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio

                Thank-you for your perseverance !

                Jetty:

                OK - Dennis found another bug in the Local and JGStore - fixed in CVS.

                CMPStore works for me and Dennis - so this is worrying. It works by using a CMP EJB to store the session. The EJBs shipped with JBoss use DefaultDS as their DataSource so it is important that this is mapped to the same DB on all nodes over which you wish to distribute your session.

                If you are using a clean JBoss you simply need to fix the url in all/deploy/hsqldb-service.xml so that they all point to one machine.

                The two fixes will be in 3.0.4 - out early next week.

                Please get back to me with further details about the CMPStore problem. If it is real I would like to resolve it ASAP.

                As for Tomcat ? I can't help you there. I'm afraid, perhaps someone else on these forums.....


                Cheers,



                Jules

                • 5. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio

                  If you want to try straight from cvs :

                  co -r Branch_3_0 jboss-3.0

                  or something like that !

                  Jules

                  • 6. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio
                    wingba

                    Good News, Bad News. I downloaded you newest branch and I also figured out that the DefaultDS wasn't working on my side, so that was the CMP problem. So here is where I'm at.
                    Both the Java Groups and CMP give me the same results. The non-sticky sessions are be replicated between my two JBoss instances. I can attach and carry attributes on the session that are attached by my servlet, but my JSP's can't seem to attach anything to the session.
                    My JSP's have a JavaBean with a scope of "session", but each time I call the JSP it initializes a new instance of the JavaBean. I can see this my displaying the toString() of the JavaBean. The JavaBean itself also attaches a string to the session, but being it is re-initialized each time, I can't tell if that is working.
                    I have also tried this with sticky sessions and got the same results.
                    I'm seeing no error message or exceptions. Hope this gives you a little more to go on.
                    Thanks again for the help.

                    • 7. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio
                      wingba

                      Good News, Bad News. I downloaded you newest branch and I also figured out that the DefaultDS wasn't working on my side, so that was the CMP problem. So here is where I'm at.
                      Both the Java Groups and CMP give me the same results. The non-sticky sessions are be replicated between my two JBoss instances. I can attach and carry attributes on the session that are attached by my servlet, but my JSP's can't seem to attach anything to the session.
                      My JSP's have a JavaBean with a scope of "session", but each time I call the JSP it initializes a new instance of the JavaBean. I can see this my displaying the toString() of the JavaBean. The JavaBean itself also attaches a string to the session, but being it is re-initialized each time, I can't tell if that is working.
                      I have also tried this with sticky sessions and got the same results.
                      I'm seeing no error message or exceptions. Hope this gives you a little more to go on.
                      Thanks again for the help.

                      • 8. Re: JBossWeb HTTP Session Clustering - Null Pointer Exceptio

                        I'm sure I already answered this - but it is not showing up...

                        I'm glad that all backend-impls now result in the same behaviour.

                        Session affinity (stickiness) is not currently supported, since the distribution does not currently take advantage of any optimisations that might be possible given this knowledge - although it will soon.

                        As for the JSP problems, are these specific to distributable webapps or do they occur in standard webapps aswell ?

                        I ask this because if session distribution works for servlets and JSPs compile to servlets, I don't see why session distribution should not work for JSPs (although I have not yet tested it in JSPs for exactly this reason).

                        Jules