users@glassfish.java.net

Re: Multiple entry point (mainclass) for application client jar

From: <gorgeous65_at_msn.com>
Date: Fri, 14 Aug 2009 02:31:34 +0100

Hi,

If you are using an IDE such as netbeans, you can specify another class
as the main class. by:

In netbeans,

Right click Application\properties\Run

Under Client Module select your application client

then under

Main class of Client Information, specify the other
class then ok. Then deploy again.

If you are not using IDE, then you may want to call the
other class from the main class.

Sorry, if it does not help.

eve

--------------------------------------------------
From: <glassfish_at_javadesktop.org>
Sent: Wednesday, August 12, 2009 5:54 PM
To: <users_at_glassfish.dev.java.net>
Subject: Multiple entry point (mainclass) for application client jar

> How do I set up multiple entry points in an application client jar?
>
> I am using Glassfish application server. I can grab the client using
>
> asadmin get-client-stubs --appname APPLICATION_NAME .
>
> I currently can run the default mainclass that I have specified in the
> MANIFEST.MF. However, I want to be able to specify another mainclass at
> runtime.
>
> ie
>
> appclient -client MYJAR.jar -mainclass com.mystuff.Main1
> and
> appclient -client MYJAR.jar -mainclass com.mystuff.Main2
>
> Both Main1 and Main2 have "public static void main" entry points.
>
> If I specify a mainclass that is not in MANIFEST.MF, I get the following
> exception:
>
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.IllegalArgumentException: Could not locate an embedded app
> client matching the main class name
>
>
>
> Do I need to make any changes to have the appclient reference other
> mainclasses?
> [Message sent by forum member 'tazzy531' (tazzy531)]
>
> http://forums.java.net/jive/thread.jspa?messageID=360131
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>