4 Replies Latest reply on Apr 10, 2002 6:04 PM by barry burnereau

    EJBException during Session.valueUnbound() with JBoss-2.4.4/

    Ramin Akhbari Newbie

      I have a perfectly working webapp using JBoss-2.4.0/Tomcat-3.2.3 with static files being served with Apache 1.3.22 using mod_jk. I decided to download the latest 2.4.4/Jetty-3.1.3 bundle and see what it takes to switch the app to Jetty from the Tomcat/Apache combo.

      I muddled thru the JBoss & Jetty config files (jetty.xml) and got my JAR file deployed and brought up JBoss/Jetty to the point where there are no error messages at startup. The app works fine for the most part as well, EXCEPT when a user goes to log off.

      When a user logs on I create an instance of an EntityBean called SessionRecord. I then setup a HttpSessionListener and implement its unbound event so that when the user logs off and the session is invalidated it simply looks up this same instance and deletes it (ejbRemove) from the DB. MIND YOU... this is working perfectly fine in JBoss-2.4.0.

      But in JBoss-2.4.4 when the user logs off I get the following exception:

      [INFO,Default] **E** [2002-01-11 12:21:12.524 PST] [SocketListener-2] [ApliaSess
      ion.java:306]
      [INFO,Default] Session.valueUnbound(): Error deleting session record.
      [INFO,Default] javax.transaction.TransactionRolledbackException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key
      [INFO,Default] javax.ejb.EJBException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key
      [INFO,Default] at org.jboss.ejb.plugins.BMPPersistenceManager.loadEntity(BMPPer
      sistenceManager.java:345)
      [INFO,Default] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke
      (EntitySynchronizationInterceptor.java:287)
      [INFO,Default] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(Entity
      InstanceInterceptor.java:197)
      [INFO,Default] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLock
      Interceptor.java:125)
      [INFO,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxIntercept
      orCMT.java:138)
      [INFO,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Tx
      InterceptorCMT.java:347)
      [INFO,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCM
      T.java:100)
      [INFO,Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInte
      rceptor.java:127)
      [INFO,Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.ja
      va:170)
      [INFO,Default] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:428
      )
      [INFO,Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke
      (JRMPContainerInvoker.java:504)
      [INFO,Default] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeCont
      ainer(GenericProxy.java:335)
      [INFO,Default] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomePr
      oxy.java:177)
      [INFO,Default] at $Proxy37.remove(Unknown Source)
      [INFO,Default] at com.aplia.platform.site.SessionRecord.remove(SessionRecord.ja
      va:306)
      [INFO,Default] at com.aplia.platform.ApliaSession$SessionListener.valueUnbound(
      ApliaSession.java:303)
      [INFO,Default] at org.mortbay.jetty.servlet.Context$Session.unbindValue(Context
      .java:828)
      [INFO,Default] at org.mortbay.jetty.servlet.Context$Session.invalidate(Context.
      java:714)
      [INFO,Default] at com.aplia.platform.ApliaSession.invalidate(ApliaSession.java:
      246)
      [INFO,Default] at com.aplia.platform.LogoffServlet.doGet(LogoffServlet.java:31)

      [INFO,Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      [INFO,Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [INFO,Default] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
      java:488)
      [INFO,Default] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandle
      r.java:403)
      [INFO,Default] at org.mortbay.http.HandlerContext.handle(HandlerContext.java:10
      37)
      [INFO,Default] at org.mortbay.http.HandlerContext.handle(HandlerContext.java:99
      2)
      [INFO,Default] at org.mortbay.http.HttpServer.service(HttpServer.java:699)
      [INFO,Default] at org.mortbay.http.HttpConnection.service(HttpConnection.java:7
      45)
      [INFO,Default] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.jav
      a:918)
      [INFO,Default] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:76
      0)
      [INFO,Default] at org.mortbay.http.SocketListener.handleConnection(SocketListen
      er.java:148)
      [INFO,Default] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:28
      7)
      [INFO,Default] at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716
      )
      [INFO,Default] at java.lang.Thread.run(Unknown Source)
      [INFO,Default] java.lang.ClassCastException: com.aplia.platform.site.SessionReco
      rd$Key
      [INFO,Default] at com.aplia.platform.site.SessionRecord$Bean.ejbLoad(SessionRec
      ord.java:538)
      [INFO,Default] at java.lang.reflect.Method.invoke(Native Method)
      [INFO,Default] at org.jboss.ejb.plugins.BMPPersistenceManager.loadEntity(BMPPer
      sistenceManager.java:324)
      [INFO,Default] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke
      (EntitySynchronizationInterceptor.java:287)
      [INFO,Default] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(Entity
      InstanceInterceptor.java:197)
      [INFO,Default] at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLock
      Interceptor.java:125)
      [INFO,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxIntercept
      orCMT.java:138)
      [INFO,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(Tx
      InterceptorCMT.java:347)
      [INFO,Default] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCM
      T.java:100)
      [INFO,Default] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInte
      rceptor.java:127)
      [INFO,Default] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.ja
      va:170)
      [INFO,Default] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:428
      )
      [INFO,Default] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke
      (JRMPContainerInvoker.java:504)
      [INFO,Default] at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeCont
      ainer(GenericProxy.java:335)
      [INFO,Default] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomePr
      oxy.java:177)
      [INFO,Default] at $Proxy37.remove(Unknown Source)
      [INFO,Default] at com.aplia.platform.site.SessionRecord.remove(SessionRecord.ja
      va:306)
      [INFO,Default] at com.aplia.platform.ApliaSession$SessionListener.valueUnbound(
      ApliaSession.java:303)
      [INFO,Default] at org.mortbay.jetty.servlet.Context$Session.unbindValue(Context
      .java:828)
      [INFO,Default] at org.mortbay.jetty.servlet.Context$Session.invalidate(Context.
      java:714)
      [INFO,Default] at com.aplia.platform.ApliaSession.invalidate(ApliaSession.java:
      246)
      [INFO,Default] at com.aplia.platform.LogoffServlet.doGet(LogoffServlet.java:31)

      [INFO,Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      [INFO,Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [INFO,Default] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
      java:488)
      [INFO,Default] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandle
      r.java:403)
      [INFO,Default] at org.mortbay.http.HandlerContext.handle(HandlerContext.java:10
      37)
      [INFO,Default] at org.mortbay.http.HandlerContext.handle(HandlerContext.java:99
      2)
      [INFO,Default] at org.mortbay.http.HttpServer.service(HttpServer.java:699)
      [INFO,Default] at org.mortbay.http.HttpConnection.service(HttpConnection.java:7
      45)
      [INFO,Default] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.jav
      a:918)
      [INFO,Default] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:76
      0)
      [INFO,Default] at org.mortbay.http.SocketListener.handleConnection(SocketListen
      er.java:148)
      [INFO,Default] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:28
      7)
      [INFO,Default] at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716
      )
      [INFO,Default] at java.lang.Thread.run(Unknown Source)
      [INFO,Default] com.aplia.platform.ApliaException: javax.transaction.TransactionR
      olledbackException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key [nested: javax.transaction.Transaction
      RolledbackException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key; nested exception is:
      javax.ejb.EJBException: null
      Embedded Exception
      com.aplia.platform.site.SessionRecord$Key]
      [INFO,Default] at com.aplia.platform.site.SessionRecord.remove(SessionRecord.ja
      va:309)
      [INFO,Default] at com.aplia.platform.ApliaSession$SessionListener.valueUnbound(
      ApliaSession.java:303)
      [INFO,Default] at org.mortbay.jetty.servlet.Context$Session.unbindValue(Context
      .java:828)
      [INFO,Default] at org.mortbay.jetty.servlet.Context$Session.invalidate(Context.
      java:714)
      [INFO,Default] at com.aplia.platform.ApliaSession.invalidate(ApliaSession.java:
      246)
      [INFO,Default] at com.aplia.platform.LogoffServlet.doGet(LogoffServlet.java:31)

      [INFO,Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
      [INFO,Default] at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
      [INFO,Default] at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.
      java:488)
      [INFO,Default] at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandle
      r.java:403)
      [INFO,Default] at org.mortbay.http.HandlerContext.handle(HandlerContext.java:10
      37)
      [INFO,Default] at org.mortbay.http.HandlerContext.handle(HandlerContext.java:99
      2)
      [INFO,Default] at org.mortbay.http.HttpServer.service(HttpServer.java:699)
      [INFO,Default] at org.mortbay.http.HttpConnection.service(HttpConnection.java:7
      45)
      [INFO,Default] at org.mortbay.http.HttpConnection.handleNext(HttpConnection.jav
      a:918)
      [INFO,Default] at org.mortbay.http.HttpConnection.handle(HttpConnection.java:76
      0)
      [INFO,Default] at org.mortbay.http.SocketListener.handleConnection(SocketListen
      er.java:148)
      [INFO,Default] at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:28
      7)
      [INFO,Default] at org.mortbay.util.ThreadPool$JobRunner.run(ThreadPool.java:716
      )
      [INFO,Default] at java.lang.Thread.run(Unknown Source)
      [INFO,Default]


      Any clues anyone?

      It would be much appreciated. Thanks in advance.

      Ramin