I am still not completely clear about exactly how you have built the parts of
your application. Here is one way that will work. It is slightly more
complicated than some people might expect but this is, in my opinion, the
best design. Build your application as an EAR, containing three parts: a
library containing the EJB remote interface, the EJB module, and the app
client module. These will be three different projects in NetBeans. Use
NetBeans to add the library project as a library to both the EJB project and
the app client project. Do NOT have NetBeans package the library inside the
EJB or the app client module. (There is a check box next to each library name
in the libraries list for the module.) Use NetBeans to build the EAR. If you
have set up the EAR to contain the EJB and app client modules then NetBeans
will automatically build those first and then include their JARs into the
EAR. Now deploy the EAR to GlassFish. Use either "deploy --retrieve" or
"get-client-stubs" and then use the appclient command to convince yourself
that the resulting app client package works correctly. Then launch the client
using Java Web Start. GlassFish will know that the app client depends on the
library JAR and will make it available as part of the Java Web Start launch
and the launch should work correctly. Let us know how it turns out. Some
people ask why I suggest using the library JAR. The answer is this: From a
design point of view, the app client should depend ONLY on the EJB remote
interface(s) and should not depend on or have access to the EJB
implementation classes. By placing the remote interface into a library that
is separate from the EJB module itself, the app client does not have to
depend on the EJB module and therefore does not have access to the EJB
implementation classes at compile-time or at runtime. It is a little more
complicated because we have the additional library and both the app client
module and the EJB module depend on that library, but to my mind that is
still a cleaner design. - Tim
--
[Message sent by forum member 'tjquinn']
View Post: http://forums.java.net/node/891603