Hi,
I have an ejb deployed successfully. This is my client code:
package examples;
import javax.naming.Context;
import javax.naming.InitialContext;
import java.util.Properties;
public class HelloClient {
public static void main(String[] args) throws Exception {
Properties props = System.getProperties();
Context ctx = new InitialContext(props);
Object obj = ctx.lookup("HelloHome");
HelloHome home = (HelloHome) javax.rmi.PortableRemoteObject.narrow(obj,HelloHome.class);
Hello hello = home.create();
System.out.println(hello.hello());
hello.remove();
}
}
When I compile it & run it, I get an error: class not found (wrong name:examples/HelloClient). Can you please help? I have the ap server running. I'm using weblogic 8.1.
Thanks
Meera
-
Connecting to EJB (2 messages)
- Posted by: Arvind Arvind
- Posted on: March 02 2005 13:52 EST
Threaded Messages (2)
- Connecting to EJB by Tanmaya Sahoo on March 03 2005 16:42 EST
- Connecting to EJB by Amit Kumar on March 03 2005 17:32 EST
-
Connecting to EJB[ Go to top ]
- Posted by: Tanmaya Sahoo
- Posted on: March 03 2005 16:42 EST
- in response to Arvind Arvind
Hope You are running like
java examples.HelloClient (If running from console, run before the xamples dir. location.)
Also the classpath must have an entry just before examples package. -
Connecting to EJB[ Go to top ]
- Posted by: Amit Kumar
- Posted on: March 03 2005 17:32 EST
- in response to Tanmaya Sahoo
Common...again classpath problem.
Okay! do the following steps:
1) Open cmd prompt
2) run setenv.bat
3) say
set classpath=%classpath%;c:/yourBuildDirectory;
and now run your client.