users@glassfish.java.net

Re: Error running App Client (-com.sun.enterprise.appclient.MainWithModuleSupp)

From: <glassfish_at_javadesktop.org>
Date: Tue, 23 Feb 2010 05:52:45 PST

If I understand, you are trying to launch the app client JAR which NetBeans built directly using the appclient command, is that right?

NetBeans "knows" that your app client wants to "see" the other libraries in the EAR because it knows the app client is part of the EAR. So when you run from NetBeans the IDE can make sure the runtime classpath includes those libraries. But this information is not built into the app client itself by NetBeans, at least not as I understand it.

Something you can try is this:

1. Deploy the EAR (which you undoubtedly have already done!).
2. Execute

asadmin get-client-stubs --appname [i]app-name[/i] localdir

where 'localdir' is any local directory you want to use.

GlassFish will download into that local directory a generated app client JAR file which contains not only the code from your original app client but also any library JARs on which the client depends. (In GlassFish v2.x this includes JARs in the EAR's library directory, JARs referenced from the app client JAR's manifest Class-Path setting, and any JARs at the top-level of the EAR.)

3. Then use

appclient -client localdir\FundsBeanClient.jar

to launch the client. (The name of the generated JAR is (EAR-name)Client.jar.)

Note that for users who deploy apps using "asadmin deploy" or the admin console you can combine the deploy and get-client-stubs steps by using the "--retrieve localdir" option on the deploy command or the equivalent setting in the admin console.

Hope this helps.

- Tim
[Message sent by forum member 'tjquinn' (timothy.quinn_at_sun.com)]

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