1 Reply Latest reply on Nov 30, 2011 11:50 PM by Alexandr Areshchanka

    Infinite loop of session creation

    Jake C Newbie

      I believe this is the same issue as Concurrent Requests One Invalidates The Session Results In Recursive Loop Of Session Creation (there is a JIRA) from 2009, but there was never any response.


      We are running JBoss 4.2.2.GA and JBoss Seam 2.2.2.Final.


      Our server will be running along fine, and suddenly we start getting calls about performance problems, and here is what I find in the log:


      1098 of this:


      2011-11-30 10:40:56,500 INFO  [org.jboss.seam.contexts.Contexts] starting up: org.jboss.seam.security.identity
      



      Then this:




      2011-11-30 10:40:58,343 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/myapp]] Session event listener threw exception
      java.lang.StackOverflowError
           at java.lang.ClassLoader.defineClass1(Native Method)
           at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
           at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
           at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
           at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
           at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
           at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
           at org.apache.log4j.spi.LoggingEvent.<init>(LoggingEvent.java:154)
           at org.apache.log4j.Category.forcedLog(Category.java:388)
           at org.apache.log4j.Category.log(Category.java:853)
           at org.jboss.logging.Log4jLoggerPlugin.error(Log4jLoggerPlugin.java:206)
           at org.jboss.logging.Logger.error(Logger.java:234)
           at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:409)
           at org.apache.catalina.session.StandardSession.setId(StandardSession.java:369)
           at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:828)
           at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:291)
           at org.apache.catalina.connector.Request.doGetSession(Request.java:2312)
           at org.apache.catalina.connector.Request.getSession(Request.java:2075)
           at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
           at com.sun.faces.context.SessionMap.getSession(ExternalContextImpl.java:1002)
      



      with this section repeating over 200 times:




           at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:72)
           at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:53)
           at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:64)
           at org.jboss.el.parser.AstIdentifier.getValue(AstIdentifier.java:44)
           at org.jboss.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
           at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:111)
           at org.jboss.seam.Component$ELInitialValue.getValue(Component.java:2360)
           at org.jboss.seam.Component.initialize(Component.java:1389)
           at org.jboss.seam.Component.instantiateJavaBean(Component.java:1315)
           at org.jboss.seam.Component.instantiate(Component.java:1268)
           at org.jboss.seam.Component.newInstance(Component.java:1966)
           at org.jboss.seam.contexts.Contexts.startup(Contexts.java:304)
           at org.jboss.seam.contexts.Contexts.startup(Contexts.java:278)
           at org.jboss.seam.contexts.Lifecycle.beginSession(Lifecycle.java:191)
           at org.jboss.seam.contexts.ServletLifecycle.beginSession(ServletLifecycle.java:124)
           at org.jboss.seam.servlet.SeamListener.sessionCreated(SeamListener.java:44)
           at org.apache.catalina.session.StandardSession.tellNew(StandardSession.java:397)
           at org.apache.catalina.session.StandardSession.setId(StandardSession.java:369)
           at org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:828)
           at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:291)
           at org.apache.catalina.connector.Request.doGetSession(Request.java:2312)
           at org.apache.catalina.connector.Request.getSession(Request.java:2075)
           at org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:833)
           at com.sun.faces.context.SessionMap.getSession(ExternalContextImpl.java:1002)
           at com.sun.faces.context.SessionMap.containsKey(ExternalContextImpl.java:990)




      followed by 1120 of this:



      2011-11-30 10:40:58,515 INFO  [org.jboss.seam.contexts.Contexts] starting up: org.jboss.seam.web.session




      Ending with a bunch of NullPointerExceptions and ArrayIndexOutOfBoundsExceptions, which I think are actually problems printing out the entire stack trace, as it doesn't seem to have a valid starting point.


      This is killing us. It happened three times yesterday. It eventually recovered without having to restart the server, but it happened again today and locked up the server. I had to kill it in the middle of business hours, and then it happened AGAIN during startup!


      Does anyone have any idea what is going on here?

        • 1. Re: Infinite loop of session creation
          Alexandr Areshchanka Newbie

          I remember I saw something similar during development.


          If I'm not mistaken it was related to jsf libs that we used instead of default one in jboss 4.3.


          Are you using myfaces implementation or some other different from default jboss?


          Do you have custom component libraries in your app? Try to check if you defined tld's xml files correct.