Orair kindly provided me a sample EAR in private e-mail.
I was able to recreate the problem using your EAR.
Your app client JAR's manifest should contain a setting for Main-
Class, but it does not.
The Java EE spec requires that app clients specify the main class.
GlassFish deploys the app successfully because it allows users to
specify the main class on the appclient command if that is how they
launch the app client. The Java Web Start support in GlassFish, on
the other hand, requires you to comply with the EE spec and indicate
the main class. The null pointer exception occurs because Java Web
Start is trying to locate the class specified by your Main-Class, and
since the Main-Class manifest entry does not exist the main class name
has never been set.
Ideally GlassFish would warn about this at deployment time and do a
much better job detecting this error and reporting it at runtime
during an app client launch. I will open an issue about this.
But if you correct your project to specify the main class then your
app client should launch correctly.
- Tim
On Oct 26, 2011, at 12:47 PM, Gustavo Henrique Orair wrote:
> I am using Glassfish + Maven.
>
> I am generating an EAR with an application Client inside.
>
> The resulting ear has all dependent libraries in EAR's lib directory.
>
> When I try to launch the Java Web Start, it fails. The message is
> not too clear...
>
> Checking the server.log I can see the following error:
> [#|2011-10-25T19:34:46.196-0200|SEVERE|glassfish3.1.1|
> javax
> .enterprise
> .system.container.appclient.org.glassfish.appclient.server.core.jws|
> _ThreadID=26;_ThreadName=Thread-2;|Adapter[/___JWSappclient/___app/
> EconoInfo-OCONSI-PovoadorEAR-0.1.1-SNAPSHOT] EconoInfo-OCONSI-
> PovoadorEAR-0.1.1-SNAPSHOTClient/lib/jaxb-impl-2.2.2.jar
>
> I searched for EconoInfo-OCONSI-PovoadorEAR-0.1.1-SNAPSHOTClient.jar
> and found in it:
> domain1/generated/xml/EconoInfo-OCONSI-PovoadorEAR-0.1.1-SNAPSHOT/
> EconoInfo-OCONSI-PovoadorEAR-0.1.1-SNAPSHOTClient.jar
>
> This JAR file just includes AppClientGroupFacade and Manifest file:
> META-INF/MANIFEST.MF
> org/glassfish/appclient/client/AppClientGroupFacade.class
>
> The original EAR (found in domain1/applications/EconoInfo-OCONSI-
> PovoadorEAR-0.1.1-SNAPSHOT) contains the correct dependency:
> domain1/applications/EconoInfo-OCONSI-PovoadorEAR-0.1.1-SNAPSHOT/lib/
> jaxb-impl-2.2.2.jar
>
> The META-INF/application.xml generated by Maven has the following
> content:
> <?xml version="1.0" encoding="UTF-8"?>
> <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
> " xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd
> " version="6">
> <description>Módulo EAR do Povoador do OCONSI</description>
> <display-name>EconoInfo-OCONSI-PovoadorEAR</display-name>
> <module>
> <java>EconoInfo-ISEF-Testes-0.6.5-SNAPSHOT.jar</java>
> </module>
> <library-directory>lib</library-directory>
> </application>
>
> There isn't an application-client.xml inside Application Client jar.
>
> How may I correct this problem to make Glassfish generate domain1/
> generated/xml/EconoInfo-OCONSI-PovoadorEAR-0.1.1-SNAPSHOT/EconoInfo-
> OCONSI-PovoadorEAR-0.1.1-SNAPSHOTClient.jar including the needed
> libraries?
>
>
> Best regards,
> Orair.
>