• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

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

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
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.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)
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.

// Remove an item.

// Remove an unexistant item from the Cart, will generate a NotInCartException.
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());
<?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">
<display-name>A simple cart jar</display-name>
<description>A demo cart bean package.</description>
<display-name>Shopping Cart</display-name>
<description>A simple shopping cart.</description>
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic