Hi Lisa,

Please don't post outside of the list so that others also get to see the
issue. And please no console screenshots, just the text.


Lien Hong Nguyen wrote
> Here is the client code of HelloClient.java
>  
> package org.acme;
> import java.util.Properties;
> import javax.naming.InitialContext;
> import javax.naming.Context;
> import javax.rmi.PortableRemoteObject;
> public class HelloClient{
>     public static void main(String[] args) throws Exception{
>       Properties props = new Properties();
>      
> props.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory");
>       props.put(Context.PROVIDER_URL,"ejbd://127.0.0.1:4201");
>       Context ctx = new InitialContext(props);
>       Object ref = ctx.lookup("HelloBeanRemote");
>       Hello h = (Hello)PortableRemoteObject.narrow(ref,Hello.class);
>       String result = h.sayHello();
>       System.out.println(result);
>     }
> }
> 
> 
> java HelloClient
> 
> NoClassDefFoundError: HelloClient (wrong name:  org/acme/HelloClient)

The error you are having is due to the fact that you are calling a class
with a namepace (package org.acme) from the same directory. For your simple
test just remove or comment out that line.

Andy.




--
View this message in context: 
http://openejb.979440.n4.nabble.com/Fail-to-run-the-client-when-start-openejb-server-tp4668274p4668298.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to