users@glassfish.java.net

Re: NamingException ejb ref resolution error for remote business interface

From: <glassfish_at_javadesktop.org>
Date: Sun, 04 Nov 2007 19:11:38 PST

I just wrote a similar app and it just worked with no glitch at all.

My app has a stand-alone ejb module deployed to my company's machine, and a standalone client running in my home pc to access the remote ejb across vpn. The only difference is my ejb only implements a remote interface, no local interface. But I don't think it should matter.

@Stateless(mappedName="FooBean")
public class FooBean implements FooRemote {
    public String echo(String s) {
        return s;
    }
}

public class Client {
    public static void main(String[] args) throws Exception {
        Context ic = new InitialContext();
        //Object obj = ic.lookup(FooRemote.class.getName());
        Object obj = ic.lookup("FooBean");
        System.out.println("lookup returned " + obj);
        ... ...

C:\foo\classes>java -cp \simple-ejb3\dist\foo-client-view.jar;.;%s1as_home%\lib\javaee.jar;%s1as_home%\l
ib\appserv-rt.jar -Dorg.omg.CORBA.ORBInitialHost=xxx.sun.com -Dorg.omg.CORBA.ORBInitialPort=3700 foo
.Client xxxx
lookup returned foo._FooRemote_Wrapper_at_e9738564
foo.echo returned xxxx

My bean class also use @Stateless (mappedName="xxx").

I was running from command line, not netbeans.

Since your RootException is a java.lang.ClassNotFoundException: com.world.Session.PersonRemote]

I strongly encourage you go from here. I suppose this exception is from the client side, right? Is this class on your client classpath at runtime? Is any class referenced by this class in your client classpath? Can you post the complete client command?

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

http://forums.java.net/jive/thread.jspa?messageID=243744