users@glassfish.java.net

Re: appclient with non-local j2ee/ee5 appserver

From: <glassfish_at_javadesktop.org>
Date: Wed, 09 May 2007 12:29:15 PDT

Without any error messages to look at it's hard to tell exactly what the problem is, but I can explain in general what happens with app clients. I'll talk about app client invocation using the appclient script, since that's what you are using, rather than using Java Web Start to download and launch the client because some of the details are a little different.

Somehow the app client container (ACC) needs to know what app server(s) to connect to when your client refers to remote components such as EJBs. It does this by reading the XML file you specify using the -xml option on the appclient script. Most times people do not specify this so the ACC uses the default, which is [i]install-dir[/i]/domains/[i]domain-name[/i]/config/sun-acc.xml.

[Note that this file particular file is intended to be a template which you can use to create other versions that suit your particular needs. Many users just use the default file and its default contents which does cover many cases.]

In this file you will find a <target-endpoint> element that specifies a host and port. This is where the server-side ORB is listening for incoming requests from the client-side ORB inside the ACC.

As it starts up, the ACC logs the host and port it uses to initialize the client-side ORB. You should see this in the output when you run the client, whether in NetBeans or in a command window using the appclient script. That is the ORB endpoint that the ACC will try to contact when the app client runs. Note that the first contact will occur before your client is started if you use annotations in your app client main class to refer to EJBs, etc. on the server. The ACC must find and inject the correct references before invoking your code, and to do that it must contact the server-side ORB.

Another aspect to this is that NetBeans seems to redeploy the app as part of running the client. (I happen to be using NB 6.0 M9 at the moment; perhaps 5.5.1 behaves differently.) If the server associated with the project is not running then it will not be able to redeploy the app prior to running the client.

Do either of these sound like they describe your situation?

Do the logging messages identify the host and port you expect?

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

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