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.
appclient -client MYJAR.jar -mainclass com.mystuff.Main1
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?