4 Replies Latest reply on Aug 8, 2002 6:31 PM by leela

    java.lang.NoClassDefFoundError: org/jboss/logging/Logger

    Dimitri Pissarenko Newbie

      Hello!

      I have a simple client application with the following code:

      try
      {
      ...
      Object ref = jndiContext.lookup("JBossTest/HelloWorldBean");
      System.out.println("Got reference");
      HelloWorldHome home = (HelloWorldHome)PortableRemoteObject.narrow(ref, HelloWorldHome.class);

      /* Error occurs on the following line */
      HelloWorld helloWorld = home.create();


      System.out.println("Results of helloWorld.sayHello() is :" + helloWorld.sayHello());
      ...
      }
      catch (...)
      {
      }

      When I try to get the remote interface by

      HelloWorld helloWorld = home.create();

      the exception "java.lang.NoClassDefFoundError: org/jboss/logging/Logger" is thrown. The stack trace is:


      java.lang.NoClassDefFoundError: org/jboss/logging/Logger

      at org.jboss.invocation.MarshalledValueInputStream.(MarshalledValueInputStream.java:25)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:120)

      at org.jboss.invocation.MarshalledValueOutputStream.class$(MarshalledValueOutputStream.java:26)

      at org.jboss.invocation.MarshalledValueOutputStream.(MarshalledValueOutputStream.java:28)

      at org.jboss.invocation.MarshalledValue.(MarshalledValue.java:47)

      at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:317)

      at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1172)

      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:366)

      at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:268)

      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:106)

      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)

      at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)

      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)

      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)

      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)

      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)

      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)

      at $Proxy0.create(Unknown Source)

      at ebjtest.HelloWorldClient.main(HelloWorldClient.java:27)

      Exception in thread "main"

      Does someone know what the meaning of the exception "java.lang.NoClassDefFoundError: org/jboss/logging/Logger" is and how to solve this problem?

      Thanks

      Dimitri Pissarenko

        • 1. Re: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
          Adrian Brock Master

          You need to add jboss-common-client.jar from the client
          directory to your classpath.

          Regards,
          Adrian

          • 2. Re: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
            ron alexander Newbie

            Was having that problem and added common-client.jar to the classpath and now I get this.

            java.lang.NoClassDefFoundError: org/apache/log4j/Priority

            Any help? Stack is below.

            Thanks,
            Ron
            -----
            stack

            java.lang.NoClassDefFoundError: org/apache/log4j/Priority
            at org.jboss.invocation.MarshalledValueInputStream.(MarshalledValueInputStream.java:25)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:130)
            at org.jboss.invocation.MarshalledValueOutputStream.class$(MarshalledValueOutputStream.java:26)
            at org.jboss.invocation.MarshalledValueOutputStream.(MarshalledValueOutputStream.java:28)
            at org.jboss.invocation.MarshalledValue.(MarshalledValue.java:47)
            at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInvocation.java:317)
            at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1262)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1243)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
            at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:265)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:124)
            at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
            at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
            at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
            at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
            at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
            at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
            at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
            at $Proxy0.create(Unknown Source)
            at org.jboss.docs.interest.InterestClient.main(InterestClient.java:39)
            Java Result: 1

            • 3. Re: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
              Adrian Brock Master

              And log4j.jar, although I think the requirement to use
              log4j on the client side is being removed in a later
              release.

              Regards,
              Adrian

              • 4. Re: java.lang.NoClassDefFoundError: org/jboss/logging/Logger
                leela Newbie

                Does any one know why iam gettign this error after adding jboss-common-client.jar to my classpath

                iam using jboss3.0.1RC1 and trying to access Sessionbean from simple java client and at ctx.lookup(), it fails and throws me below error message..


                -- Initializing bean access.
                before Initial Context
                after initial Context
                context is not null
                ctx.lookup()
                Exception in thread "main" java.lang.ExceptionInInitializerError
                at sun.rmi.runtime.Log$LoggerLogFactory.createLog(Log.java:155)
                at sun.rmi.runtime.Log.getLog(Log.java:121)
                at sun.rmi.server.LoaderHandler.(LoaderHandler.java:60)
                at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:629)
                at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:257)
                at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.jav
                a:200)
                at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:150
                3)
                at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
                at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1
                616)
                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
                at java.rmi.MarshalledObject.get(MarshalledObject.java:135)
                at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:169)
                at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:995)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:441)
                at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:434)
                at javax.naming.InitialContext.lookup(InitialContext.java:347)
                at com.basystems.netman.cmmgr.BasEntityTestClient.(BasEntityTestCl
                ient.java:58)
                at com.basystems.netman.cmmgr.BasEntityTestClient.main(BasEntityTestClie
                nt.java:225)
                Caused by: java.lang.IllegalArgumentException: Null charset name
                at java.nio.charset.Charset.lookup(Charset.java:376)
                at java.nio.charset.Charset.isSupported(Charset.java:405)
                at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:67)

                at java.io.OutputStreamWriter.(OutputStreamWriter.java:93)
                at java.util.logging.StreamHandler.setOutputStream(StreamHandler.java:11
                6)
                at java.util.logging.StreamHandler.(StreamHandler.java:92)
                at sun.rmi.runtime.Log$InternalStreamHandler.(Log.java:261)
                at sun.rmi.runtime.Log$1.run(Log.java:169)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.rmi.runtime.Log$LoggerLog.(Log.java:165)
                ... 19 more


                Ur Response is appreciated.
                Thanks
                leela