aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "NoClassDefFoundError" Watch "NoClassDefFoundError" New topic
Author

NoClassDefFoundError

richard marais
Ranch Hand

Joined: Aug 20, 2001
Posts: 30
I am trying to run a CMP entity ejb. I am trying to call a method on my remote interface but am getting a run time error, can anyone help please?

I am getting the following runtime error:
Root Error-1: com.ibm.ivj.ejb.runtime.AbstractEntityAccessBean
java.lang.NoClassDefFoundError: com.ibm.ivj.ejb.runtime.AbstractEntityAccessBean
The following method is producing this error:
public static String getHome()
throws NamingException, javax.ejb.CreateException, java.rmi.RemoteException
{
Ory_menuHome home = null;

// GET INITIAL CONTEXT
javax.naming.InitialContext initContext = null;
java.util.Hashtable properties = new java.util.Hashtable(2);
properties.put(javax.naming.Context.PROVIDER_URL, "iiop:///");
properties.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.ejs.ns.jndi.CNInitialContextFactory");
try
{
initContext = new javax.naming.InitialContext(properties);
}
catch (NamingException e)
{
System.out.println("Error Retrieving the Initial Context: "+e.getMessage());
}
// GET HOME INTERFACE
try
{
java.lang.Object o = initContext.lookup("Ory_MenuBean");
home = (Ory_menuHome)javax.rmi.PortableRemoteObject.narrow(o, Ory_menuHome.class);
}
catch (NamingException f)
{
System.out.println("Error Retrieving the Home Interface: "+f.getMessage());
}
// USING THE BEAN
try
{
//home.create(1);
com.ory.ejb.Ory_menuAccessBean iOab = new com.ory.ejb.Ory_menuAccessBean();
com.ory.ejb.Ory_menuKey pKey = (com.ory.ejb.Ory_menuKey) iOab.__getKey();
home.findByPrimaryKey(pKey);
}
catch (Exception g)
{
System.out.println("Error Creating new Ory_menuHome: "+g.getMessage());
}
// NOW CALL THE BUSINESS METHODS FROM THE CLIENT
Ory_menuBean remote = new Ory_menuBean();
System.out.println("URL = "+remote.getUrl());

return "URL = "+remote.getUrl();
}
Kjartan Aanestad
Greenhorn

Joined: Aug 22, 2001
Posts: 7
Hi
I had a similar problem and figured out that it had something to do with the classpath. The project containing the com.ibm.ivj.ejb.runtime package has to be included in your classpath to make it work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError