2 Replies Latest reply on Jul 21, 2003 10:30 AM by darrinps

    JBossTransactionRolledbackLocalException?

    darrinps Newbie

      I'm trying to get a simple little HelloWorld example to work and I'm getting a JBoss exception that I cannot find listed on the Internet.

      Here is what I get:

      C:\jboss-4.0.0DR2\Projects\Hello>java ie.tcd.cs.ejb_example.HelloWorldClient

      Creating initial context
      Looking up HelloWorld

      Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/tm/JBossTra
      nsactionRolledbackLocalException
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Unknown Source)
      at java.lang.Class.getField0(Unknown Source)
      at java.lang.Class.getDeclaredField(Unknown Source)
      at java.io.ObjectStreamClass.getDeclaredSUID(Unknown Source)
      at java.io.ObjectStreamClass.access$400(Unknown Source)
      at java.io.ObjectStreamClass$3.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.(Unknown Source)
      at java.io.ObjectStreamClass.lookup(Unknown Source)
      at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
      at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
      at java.io.ObjectInputStream.readClassDesc(Unknown Source)
      at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
      at java.io.ObjectInputStream.readClassDesc(Unknown Source)
      at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
      at java.io.ObjectInputStream.readObject0(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.util.HashMap.readObject(Unknown Source)
      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 java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
      at java.io.ObjectInputStream.readSerialData(Unknown Source)
      at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
      at java.io.ObjectInputStream.readObject0(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.util.HashMap.readObject(Unknown Source)
      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 java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
      at java.io.ObjectInputStream.readSerialData(Unknown Source)
      at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
      at java.io.ObjectInputStream.readObject0(Unknown Source)
      at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
      at java.io.ObjectInputStream.readSerialData(Unknown Source)
      at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
      at java.io.ObjectInputStream.readObject0(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:113
      )
      at java.io.ObjectInputStream.readExternalData(Unknown Source)
      at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
      at java.io.ObjectInputStream.readObject0(Unknown Source)
      at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
      at java.io.ObjectInputStream.readSerialData(Unknown Source)
      at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
      at java.io.ObjectInputStream.readObject0(Unknown Source)
      at java.io.ObjectInputStream.readObject(Unknown Source)
      at java.rmi.MarshalledObject.get(Unknown Source)
      at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:3
      0)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:522)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:479)
      at javax.naming.InitialContext.lookup(Unknown Source)
      at ie.tcd.cs.ejb_example.HelloWorldClient.main(HelloWorldClient.java:27)



      Here is my client code:


      package ie.tcd.cs.ejb_example;

      import javax.naming.Context;
      import javax.naming.InitialContext;
      import java.util.Hashtable;

      public class HelloWorldClient
      {

      public static void main( String [] args )
      {

      Hashtable env = new Hashtable();
      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      env.put(Context.PROVIDER_URL, "localhost:1099");
      env.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

      try
      {

      System.out.println("Creating initial context");

      Context ctx = new InitialContext(env);

      System.out.println("Looking up HelloWorld");

      Object obj = ctx.lookup( "HelloWorld" );

      HelloWorldHome home = (HelloWorldHome)javax.rmi.PortableRemoteObject.narrow( obj, HelloWorldHome.class );

      HelloWorld helloWorld = home.create();

      System.out.println( helloWorld.hello());
      helloWorld.remove();

      }

      catch ( Exception e )
      {

      e.printStackTrace();

      System.out.println( "Exception: " + e.getMessage() );

      }
      }
      }


      Here is what my classpath looks like:

      .;C:\Program Files\Altova\xmlspy\XMLSpyInterface.jar;
      %JAVA_HOME%\jre\lib;%ANT_HOME%\lib\ant.jar;
      %JBOSS_HOME%\server\all\lib\jboss-j2ee.jar;
      %JBOSS_HOME%\client\log4j.jar;
      %JBOSS_HOME%\client\jboss-common-client.jar;
      %JBOSS_HOME%\client\jboss-system-client.jar;
      %JBOSS_HOME%\client\jnp-client.jar;
      %JBOSS_HOME%\client\jboss-client.jar;
      %JBOSS_HOME%\client\jbosssx-client.jar;
      %JBOSS_HOME%\client\jbossall-client.jar;
      %JBOSS_HOME%\Projects\Hello\HelloWorld.jar;
      %JBOSS_HOME%\server\default\lib\jboss-j2ee.jar

      Is there something else I need in my classpath maybe?

      Thanks.

        • 1. Re: JBossTransactionRolledbackLocalException?
          Adrian Brock Master

          Just to confuse you :-), the jar with all client classes
          is now called jboss-all-client.jar in jboss4

          Regards,
          Adrian

          • 2. Re: JBossTransactionRolledbackLocalException?
            darrinps Newbie

            Thanks.

            That did get me further, but now I'm getting:\

            Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/system/Serv
            iceMBeanSupport
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$100(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
            at java.lang.ClassLoader.defineClass0(Native Method)
            at java.lang.ClassLoader.defineClass(Unknown Source)
            at java.security.SecureClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.defineClass(Unknown Source)
            at java.net.URLClassLoader.access$100(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
            at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
            at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
            at sun.rmi.server.MarshalInputStream.resolveClass(Unknown Source)
            at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
            at java.io.ObjectInputStream.readClassDesc(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            at java.util.HashMap.readObject(Unknown Source)
            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 java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:113
            )
            at java.io.ObjectInputStream.readExternalData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
            at java.io.ObjectInputStream.readSerialData(Unknown Source)
            at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
            at java.io.ObjectInputStream.readObject0(Unknown Source)
            at java.io.ObjectInputStream.readObject(Unknown Source)
            at java.rmi.MarshalledObject.get(Unknown Source)
            at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:3
            0)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:522)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:479)
            at javax.naming.InitialContext.lookup(Unknown Source)
            at ie.tcd.cs.ejb_example.HelloWorldClient.main(HelloWorldClient.java:27)

            Any clues on what I need to do for that one?