Skip to main content

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

4 replies [Last post]
Anonymous

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
[att1.html]

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Alexis Moussine-Pouchkine

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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Antonio Goncalves

Are you talking about
http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-...?
There is only a 3.1-SNAPSHOT, can't find anything in 3.0.1.

With glassfish-uber I get a : java.lang.ClassFormatError:
javax/ejb/EJBException

That's because I'm not using the right implementation class. BTW, this is a
Java EE 5 project (I don't want to do any Java EE 6), so one of my
dependencies is javaee.javaee-api-5.

Hum, which dependencies to use ? Any idea ?

Thanks,
Antonio

2010/9/30 Alexis Moussine-Pouchkine

> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
--
Antonio Goncalves (antonio.goncalves@gmail.com)
Software architect

Web site : www.antoniogoncalves.org
Blog: agoncal.wordpress.com
Feed: feeds2.feedburner.com/AntonioGoncalves
Paris JUG leader : www.parisjug.org
LinkedIn: www.linkedin.com/in/agoncal,
[att1.html]

Marina Vatkina

Java EE 5 project should work in Java EE 6. You can point to the
gf-client.jar in the glassfish installation using system scope dependencies.

Regards,
-marina

Antonio Goncalves wrote:
> Are you talking
> about http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-...
> ? There is only a 3.1-SNAPSHOT, can't find anything in 3.0.1.
>
> With glassfish-uber I get a : java.lang.ClassFormatError:
> javax/ejb/EJBException
>
> That's because I'm not using the right implementation class. BTW, this
> is a Java EE 5 project (I don't want to do any Java EE 6), so one of
> my dependencies is javaee.javaee-api-5.
>
> Hum, which dependencies to use ? Any idea ?
>
> Thanks,
> Antonio
>
> 2010/9/30 Alexis Moussine-Pouchkine
> > >
>
> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>
>
>
>
> --
> --
> Antonio Goncalves (antonio.goncalves@gmail.com
> )
> Software architect
>
> Web site : www.antoniogoncalves.org
> Blog: agoncal.wordpress.com
> Feed: feeds2.feedburner.com/AntonioGoncalves
>
> Paris JUG leader : www.parisjug.org
> LinkedIn: www.linkedin.com/in/agoncal
> ,

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
For additional commands, e-mail: users-help@glassfish.dev.java.net

Antonio Goncalves

Yes Marina, that works :


org.glassfish.extras
appserv-rt
3.0.1-b22
system
${GLASSFISH_HOME}/lib/appserv-rt.jar

It's a bit of a shame but because we need a full GF install anyway, I
suppose that will do the job

Thanks,
Antonio

2010/9/30 Marina Vatkina

> Java EE 5 project should work in Java EE 6. You can point to the
> gf-client.jar in the glassfish installation using system scope dependencies.
>
> Regards,
> -marina
>
> Antonio Goncalves wrote:
>
>> Are you talking about
>> http://download.java.net/maven/glassfish/org/glassfish/extras/glassfish-...? There is only a 3.1-SNAPSHOT, can't find anything in 3.0.1.
>>
>> With glassfish-uber I get a : java.lang.ClassFormatError:
>> javax/ejb/EJBException
>>
>> That's because I'm not using the right implementation class. BTW, this is
>> a Java EE 5 project (I don't want to do any Java EE 6), so one of my
>> dependencies is javaee.javaee-api-5.
>>
>> Hum, which dependencies to use ? Any idea ?
>>
>> Thanks,
>> Antonio
>>
>> 2010/9/30 Alexis Moussine-Pouchkine >> alexis.moussine-pouchkine...>>
>>
>>
>> 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
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
>>
>>
>> For additional commands, e-mail: users-help@glassfish.dev.java.net
>>
>>
>>
>>
>>
>> --
>> --
>> Antonio Goncalves (antonio.goncalves@gmail.com >> antonio.goncalves@gmail.com>)
>> Software architect
>>
>> Web site : www.antoniogoncalves.org
>> Blog: agoncal.wordpress.com
>> Feed: feeds2.feedburner.com/AntonioGoncalves <
>> http://feeds2.feedburner.com/AntonioGoncalves>
>> Paris JUG leader : www.parisjug.org
>> LinkedIn: www.linkedin.com/in/agoncal ,
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@glassfish.dev.java.net
> For additional commands, e-mail: users-help@glassfish.dev.java.net
>
>

--
--
Antonio Goncalves (antonio.goncalves@gmail.com)
Software architect

Web site : www.antoniogoncalves.org
Blog: agoncal.wordpress.com
Feed: feeds2.feedburner.com/AntonioGoncalves
Paris JUG leader : www.parisjug.org
LinkedIn: www.linkedin.com/in/agoncal
[att1.html]