users@glassfish.java.net

Re: how Enterprise application client communicate with glassfish from

From: <glassfish_at_javadesktop.org>
Date: Mon, 09 Jul 2007 11:08:17 PDT

Hi.

You really asked two questions:

1. How does a client communicate with the server and how does it know which server to use?

The app client container (ACC), within which Java EE clients execute, handles the communication between clients and server-side components such as EJBs. The developer's code does not normally do so itself. The ACC uses IIOP, and an ORB used by the ACC communicates with ORBs on servers to locate and invoke methods on server-side objects.

Whenever GlassFish creates a new domain it generates the file sun-acc.xml in the domain's config directory. This file contains a <target-server> element that identifies the host and port where the domain server's ORB listens. Many users use this file without change, but it is intended as a sample which administrators can customize to suit their own purposes.

If you launch the app client using the appclient script then the ACC reads the sun-acc.xml file. It uses the host and port speciifed in the <target-server> element to locate the ORB.

If you launch the app client using the built-in Java Web Start support in GlassFish, then you do not need to deal with the sun-acc.xml file. The server provides the correct ORB locations to the client in the generated JNLP document used to launch the client.


2. What is inside the generated app client JAR?

Normally developers, administrators, and users do not need to be concerned with the contents of the generated app client JAR. It contains, basically, the contents of the app client that the developer built, plus any necessary generated stub classes, plus any JARs or directories required by the client using the normal library mechanisms described in the Java EE 5 spec (see section EE 8.2).

Were you just curious, or are you having problems? There were some bugs open about the generated JAR not containing exactly the correct contents, but the last of those have been fixed as of this morning and those changes should appear in tonight's nightly build and the promoted build 55.

- Tim
[Message sent by forum member 'tjquinn' (tjquinn)]

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