0

After fighting passwords on Glassfish 4.x remotely on Ubuntu 14.04 Tahr, I'm ready to proceed to installing my first remote EJB module -- just want make sure I'm on the right path. Going from the Netbeans example Creating and Running an Application Client on the GlassFish Server, How would I make a client for the EJB module which is deployed remotely?

The Netbeans example assumes that Glassfish is running on the localhost. The exact mechanics are unclear to me, as it's not explicitly configured for localhost. Presumably it's implicitly configured for localhost...

I would like to use the ACC to connect to, not a local, but rather a remote Glassfish server. For context, the ACC is:

Introducing the Application Client Container

The Application Client Container (ACC) includes a set of Java classes, libraries, and other files that are required for and distributed with Java client programs that execute in their own Java Virtual Machine (JVM). The ACC manages the execution of Java EE application client components (application clients), which are used to access a variety of Java EE services (such as JMS resources, EJB components, web services, security, and so on.) from a JVM outside the Oracle GlassFish Server. The ACC communicates with the GlassFish Server using RMI-IIOP protocol and manages the details of RMI-IIOP communication using the client ORB that is bundled with it. Compared to other Java EE containers, the ACC is lightweight. For information about debugging application clients, see Application Client Debugging.

GlassFish Server Open Source Edition Application Development Guide Release 4.0

see also:

https://stackoverflow.com/questions/25830149/how-to-package-a-stand-alone-remote-ejb-application-client

From a client application, how does the ACC remotely invoke the EJB module?

There must be a configuration. Does the ACC pick this up from jndi.properties? I can't find much documentation or examples on ACC usage. If the ACC is unsuitable, then, of course, I'll use a different approach. Presumably there's a way to specify a remote Glassfish server for the ACC.

Community
  • 1
  • 1
Thufir
  • 8,216
  • 28
  • 125
  • 273
  • apparently the `application.xml` deployment descriptor and `jndi.properties` "...contains the environment properties for connecting to a remote EJB container" -- http://www.coderanch.com/t/591423/EJB-JEE/java/application-client-invoke-ejb-eclipse – Thufir Sep 19 '14 at 07:30

1 Answers1

1

How do you intend to deploy your application?

In my days when i use to develop application clients for the ACC, i used to bundle everything in an EAR (I will still do that, cause it is easier).

Glassfish deploys the artifacts, generates required configurations (You can override configurations in application.xml anyway).

One thing that the ACC takes care is the CORBA properties needed for remote connection.

When you download the client jar from the glassfish admin, you download a java webstart application, that downloads all required libraries as appropriate and a configuration is automatically set from which host (paramount that you set glassfish domain host properly, or this will be an internal IP or localhost) it was downloaded from.

maress
  • 3,533
  • 1
  • 19
  • 37
  • The JWS app that downloads is perfect for deployment, but that's one step ahead. Before that, how does a local ACC connect to the remote glassfish? There's a missing step in there. That deployment scenario is exactly what I'm after, but it's precursor which presents a stumbling block. **How** does the ACC take care of CORBA properties for a remote connection? – Thufir Sep 19 '14 at 07:20
  • 1
    The ACC does not run in glassfish, it runs locally. whether you are developing or deploying the most sane way to do this without putting up the CORBA logic manually is to let the server do it for you. Netbeans can go far to help with this. – maress Sep 19 '14 at 11:57
  • I see that the admin console has an option for deploying applications. I could deploy this project to the remote glassfish? If so, I didn't realize that was possible. And then the JWS app would be configured correctly. What do I deploy? Netbeans creates four seperate JAR's. – Thufir Sep 19 '14 at 17:54
  • 1
    There is away to package application for deployment. In this case, your would create ant-java-ee project, which will generate the modules within it, and you can also add application-client. Build as ear, and deploy on remote glassfish server. Access the application-client from the remote-server and download to your local machine, it will have itself correctly configured. Just be sure the domain host is correctly setup.https://netbeans.org/kb/docs/javaee/entappclient.html, – maress Sep 19 '14 at 18:01