Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NoClassDefFoundError

 
richard marais
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic