users@glassfish.java.net

Re: Launch app-client via JWS on windows and mac (server runs on windows)

From: <glassfish_at_javadesktop.org>
Date: Tue, 03 Aug 2010 10:46:32 PDT

Hi Tim,

what a journey, mate... I've just been for the last two hours over and over the "pick and tick", "tick and build", "dig and dag" of netbeans 6.9.


My goodness... In the end: 1 a.m. This is the story of a developer that should be in bed since a while:

In Netbeans 6.9 you do New Ear-> (1 app client, 1 EJB)

By default NB adds the EJB module to the classpath of the app client and "ticks" the "package" checkbox.

This "package" being "ticked" means that even though it is an EAR module and to my knowledge all ear modules withing the same ear are available to each other. Netbeans adds a classpath entry to the app client Manifest.mf pointing to the jar with the ejb module. This means that at deployment time the APT of GF scans the app-client modules, "and the jars in it's manifests class-path" and finds annotations of type @EntityManager which doesn't expect in the app-client "at all" and @EJB ejb references to local interfaces which doesn't accept because one it is APTing the app client and in the app client only references to remote interfaces make sense.

So okay, we untick the "package" checkbox in netbean's app-client project libraries. We deploy and we get a ClassNotFoundException for any remote interfaces. Even though they both app-client and ejb module are EAR modules inside the same ear for some reason, the app client runtime doesn't include the ejb module in its classpath.

So in the end, following good-Tim's advice i extracted all remote interfaces, DTOs and commong classes to a new class library project called salute-ejb-client(.jar) and voila. Running good, java web starting, good sleep tonight...


Now, back to our new features in JNLP customization. My first attempt was. I put the customized salute.jnlp file in Ear file/META-INF/salute.jnlp

<?xml version="1.0" encoding="UTF-8"?>
<jnlp spec="1.0+" codebase="" href=""><!--glassfish codebase="" href="" are glassfish owned -->
    <information>
        <title>Salute v1.0</title>
        <vendor>Anahata Technologies</vendor>
        <description>Salute</description>
        <description kind="short">Salute Application Client</description>
        <icon kind="splash" href="images/splash.jpg"/>
    </information>
    <resources>
        <!-- Application Resources -->
    </resources>
    <application-desc main-class=""> <!--glassfish owned -->
        <!-- Application Arguments -->
    </application-desc>
</jnlp>

In sun application-client, i reference this custom .jnlp file as relative to the ear root

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-application-client PUBLIC "-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Application Client 6.0//EN" "http://www.sun.com/software/appserver/dtds/sun-application-client_6_0-0.dtd">
<sun-application-client>
  <java-web-start-access>
    <vendor>Anahata Technologies</vendor>
    <jnlp-doc>/META-INF/salute.jnlp</jnlp-doc>
  </java-web-start-access>
</sun-application-client>

I ran the update tool and couldn't find one update so I assume my gf 3.1 beta is up to the latest and gratest....

When i deploy, this is what i get
SEVERE: DPL8007: Invalid Deployment Descriptors element jnlp-doc value /META-INF/salute.jnlp

same is i try with
.../META-INF/salute.jnlp


Any hints?
[Message sent by forum member 'pablopina']

http://forums.java.net/jive/thread.jspa?messageID=479247