I try to connect from a stand-alone swing client (running in a separate JVM on the client machine) to the Glassfish server.
I currently use the following settings fr
You want a Remote EJB interface when your client application lives on one JVM different than the one hosting the EJB module. In other words:
OR
Lets consider the first scenario where both of the client app and the EJB module live on different JVMs on the very same machine.
As per the documentation, stand-alone java clients must explicitly use the global JNDI name to lookup the Remote EJB. Also, Glassfish does not need any properties instialization to invoke the InitialContext() constructor. Thus the client application can invoke the EJB using the following snippet:
InitialContext context = new InitialContext();
_RemoteEjbInterface ejbBean = (_RemoteEjbInterface) context.lookup("java:global/DeployedEJBAppName/EjbImplClass!com.sam._RemoteEjbInterface");
Account for the above step (3) by adding this entry to your client app POM:
org.glassfish.main.appclient.client
gf-client
3.1.2
system
C:/glassfish3/glassfish/lib/gf-client.jar
Account for the above step (4) by a POM dependency pointing to you remote_interface.jar in your local maven repo assuming you installed it. Follow this to know how.
Another documentation to reference is here