10 Replies Latest reply on Jun 15, 2007 3:32 AM by eirirlar

    ELContext exception

    lcoetzee

      Hi,

      at times I see a NoClassDefFoundError exception in my log file. Normally occurs when the RemoveInterceptor is removing. Below is a typical exception. Note the ELContext exception:

      Caused by: java.lang.NoClassDefFoundError: javax/el/ELContext


      Any idea why this happens ?

      2006-11-22 10:23:04,724 DEBUG [org.jboss.seam.interceptors.RemoveInterceptor] Stateful component was removed: contentManagementBean
      2006-11-22 10:23:04,724 WARN [org.jboss.seam.contexts.Contexts] Could not destroy component: contentManagementBean
      java.lang.reflect.UndeclaredThrowableException
       at $Proxy1290.theEnd(Unknown Source)
       at csir.content.management.seam.ContentManagement$$FastClassByCGLIB$$d3cf354d.invoke(<generated>)
       at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
       at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:45)
       at org.jboss.seam.intercept.ClientSideInterceptor$1.proceed(ClientSideInterceptor.java:69)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:55)
       at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
       at sun.reflect.GeneratedMethodAccessor5862.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ExceptionInterceptor.handleExceptions(ExceptionInterceptor.java:28)
       at sun.reflect.GeneratedMethodAccessor5681.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.ClientSideInterceptor.interceptInvocation(ClientSideInterceptor.java:78)
       at org.jboss.seam.intercept.ClientSideInterceptor.intercept(ClientSideInterceptor.java:47)
       at org.jboss.seam.intercept.Proxy$$EnhancerByCGLIB$$ed38f46c.theEnd(<generated>)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.util.Reflections.invokeAndWrap(Reflections.java:102)
       at org.jboss.seam.Component.callComponentMethod(Component.java:1759)
       at org.jboss.seam.Component.callDestroyMethod(Component.java:1715)
       at org.jboss.seam.contexts.Contexts.destroy(Contexts.java:186)
       at org.jboss.seam.contexts.Lifecycle.endSession(Lifecycle.java:222)
       at org.jboss.seam.servlet.SeamListener.sessionDestroyed(SeamListener.java:45)
       at org.apache.catalina.session.StandardSession.expire(StandardSession.java:687)
       at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:579)
       at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:678)
       at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:663)
       at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1284)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1569)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1578)
       at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1558)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.reflect.InvocationTargetException
       at sun.reflect.GeneratedMethodAccessor5747.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ManagedEntityIdentityInterceptor.aroundInvoke(ManagedEntityIdentityInterceptor.java:79)
       at sun.reflect.GeneratedMethodAccessor5684.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:23)
       at sun.reflect.GeneratedMethodAccessor5683.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:51)
       at sun.reflect.GeneratedMethodAccessor5682.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.seam.util.Reflections.invoke(Reflections.java:18)
       at org.jboss.seam.intercept.Interceptor.aroundInvoke(Interceptor.java:169)
       at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:64)
       at org.jboss.seam.intercept.RootInterceptor.createSeamInvocationContext(RootInterceptor.java:144)
       at org.jboss.seam.intercept.RootInterceptor.invokeInContexts(RootInterceptor.java:129)
       at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:102)
       at org.jboss.seam.intercept.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:49)
       at sun.reflect.GeneratedMethodAccessor5755.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:118)
       at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:63)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPolicy.invokeInNoTx(TxPolicy.java:66)
       at org.jboss.aspects.tx.TxInterceptor$NotSupported.invoke(TxInterceptor.java:111)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:83)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulRemoveInterceptor.invoke(StatefulRemoveInterceptor.java:81)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:77)
       at org.jboss.ejb3.security.Ejb3AuthenticationInterceptor.invoke(Ejb3AuthenticationInterceptor.java:131)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
       at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
       at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:203)
       at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
       ... 47 more
      Caused by: java.lang.NoClassDefFoundError: javax/el/ELContext
       at org.jboss.seam.util.UnifiedELValueBinding.<init>(UnifiedELValueBinding.java:18)
       at org.jboss.seam.core.Expressions$1.getFacesValueBinding(Expressions.java:66)
       at org.jboss.seam.core.Expressions$1.getValue(Expressions.java:48)
       at org.jboss.seam.Component.getInstanceFromFactory(Component.java:1641)
       at org.jboss.seam.Component.getInstance(Component.java:1590)
       at org.jboss.seam.Component.getInstance(Component.java:1567)
       at org.jboss.seam.Component.getInstanceToInject(Component.java:1810)
       at org.jboss.seam.Component.injectFields(Component.java:1317)
       at org.jboss.seam.Component.inject(Component.java:1087)
       at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:48)
       ... 108 more
      


      Thanks

      Louis

        • 1. Re: ELContext exception
          gavin.king

          Seam 1.1 has a dependency to el-api and el-impl jars, which 1.0.1 did not have. Are you sure you have included those in your ear?

          • 2. Re: ELContext exception
            lcoetzee

            Jip.


            In my WAR:

            WEB-INF/lib/el-api.jar
            WEB-INF/lib/el-ri.jar
            


            • 3. Re: ELContext exception

              You need to add in your application.xml:

               <module>
               <java>el-api.jar</java>
               </module>
               <module>
               <java>el-ri.jar</java>
               </module>
              


              And your ear file must contains these 2 jars along with your jboss-seam.jar

              I hope it helps.

              Richard

              • 4. Re: ELContext exception
                lcoetzee

                Thanks. I have added it ! I will keep an eye on the log file to see if it has solved it !

                Interesting that the seam examples do not contain it though.

                L

                • 5. Re: ELContext exception
                  gavin.king

                  Do the Seam examples run OK for you?

                  • 6. Re: ELContext exception
                    gavin.king

                    I checked the code. The EL is only used directly when not in the context of a FacesContext. So it is needed during session destruction. Really this dependency needs to be documented.

                    • 7. Re: ELContext exception
                      lowecg2004

                      I came across this and, yes, adding el-*.jar as modules at the EAR level resolved the issue.

                      • 8. Re: ELContext exception

                        It's very possible that this is something I would and should know if I read up on ear-packaging, but if anyone has the courtesy to answer I'd be happy :)

                        Why is it necessary to reference the jboss-seam.jar, el-api.jar and el-ri.jar in the application.xml of your seam ear application?

                        (For comparison; working with Spring you don't have to do this - just include the spring.jar in the root of your ear).

                        Thanks, Eirik

                        • 9. Re: ELContext exception
                          christian.bauer

                          You need to list the "dependency" either in application.xml (which is not really correct, because the JARs are not really "Java Client Modules") or in web.war/META-INF/MANIFEST.MF and beans.jar/META-INF/MANIFEST.MF as a Classpath: entry. Most Seam examples use the first strategy.

                          • 10. Re: ELContext exception

                            I've removed the modules for el-api, el-ri and jboss-seam from the ear's application.xml, and instead listed the jar-dependencies in the ejb's and web's META-INF/MANIFEST.MF like this:

                            Class-Path: lib/jboss-seam-1.2.1.jar lib/el-api-1.2.1.jar lib/el-ri-1.2.1.jar

                            It works! Thanks.

                            However, I've tried removing the classpath entries from the ejbproject.jar's MANIFEST.MF, and to my surprise it still works(!) Do I really need to list el-api, el-ri and jboss-seam jars here?

                            (Removing el-api, el-ri and jboss-seam jars from both the ear's application.xml and the war's MANIFEST.MF did not work, as expected).