Multiple entry point (main class) for the client application bank

How to configure multiple entry points in the bank of the application client?

I am using Glassfish application server. I can capture a client using

 asadmin get-client-stubs --appname APPLICATION_NAME .

Currently, I can run the default main class, which I specified in MANIFEST.MF. However, I want to be able to specify a different main class at runtime.

t

appclient -client MYJAR.jar -mainclass com.mystuff.Main1
and
appclient -client MYJAR.jar -mainclass com.mystuff.Main2

Both Main1 and Main2 have entry points "public static void main".

If I specify a main class 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 so that the link to the appclient is in other main classes?

+3
1

http://forums.java.net/jive/thread.jspa?threadID=65549&tstart=0 < - , - ...

.

GlassFish -mainclass, , EAR, , . , .

, , appclient, v3:

http://docs.sun.com/app/docs/doc/820-7701/appclient-1m?a=view

v2 , , , , , , .

-Tim

+1

Source: https://habr.com/ru/post/1714984/


All Articles