Sun GlassFish Enterprise Server v3 Release Notes

Launching an app client can give ClassNotFound error for the client's main class (Issue 11181)

Description

A problem occurs when all of the following are true:

Attempts to launch the application client fail with the following error because one file generated on the server is placed in the wrong server directory and overwrites another generated file:


java.lang.ClassNotFoundException:(main-class-for-the-client)

For more information, see Issue report.

Workaround

Change the name of the application client so it is not myAppClient.jar. Specifically:

  1. Edit myApp/META-INF/application.xml so that the declaration of the client is <java>myClient.jar</java>. Note that you can use any name other than myAppClient.jar.

  2. Rename the directory myApp/myAppClient_jar to myApp/myClient_jar. Note that the client's subdirectory name must be the same as the application client URI in the application.xml file, with the .jar replaced with _jar.

  3. Deploy the application:


    asadmin deploy --retrieve localdir myApp
    
  4. Run the application client:


    appclient -client localdir/myAppClient.jar