Uploaded image for project: 'EJB 3.0'
  1. EJB 3.0
  2. EJBTHREE-2296

EJBAccessException on a Stateless Session Bean which has already been successfully used in the same method

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • Security

      I am using JBoss 6.1.0 Final "Neo".

      I have a servlet which looks up a session bean and calls two methods on it.
      method1() and method2(). Method1 takes around 4 hours to complete and runs fine.

      However while running method2(), I sometimes get EJBAccessException.

      Dummy Code:

      Servlet.execute()

      { MyStatelessEJB session = SessionHelper.lookup(MyStatelessEJB.JNDI_NAME); session.method1(); // DO something and in some cases it might take ~4 hours to complete session.method2(); // This guy complains of EJBAccessException }

      The interesting thing to note is that all other applications have been shutdown before I run these methods. So I don't expect other concurrent applications to be messing up with security credentials.

      Please see the snippet from JBoss logs:

      2013-03-07 22:24:09,561 INFO [org.jboss.bootstrap.impl.base.server.AbstractServer] (Thread-2) JBossAS [6.1.0.Final "Neo"] Started in 2m:59s:969ms
      2013-03-07 22:24:16,987 WARN [org.hibernate.hql.ast.QueryTranslatorImpl] (http-443-113) firstResult/maxResults specified with collection fetch; applying in memory!
      2013-03-07 22:26:57,500 INFO [org.apache.struts.tiles.TilesRequestProcessor] (http-0.0.0.0-80-1) Tiles definition factory found for request processor ''.
      2013-03-07 22:32:04,142 INFO [org.jboss.profileservice.management.upload.remoting.DeployHandler] (http-0.0.0.0-80-4) invoke, payload:

      {DeploymentTargetID=names=[acqServer.ear]}

      , parameter: stop
      2013-03-07 22:32:04,595 INFO [org.jboss.jpa.deployment.PersistenceUnitDeployment] (http-0.0.0.0-80-4) Stopping persistence unit persistence.unit:unitName=acqServer.ear/acqServer.jar#acq-server
      2013-03-07 22:32:04,642 INFO [org.jboss.profileservice.management.upload.remoting.DeployHandler] (http-0.0.0.0-80-4) invoke, payload:

      {DeploymentTargetID=names=[serverQuery.ear]}

      , parameter: stop
      2013-03-07 22:32:04,720 INFO [org.jboss.jpa.deployment.PersistenceUnitDeployment] (http-0.0.0.0-80-4) Stopping persistence unit persistence.unit:unitName=serverQuery.ear/serverQuery.jar#serverquery_persistence
      2013-03-07 22:32:04,782 INFO [org.jboss.profileservice.management.upload.remoting.DeployHandler] (http-0.0.0.0-80-4) invoke, payload:

      {DeploymentTargetID=names=[product.ear]}

      , parameter: stop
      2013-03-07 22:32:04,782 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (http-0.0.0.0-80-4) undeploy, ctxPath=/api
      2013-03-07 22:32:04,798 INFO [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] (http-0.0.0.0-80-4) Unbind EJB LocalHome 'myProductAPI' from jndi 'myProductAPILocal'
      2013-03-07 22:32:04,798 INFO [org.jboss.proxy.ejb.ProxyFactory] (http-0.0.0.0-80-4) Unbind EJB Home 'myProductAPI' from jndi 'myProductAPI'
      2013-03-07 22:32:04,813 INFO [org.jboss.ejb.EjbModule] (http-0.0.0.0-80-4) Undeployed myProductAPI
      2013-03-07 22:32:04,813 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (http-0.0.0.0-80-4) undeploy, ctxPath=/myProductapi
      2013-03-07 22:32:05,734 INFO [org.jboss.jpa.deployment.PersistenceUnitDeployment] (http-0.0.0.0-80-4) Stopping persistence unit persistence.unit:unitName=product.ear/product-ejb.jar#product_persistence
      2013-03-07 22:32:05,952 INFO [org.jboss.wsf.framework.management.DefaultEndpointRegistry] (http-0.0.0.0-80-4) remove: jboss.ws:context=myProductapi,endpoint=myProductAPI
      2013-03-07 22:32:06,061 INFO [org.jboss.profileservice.management.upload.remoting.DeployHandler] (http-0.0.0.0-80-4) invoke, payload:

      {DeploymentTargetID=names=[10usermanager.ear]}

      , parameter: stop
      2013-03-07 22:32:06,061 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (http-0.0.0.0-80-4) undeploy, ctxPath=/usermanager
      2013-03-07 22:32:06,077 INFO [org.jboss.jpa.deployment.PersistenceUnitDeployment] (http-0.0.0.0-80-4) Stopping persistence unit persistence.unit:unitName=10usermanager.ear/usermanager_ejb.jar#usermanager_persistence
      2013-03-07 22:32:06,919 INFO [org.jboss.profileservice.management.upload.remoting.DeployHandler] (http-0.0.0.0-80-4) invoke, payload:

      {DeploymentTargetID=names=[quartz-ra.rar]}

      , parameter: stop
      2013-03-07 22:32:06,935 INFO [org.quartz.core.QuartzScheduler] (http-0.0.0.0-80-4) Scheduler JBossQuartzScheduler_$_NON_CLUSTERED shutting down.
      2013-03-07 22:32:06,935 INFO [org.quartz.core.QuartzScheduler] (http-0.0.0.0-80-4) Scheduler JBossQuartzScheduler_$_NON_CLUSTERED paused.
      2013-03-07 22:32:06,935 INFO [org.quartz.core.QuartzScheduler] (http-0.0.0.0-80-4) Scheduler JBossQuartzScheduler_$_NON_CLUSTERED shutdown complete.
      2013-03-07 22:32:06,935 WARN [org.jboss.deployers.structure.spi.helpers.ComponentDeploymentContext] (http-0.0.0.0-80-4) Removing name on null names: jboss.naming:application=quartz-ra
      2013-03-08 02:57:36,172 ERROR [STDERR] (HandshakeCompletedNotify-Thread) Exception in thread "HandshakeCompletedNotify-Thread" java.util.ConcurrentModificationException

      2013-03-08 02:57:36,172 ERROR [STDERR] (HandshakeCompletedNotify-Thread) at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)

      2013-03-08 02:57:36,172 ERROR [STDERR] (HandshakeCompletedNotify-Thread) at java.util.HashMap$EntryIterator.next(HashMap.java:834)

      2013-03-08 02:57:36,172 ERROR [STDERR] (HandshakeCompletedNotify-Thread) at java.util.HashMap$EntryIterator.next(HashMap.java:832)

      2013-03-08 02:57:36,172 ERROR [STDERR] (HandshakeCompletedNotify-Thread) at com.sun.net.ssl.internal.ssl.SSLSocketImpl$NotifyHandshakeThread.run(SSLSocketImpl.java:2334)

      2013-03-08 03:06:11,430 WARN [org.apache.struts.action.RequestProcessor] (http-0.0.0.0-80-4) Unhandled Exception thrown: class javax.ejb.EJBAccessException
      2013-03-08 03:06:11,430 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/].[action]] (http-0.0.0.0-80-4) Servlet.service() for servlet action threw exception: javax.ejb.EJBAccessException: Invalid User
      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:161) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392) [:1.7.21]
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:88) [:1.7.21]
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:75) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143) [:1.7.21]
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.2.GA]
      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) [:1.0.1.GA]
      at $Proxy363.invoke(Unknown Source) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11]
      at $Proxy371.asynchronousDelayedJBossRestart(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_38]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_38]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_38]
      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_38]
      at com.product.util.sessions.SessionCache$ProxyInvocationHandler.invoke(SessionCache.java:228)
      at $Proxy372.asynchronousDelayedJBossRestart(Unknown Source) at com.product.myProduct.web.admin.actions.RestoreAction.execute(RestoreAction.java:162) [:]
      at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431) [:1.2.9]
      at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236) [:1.2.9]
      at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196) [:1.2.9]
      at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) [:1.2.9]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [:1.0.0.Final]
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [:1.0.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.1.0.Final]
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.1.0.Final]
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.1.0.Final]
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [:6.1.0.Final]
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.1.0.Final]
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:593) [:6.1.0.Final]
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.1.0.Final]
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.1.0.Final]
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:159) [:6.1.0.Final]
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.1.0.Final]
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.1.0.Final]
      at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:416) [:6.1.0.Final]
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.1.0.Final]
      at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.1.0.Final]
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.1.0.Final]
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.1.0.Final]
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.1.0.Final]
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.1.0.Final]
      at java.lang.Thread.run(Thread.java:662) [:1.6.0_38]

              Unassigned Unassigned
              sandeepj_jira sandeep j (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: