• Post Reply Bookmark Topic Watch Topic
  • New Topic

home.create()=>failed : java.lang. NoClassDefFoundError

 
Bruno Korcinski
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I'm running example from Orion app.server ,everything works fine /compiling,running,binding,authentication,/but I stoped on the line
home.create() where I got error
Exception in thread "main" java.lang. NoClassDefFoundError
org/omg /PortableServer/ POAOperations

. I spent two days with investigations(setuping classpath..and looking on net for similar errors..etc.
I set-up debug for Orion but there is not enough info for me to correct problem.can somebody help me? I put some prints to log so you can see
classpaths and running CartClient program print out....
----------------------------------------------------------
D:\orion2.0.2\orion\demo\ejb\cart>set classpath
CLASSPATH=E:\j2sdkee1.3\lib\j2ee.jar;D:\orion2.0.2\orion\orion.jar;
D:\orion2.0.2\orion\ejb.jar;D:\orion2.0.2\orion\jndi.jar;D:\orion2.0.2\orion\demo\ejb\cart;
D:\orion2.0.2\orion\demo\ejb\cart>cmd.exe /k java CartClient
************list of bind objects*************************************
java:comp, javax.naming.Context
MyProduct, ProductHome
MyCart, CartHome
com.evermind.ejb.EJBUser, com.evermind.ejb.EJBUserHome
************list of commands to get reference of MyCart object***********
1.Object homeObject = context.lookup(MyCart)...done.
2.CartHome home= (CartHome)PortableRemoteObject.narrow(homeObject, CartHome.class)...done.
Exception in thread "main" java.lang.NoClassDefFoundError: org/omg/PortableServer/POAOperations
at com.evermind._bp.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(.:1497)
at com.evermind._bp.invokeMethod(.:1420)
at com.evermind._oi.invoke(.:53)
at com.evermind._yp.invoke(.:22)
at __Proxy1.create(Unknown Source)
at CartClient.main(CartClient.java:61)
**********************************************************
code for CartClient
import java.rmi.RemoteException;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.util.*;
/**
* A simple client for accessing a Cart.
*/
public class CartClient
{
public static void main(String[] args)
{
try
{
Context context;

Hashtable env = new Hashtable();
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.evermind.server.ApplicationClientInitialContextFactory");
env.put(javax.naming.Context.PROVIDER_URL , "ormi://localhost/ejbsamples");
env.put(javax.naming.Context.SECURITY_PRINCIPAL , "admin");

context = new javax.naming.InitialContext(env);

System.out.println("\n************list of bind objects**********");

NamingEnumeration items = context.list("");
while(items.hasMoreElements()) {
NameClassPair item = (NameClassPair)items.next();
System.out.println(" " + item.getName() + ", " +item.getClassName());
}

System.out.println("\n**list of commands to get reference of MyCart object\n");
Object homeObject = context.lookup("MyCart");
System.out.println("1.Object homeObject = context.lookup(MyCart)...done");
CartHome home =(CartHome)PortableRemoteObject.narrow(homeObject, CartHome.class);
System.out.println("2.Object CartHome home= (CartHome)PortableRemoteObject.narrow(homeObject, CartHome.class)...done");
Cart cart = (Cart)PortableRemoteObject.narrow(home.create(), Cart.class);
System.out.println("3.Cart = home.create();...done");

// Add some items to the Cart.
cart.add("Milk");
cart.add("Apples");
cart.add("Pizza");

// Remove an item.
cart.remove("Apples");

// Remove an unexistant item from the Cart, will generate a NotInCartException.
cart.remove("Oranges");
}
catch(RemoteException e)
{
System.err.println("System/communication error: " + e.getMessage());
}
catch(NamingException e)
{
System.err.println("Communication error: " + e.getMessage());
}
catch(CreateException e)
{
System.err.println("Error creating cart: " + e.getMessage());
}
catch(NotInCartException e)
{
System.err.println("Item not found in cart: " + e.getMessage());
}
}
}
******************ejb-jar***************************************
<?xml version="1.0"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.2//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_2.dtd">
<ejb-jar>
<display-name>A simple cart jar</display-name>
<description>A demo cart bean package.</description>
<enterprise-beans>
<session>
<display-name>Shopping Cart</display-name>
<description>A simple shopping cart.</description>
<ejb-name>MyCart</ejb-name>
<home>CartHome</home>
<remote>Cart</remote>
<ejb-class>CartEJB</ejb-class>
<session-type>Stateful</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
<assembly-descriptor>
</assembly-descriptor>
</ejb-jar>
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!