5 Replies Latest reply on Oct 11, 2012 5:50 PM by Stephen Coy

    EJB invocating the class in the wrong place.

    Cleiton Bonomini Newbie

      Hello, I'm getting an error while deploying my HUGE app.

       

      I've changed the JNDI form to the new architeture from JBoss 7.

       

      Okay! When I try to log in my app (it's already deployed) the EJB invacation, invokes from the WAR, and should be looking up to the EAR/lib JARs, 'cause the jar that it needs is located at EAR!

       

       

      Well, it of course causes me a ClassNotFound exception, what should I do?

       

       

       

       

       

      Hugs.

        • 1. Re: EJB invocating the class in the wrong place.
          jaikiran pai Master

          Can't really say what the problem is. You'll have to provide more details including the exact version of JBoss AS7, the relevant exception stacktraces and a bit more details about the lookup code and application packaging.

          • 2. Re: EJB invocating the class in the wrong place.
            Cleiton Bonomini Newbie

            Hi, the stack trace is here:

             

            13:48:47,505 ERROR [com.datasul.framework.dcl.i18n.translateliteral.I18NServiceDelegate] (http--0.0.0.0-8080-4) javax.naming.NamingException: Could not load ejb proxy class datasul.framework.i18n.I18NService [Root exception is java.lang.ClassNotFoundException: datasul.framework.i18n.I18NService from [Module "deployment.datasul-byyou-11.8.0-SNAPSHOT.ear.datasul-expedition-common-war-11.8.0-SNAPSHOT.war:main" from Service Module Loader]]

            13:48:47,509 ERROR [com.datasul.framework.ui.ro.DatasulService] (http--0.0.0.0-8080-4) RUNTIME_EXCEPTION: com.datasul.framework.dcl.exception.DatasulRuntimeException: RUNTIME_EXCEPTION

                    at com.datasul.framework.dcl.i18n.translateliteral.I18NServiceDelegate.getBean(I18NServiceDelegate.java:132) [datasul-framework-i18n-java-11.8.0-SNAPSHOT-client.jar:]

                    at com.datasul.framework.dcl.i18n.translateliteral.I18NServiceDelegate.processPackageTranslation(I18NServiceDelegate.java:162) [datasul-framework-i18n-java-11.8.0-SNAPSHOT-client.jar:]

                    at com.datasul.framework.dcl.i18n.translateliteral.InternationalizationServiceDelegate.processPackageTranslation(InternationalizationServiceDelegate.java:137) [datasul-framework-i18n-java-11.8.0-SNAPSHOT-client.jar:]

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                    at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                    at com.datasul.framework.ui.ro.DatasulService.realExecute(DatasulService.java:206) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at com.datasul.framework.ui.ro.DatasulService.execute(DatasulService.java:128) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_22]

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_22]

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_22]

                    at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_22]

                    at flex.messaging.services.remoting.adapters.JavaAdapter.invoke(JavaAdapter.java:421) [flex-messaging-remoting.jar:3.2.0.3978]

                    at flex.messaging.services.RemotingService.serviceMessage(RemotingService.java:183) [flex-messaging-remoting.jar:]

                    at flex.messaging.MessageBroker.routeMessageToService(MessageBroker.java:1503) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.AbstractEndpoint.serviceMessage(AbstractEndpoint.java:884) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.amf.MessageBrokerFilter.invoke(MessageBrokerFilter.java:121) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.amf.LegacyFilter.invoke(LegacyFilter.java:158) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.amf.SessionFilter.invoke(SessionFilter.java:44) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.amf.BatchProcessFilter.invoke(BatchProcessFilter.java:67) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.amf.SerializationFilter.invoke(SerializationFilter.java:146) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.endpoints.BaseHTTPEndpoint.service(BaseHTTPEndpoint.java:278) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at flex.messaging.MessageBrokerServlet.service(MessageBrokerServlet.java:322) [datasul-framework-communication-java-11.8.0-SNAPSHOT.jar:]

                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:397) [jbossweb-7.0.13.Final.jar:]

                    at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_22]

            Caused by: javax.naming.NamingException: Could not load ejb proxy class datasul.framework.i18n.I18NService [Root exception is java.lang.ClassNotFoundException: datasul.framework.i18n.I18NService from [Module "deployment.datasul-byyou-11.8.0-SNAPSHOT.ear.datasul-expedition-common-war-11.8.0-SNAPSHOT.war:main" from Service Module Loader]]

                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:108) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:96) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.lookup(EjbNamingContext.java:76) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

                    at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:100)

                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

                    at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_22]

                    at com.datasul.framework.dcl.persistence.JavaServiceLocator.getLocalSession(JavaServiceLocator.java:98) [datasul-framework-library-java-11.8.0-SNAPSHOT.jar:]

                    at com.datasul.framework.dcl.persistence.JavaServiceLocator.getLocalSession(JavaServiceLocator.java:106) [datasul-framework-library-java-11.8.0-SNAPSHOT.jar:]

                    at com.datasul.framework.dcl.i18n.translateliteral.I18NServiceDelegate.getBean(I18NServiceDelegate.java:127) [datasul-framework-i18n-java-11.8.0-SNAPSHOT-client.jar:]

                    ... 39 more

            Caused by: java.lang.ClassNotFoundException: datasul.framework.i18n.I18NService from [Module "deployment.datasul-byyou-11.8.0-SNAPSHOT.ear.datasul-expedition-common-war-11.8.0-SNAPSHOT.war:main" from Service Module Loader]

                    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                    at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_22]

                    at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_22]

                    at org.jboss.ejb.client.naming.ejb.EjbNamingContext.createEjbProxy(EjbNamingContext.java:106) [jboss-ejb-client-1.0.5.Final.jar:1.0.5.Final]

             

             

            Also, the application structure is:

             

            EAR has the WARs, the main WAR has lots of libs inside WEB-INF/lib

            EAR/lib are the jars.

             

            When logging into the app "localhost:8080/myapp" I got the stack trace above.

             

            From what I got, the lookup is fine, anyway, it's trying to invoke from the WAR:main, but it's located at EAR:main.

             

            I tried to move from EAR/lib to main-war/WEB-INF/lib, but then other JARs depends on the moved one, what makes me get in a eternal loop moveing those

             

             

            Ty.

            • 3. Re: EJB invocating the class in the wrong place.
              Nicklas Karlsson Master

              Have you looked at https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7 ?

               

              It looks like a class in datasul-expedition-common-war needs the datasul.framework.i18n.I18NService (which is in a jar in the ear lib?)

              • 4. Re: EJB invocating the class in the wrong place.
                Cleiton Bonomini Newbie

                Yeah, I know this. But this is the one that I told, when I try to move this jar to the WAR, I get a dupplicated one, then it throws me an exception...

                 

                 

                I dunno what to do at this point...

                 

                • 5. Re: EJB invocating the class in the wrong place.
                  Stephen Coy Master

                  You have not mentioned where your EJB classes are in the deployment. Typically they will be in a jar in the root of the EAR together with your WAR files (and not in the EAR/lib directory).