1 Reply Latest reply on Jul 8, 2002 12:32 AM by piter

    Exception in thread "main" java.lang.NoClassDefFoundError: L

    piter

      All the Ejb's I deploy always generate the same exception when I attempt to get their Home interface from the JNDI lookup:

      Got context
      Exception in thread "main" java.lang.NoClassDefFoundError: Ljavax/transaction/TransactionManager;
      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:1480)
      at java.lang.Class.getField0(Class.java:1713)
      at java.lang.Class.getDeclaredField(Class.java:1176)
      at java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1404)
      at java.io.ObjectStreamClass.access$400(ObjectStreamClass.java:45)
      at java.io.ObjectStreamClass$3.run(ObjectStreamClass.java:331)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.io.ObjectStreamClass.(ObjectStreamClass.java:329)
      at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:249)
      at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:444)
      at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1511)
      at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1425)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1616)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:109)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1676)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1634)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
      at org.jboss.proxy.Interceptor.readExternal(Interceptor.java:109)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1676)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1634)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:322)
      at org.jboss.proxy.ClientContainer.readExternal(ClientContainer.java:104)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1676)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1634)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1264)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1830)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1756)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1636)
      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.MarshalledValuePair.get(MarshalledValuePair.java:30)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:449)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:429)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at ejb_jboss.jboss_client.SayHelloClient.main(SayHelloClient.java:47)
      ????c?




      My Client Code:



      /*
      * SayHelloClient.java
      *
      * Created on June 28, 2002, 10:46 PM
      */

      package ejb_jboss.jboss_client;
      import javax.naming.InitialContext;
      import javax.rmi.PortableRemoteObject;

      import ejb_jboss.jboss_ejb.HelloEjb;
      import ejb_jboss.jboss_ejb.HelloEjbHome;

      import java.util.Properties;
      /**
      *
      * @author piter
      */
      public class SayHelloClient
      {

      /** Creates a new instance of SayHelloClient */
      public SayHelloClient()
      {
      }

      /**
      * @param args the command line arguments
      */
      public static void main(String[] args)
      {
      // Enclosing the whole process in a single `try' block is not an ideal way
      // to do exception handling, but I don't want to clutter the program up
      // with catch blocks
      try
      {
      Properties p = new Properties();
      p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" );
      p.put("java.naming.provider.url", "jnp://localhost:1099" );
      p.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces" );

      // Get a naming context
      InitialContext jndiContext = new InitialContext( p );
      System.out.println("Got context");

      // Get a reference to the Interest Bean
      Object ref = jndiContext.lookup("HelloEjb");
      System.out.println("Got reference");

      // Get a reference from this to the Bean's Home interface
      HelloEjbHome home = (HelloEjbHome)PortableRemoteObject.narrow(ref, HelloEjbHome.class);

      // Create an Interest object from the Home interface
      HelloEjb helloEjb = home.create();

      // call the calculateCompoundInterest() method to do the calculation
      System.out.println("Interest on 1000 units, at 10% per period, compounded over 2 periods is:");
      System.out.println(helloEjb.sayHello( "some saying.."));
      }
      catch(Exception e)
      {
      System.out.println(e.toString());
      }


      }

      }