Fixed it !!!
I found:
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB.
If the standlone client is to be run on the same machine as the app server, the client code is as simple as:-
package www.client.com;
import javax.naming.Context;
import javax.naming.InitialContext;
import www.async.com.AsyncBeanRemote;
//import www.async.com.AsyncBean;
public class Client {
public static void main(String[] args) {
try {
Context ctx = new InitialContext();
@SuppressWarnings("unused")
AsyncBeanRemote asyncBean = (AsyncBeanRemote)ctx.lookup("AsyncEJB");
} catch (Exception e) {
e.printStackTrace();
}
}
}
You only have to mess around with initial content factories, IIOP ports etc, if the client is genuinely remote. Also, the glass fish jar: appserv-rt.jar needs to be added to the build path.
Chris