3 Replies Latest reply on Nov 1, 2012 3:12 PM by Ståle Tomten

    <error-page> not working for javax.ejb.NoSuchEJBException: JBAS016055

    Ståle Tomten Newbie

      We have a site that is frequently getting javax.ejb.NoSuchEJBException: JBAS016055 after a transaction has failed in a @Stateful ejb in a request.

       

      While we are working on fixing the actual bug that is causing the problem, i'd like to define an errorpage for the exception and make sure the user is logged out. Since this is a @Sessionscoped @Stateful ejb it makes the current session kind of useless.

       

      But when i define error-pages in web.xml it doesnt seem to affect this error.

      here is the configuration from our web.xml:

       

        <error-page>

          <exception-type>javax.ejb.NoSuchEJBException</exception-type>

          <location>/WEB-INF/errorPages/InvalidateSessionOnException.jsp</location>

        </error-page>

       

        <error-page>

          <exception-type>java.lang.Throwable</exception-type>

          <location>/WEB-INF/errorPages/Throwable.jsp</location>

        </error-page>

       

        <error-page>

          <error-code>500</error-code>

          <location>/WEB-INF/errorPages/Throwable.jsp</location>

        </error-page>

       

      It seems that this happens outside of the web-application and that the configuration is not used for this case ?

      The error-page for 500 and throwable works for other error-scenarios but not this one.

       

      Is there another place we can configure an error-page that invalidates the session ?

      We are running JBoss AS 7.1.3 with richfaces 4.2.3.Final.

      In older versions of JBoss this could be done via the ROOT web application configuration. Is there an equivalent in AS 7 ?

       

      Here is the stacktrace of the exception that occurs:

      13:16:21,426 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/xxx]] (ContainerBackgroundProcessor[StandardEngine[jboss.web]]) Session event listener threw exception: javax.ejb.NoSuchEJBException: JBAS016055: EJB has been removed

              at org.jboss.as.weld.ejb.StatefulSessionObjectReferenceImpl.getBusinessObject(StatefulSessionObjectReferenceImpl.java:124) [jboss-as-weld-7.1.3.Final.jar:7.1.3.Final]

              at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:108) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at org.jboss.weld.bean.proxy.EnterpriseTargetBeanInstance.invoke(EnterpriseTargetBeanInstance.java:56) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:105) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at xxx.xxx.xxx.xxx.$Proxy$_$$_Weld$Proxy$.toString(StartsideServer$Proxy$_$$_Weld$Proxy$.java) [classes:]

              at java.lang.String.valueOf(String.java:2854) [rt.jar:1.7.0_09]

              at java.lang.StringBuilder.append(StringBuilder.java:128) [rt.jar:1.7.0_09]

              at org.jboss.weld.context.SerializableContextualInstanceImpl.toString(SerializableContextualInstanceImpl.java:60) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at java.lang.String.valueOf(String.java:2854) [rt.jar:1.7.0_09]

              at java.lang.StringBuilder.append(StringBuilder.java:128) [rt.jar:1.7.0_09]

              at org.jboss.weld.context.beanstore.AttributeBeanStore.attach(AttributeBeanStore.java:109) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at org.jboss.weld.context.AbstractBoundContext.activate(AbstractBoundContext.java:66) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at org.jboss.weld.context.http.HttpSessionContextImpl.destroy(HttpSessionContextImpl.java:59) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at org.jboss.weld.servlet.WeldListener.sessionDestroyed(WeldListener.java:88) [weld-core-1.1.9.Final.jar:2012-08-06 19:12]

              at org.apache.catalina.session.StandardSession.expire(StandardSession.java:690) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:585) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:390) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:375) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1317) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1605) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1617) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1617) [jbossweb-7.0.17.Final.jar:]

              at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1591) [jbossweb-7.0.17.Final.jar:]

              at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09]