users@glassfish.java.net

Re: Migrating standalone client from GFv2 to GFv3 (or the classpath hell)

From: Alexis Moussine-Pouchkine <alexis.moussine-pouchkine_at_oracle.com>
Date: Thu, 30 Sep 2010 14:54:45 +0200

gf-client.jar uses relative references to all the JARs it needs (see MANIFEST.MF) so that's not going to work for Maven (it should with ant).
Have you tried using the uber all-in-one JAR as a mvn dependency instead?
-Alexis

On 30 sept. 2010, at 14:31, Antonio Goncalves wrote:

> Hi,
>
> I have an application that uses a Swing client with JNDI lookups to access remote stateless EJBs. Everything works fine. I'm trying now to go from an Ant build (with explicit classpath setting) that runs on GlassFish 2.1 to a Maven build with the latest GlassFish v3.0.1
>
> With Ant on GlassFish v2.1 this is what I explicitely declare in my classpath :
> appserv-deployment-client.jar
> appserv-rt.jar
> webservices-rt.jar
> appserv-admin.jar
> javaee.jar
>
> I know things have changed in GFv3 so I'm now using the org.glassfish.appclient.gf-client-3.0.1-b20 (instead of the appserv-rt.jar). When I run my Swing app with the gf-client I have the following exception :
>
> java.lang.NoClassDefFoundError: com/sun/corba/ee/spi/osgi/ORBFactory
>
> Indeed. This class is in com.sun.corba.glassfish-corba-orb-3.1.0-b006 but not in the 3.0.0-b001 that gf-client depends on. So I've added the com.sun.corba.glassfish-corba-orb-3.1.0-b006 to my dependencies and now have the following exception :
>
> java.lang.NoClassDefFoundError: org/glassfish/enterprise/iiop/impl/CSIv2SSLTaggedComponentHandlerImpl
>
> It looks like I could spend the day looking for NoClassDefFoundError, so I might be doing something wrong. I gave a try and used a 3.0 version (org.glassfish.appclient.gf-client-3.0-b74b) but I still have java.lang.NoClassDefFoundError: com/sun/corba/ee/spi/osgi/ORBFactory.
>
> There must be an easier way, any idea ?
> Thanks,
> Antonio