6 Replies Latest reply on Mar 28, 2006 7:26 AM by Anton Duca

    Where to place JAR library

    Anton Duca Newbie

      Hi

      I have written an application using EJB 3.0.

      Some EJB Session Beans use classes from a library named clase_maporama.jar.

      When I invoke methods of these EJBs I get runtime errors (class not found - for classes from clase_maporama.jar).

      I have put the clase_maporama.jar archive in the jboss's client, server/default/lib, and server/default/deploy but no effect.

      Thanks
      Tony


        • 1. Re: Where to place JAR library
          jaikiran pai Master

          How is your application packaged? Is it an .ear. If yes then, place the clase_maporama.jar directly in the myApp.ear and make an entry in the application.xml(present in myApp.ear/META-INF directory) as follows:

          <module>
           <java>clase_maporama.jar</java>
           </module>


          However, the classes in your clase_maporama.jar should have been loaded, when you had placed this jar under %JBOSS_HOME%/server/default/lib directory.

          • 2. Re: Where to place JAR library
            Anton Duca Newbie

            Yes. It is an EAR. I forgot to mention I already tried the "java" tag option (which is the most elegant).

            My application.xml is:

            <module>
             <ejb>logitrack.ejb3</ejb>
             </module>
             <module>
             <ejb>logitrack.par</ejb>
             </module>
             <module>
             <java>clase_maporama.jar</java>
             </module>
             <module>
             <web>
             <web-uri>logitrack.war</web-uri>
             <context-root>logitrack</context-root>
             </web>
             </module>

            I just dont get why is not working.

            Thanks
            Tony

            • 3. Re: Where to place JAR library
              jaikiran pai Master

              Post the stack trace of the exception that you are seeing

              • 4. Re: Where to place JAR library
                Anton Duca Newbie

                Fist of all I would like to thank you for trying to help me.
                (Bucharest Romania Computer Science Teaching Assistant here)

                Here it is the stack trace:

                javax.servlet.ServletException: Servlet execution threw an exception
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                
                
                root cause
                
                java.lang.NoClassDefFoundError: MapoWebService_pkg/MapoWebServiceLocator
                 ro.logicadsoftware.logitrack.ejb.LogitrackBean.getMaporamaMap4Position(LogitrackBean.java:101)
                 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 java.lang.reflect.Method.invoke(Method.java:585)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
                 org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
                 org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:32)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
                 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
                 org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:148)
                 org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:60)
                 $Proxy67.getMaporamaMap4Position(Unknown Source)
                 ro.logicadsoftware.logitrack.web.users.RealTimeCarPositionServlet.processRequest(RealTimeCarPositionServlet.java:69)
                 ro.logicadsoftware.logitrack.web.users.RealTimeCarPositionServlet.doGet(RealTimeCarPositionServlet.java:90)
                 javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
                 javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
                
                


                • 5. Re: Where to place JAR library
                  jaikiran pai Master

                   

                  java.lang.NoClassDefFoundError: MapoWebService_pkg/MapoWebServiceLocator


                  Just as i guessed, this is not a Class not found exception. This is a NoClassDefFoundError, which means that the classes referred by MapoWebService_pkg/MapoWebServiceLocator(through its import statements or extends statement or through some other means) are NOT present in the classpath. Place these classes/jars in the classpath

                  • 6. Re: Where to place JAR library
                    Anton Duca Newbie

                    Ooops.

                    You are right.

                    These clase_maporama.jar was created using the AXIS wsdl
                    (I thought Jboss has all it needs for these - JUST TO FIND AN EXCUSE)


                    Thank you very much
                    Tony