5 Replies Latest reply on Jan 5, 2005 1:37 PM by rzeppa

    Problems with deployment

    rzeppa Newbie

      Hello,

      i have a problem with following configuration. There is one jar file (A.JAR) which contains my Service layer (Sessions Beans) including the generated classes. Also there is a jar file (B.JAR) containing the business logic which is called from the SessionBeans. A.JAR depends on B.JAR unidirectional.
      The deployment of the jars works fine and also some Bean methods. But some Bean methods (methods which are creating instances of classes which are defined in the B.JAR) cause a NoClassDefFoundError on the server side when invoking this method.

      Here is the call stack:
      java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      java.rmi.ServerError: Unexpected Error; nested exception is:
      java.lang.NoClassDefFoundError: com/siemens/ts/maki/platform/gui/framework/graphiceditor/figures/Symbol
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
      at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
      at sun.rmi.server.UnicastRef.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:118)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:96)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
      at $Proxy1.getDefaultSymbolCatalog(Unknown Source)
      at TestClient$TestThread.test2(TestClient.java:249)
      at TestClient$TestThread.run(TestClient.java:194)
      Caused by: java.rmi.ServerError: Unexpected Error; nested exception is:
      java.lang.NoClassDefFoundError: com/siemens/ts/maki/platform/gui/framework/graphiceditor/figures/Symbol
      at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:374)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      at org.jboss.ejb.Container.invoke(Container.java:854)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:775)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
      at sun.rmi.transport.Transport$1.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NoClassDefFoundError: com/siemens/ts/maki/platform/gui/framework/graphiceditor/figures/Symbol
      at service.symbolmanagement.ejb.SymbolCatalogPoolManagementServiceBean.getDefaultSymbolCatalog(SymbolCatalogPoolManagementServiceBean.java:121)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:113)
      at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
      at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:316)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:149)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      ... 25 more

      Are there any ideas what i did wrong?

      best regards
      Sven

        • 2. Re: Problems with deployment
          rzeppa Newbie

          Thank you for your answer.

          I'm using JBoss 4.0 and i tried two ways to deploy my application:

          A.JAR contains the SessionBeans. This Beans uses classes from B.JAR.
          The deployment works fine, because test methods which return a primitive datatype work.
          B.JAR contains the logic which has to be called by the SessionBeans.

          1. I deployed the jar files as they are to the deploy directory of my jboss configuration.
          2. I created a EAR file containing A.JAR and B.JAR.

          But it doesn't work. It's very strange that the verification process during the deployment doesn't get errors. There the classes seems to be found. Although some classes of the B.jar can be found and instanceiated.

          i have no idea what is going wrong.

          greetings
          sven

          • 3. Re: Problems with deployment
            Bernd Zeitler Expert

             

            It's very strange that the verification process during the deployment doesn't get errors.

            No resrouces are checked (but deployment descriptors and bean interfaces) an no bean is instanciated during deployment.

            some classes of the B.jar can be found and instanceiated

            So this is not a classloader problem. Some resources are missing! Is the Symbol class available? Are all the resources/classes available Symbol needs when the classloader tries to load it (watch attributes and static initializers...)

            Do you really want to load classes in jboss out of your gui package / graphiceditor package? Rethink your assembly/deployment or packaging.

            • 4. Re: Problems with deployment
              rzeppa Newbie

              Thank you for your answer.

              "No resrouces are checked (but deployment descriptors and bean interfaces) an no bean is instanciated during deployment. "

              But if i instanceiate the class Symbol by Class.forName().newInstance() the deployment will stop with an error message, so there must be some kind of check.


              "So this is not a classloader problem. Some resources are missing! Is the Symbol class available? Are all the resources/classes available Symbol needs when the classloader tries to load it (watch attributes and static initializers...) "

              The jar file is a standalone application which is working fine. There are no static initalizers in this class and its context. So there is no resource missing.

              "Do you really want to load classes in jboss out of your gui package / graphiceditor package? Rethink your assembly/deployment or packaging."

              No, i'am trying to migrate our standalone server application with a selfwritten service layer to jboss. This is only a prototype. Later on we do not use classes of the gui package.

              I wrote a sample application with the same configuration A.jar, B.jar and so on, and it works fine, but why? I don't know!! The problem occuring using the big jar and the will not occur.
              Do you have any other ideas what i can do or who i can ask?

              greetings
              sven

              • 5. Re: Problems with deployment
                rzeppa Newbie

                Sorry, you are right! There is one external library missing :-(
                No it works!

                greetings
                sven