users@glassfish.java.net

RE: Re: Re: third party jars

From: Martin, Ray <armart3_at_tycho.ncsc.mil>
Date: Tue, 10 Aug 2010 08:20:11 -0400

My good old faithful netbeans wraps up an EJBModule project into a jar
file. (if I knew how, I would ask netbeans to make it a .war file since
that deploys and runs.)

 

Put the third party jars into <glassfish-v3-prelude
home>/domains/domain1/lib/

 

Same crash.

 

That was a good thing to try - I am disappointed that it didn't work.

 

I am thinking about creating a netbeans web app that has no web pages -
just the source package (they call it). If this would get me going
temporarily would be just great, but I hate to have to do that.

 

From: Steven Siebert [mailto:smsiebe_at_gmail.com]
Sent: Tuesday, August 10, 2010 8:08 AM
To: users_at_glassfish.dev.java.net
Subject: Re: Re: third party jars

 

Are you packaging this as a EJB .jar, a .war, or an .ear?

I wonder if you copy those nested dependencies to your GF domains /lib
directory would everything work?

S

On Tue, Aug 10, 2010 at 7:49 AM, Martin, Ray <armart3_at_tycho.ncsc.mil>
wrote:

json-lib-2.3-jdk15.jar

 

deployment is fine.

 

Runtime provides this error:

java.lang.ClassNotFoundException: net.sf.json.JSONArray

 

no errors on compile.

 

Admittedly, json depends on other third party jars (4 commons-*.jar, and
ezmorph-x.x.jar). I have included these jars as libraries in the
project and they are all packaged in the project jar in the dist
directory. Everything appears to be in the correct place. But, runtime
errors.

 

Made an SE app that uses the same JPA and third party jars does not
crash (of, course glassfish is not used here - this is just a proof of
correct jars).

 

A web app that uses the same EJBs, JPA, and third party jars does not
crash. This shows that the third party jars CAN occur from glassfishv3.

 

While the web app in glassfishv3 works, the EJBModule app does not.
Strange thing is that the oracle third party library, ojdbc14_g.jar,
works in all projects even the EJBModule project.

 

I wonder if the classloader in v3 for EJB modules is not properly
loading the jars on which a third party jar is relying.

 

From: Steven Siebert [mailto:smsiebe_at_gmail.com]
Sent: Tuesday, August 10, 2010 7:36 AM
To: users_at_glassfish.dev.java.net
Subject: Re: third party jars

 

What is the 3rd part JSON library you're using? What is the error your
receiving on deployment?

I assume you're not getting any errors on compile...


Steve

On Tue, Aug 10, 2010 at 7:33 AM, Martin, Ray <armart3_at_tycho.ncsc.mil>
wrote:

Using netbeans 6.8

 

Have been working in glassfish v2 - yesterday switched to v3 - wow. (big
changes in the JPA.)

 

After many hours of work, got all the errors out of the EJBModule
project.

It deploys.

It starts when commanded from the SOAP interface.

It crashes as soon as a third party library is called - JSON in this
case. Though the oracle library must have been seen because database
connections are working. The JSON jar has other dependencies like
commons-*.

 

All third party jars have been packaged into the EJBModule jar.

 

I built the project in SE using JPA and the third party jars - runs
great.

I built a similar project as a web app where the EJBs, JPA, and third
party jars are used - runs great.

 

Wow - am I sorry that I changed to v3.

 

I have searched and searched - I cannot be the only guy who has this
problem - but, I can find no solution.

 

Thought maybe it was netbeans' fault - so, deployed using admin console
- same problem. So, I guess it is a packaging problem??? A manifest
problem??? wow