• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 585
  • Last Modified:

jt400.jar not found when packaged in jar

I have an executable jar file with jt400.jar packaged within it.  I can run this application on the server where it is to be deployed and I get a "java.lang.NoClassDefFoundError: com/ibm/as400/access/AS400JDBCDriver" exception (AS400JDBCDriver is a class within jt400.jar).  However, when I run this on my development machine I get no such error.  It seems that this is because there is another copy of JT400.jar on that machine and it has an entry in the CLASSPATH. Without modifying the classpath of the target machine, how do I make sure that the class files packaged within a jar packaged within another jar can be seen, if you see what I mean?

Cheers Steve.
0
steve_bagnall
Asked:
steve_bagnall
  • 5
  • 3
2 Solutions
 
TimYatesCommented:
It may be easier to just put jt400.jar with (not inside -- just in the same folder) your other jar, and add:

Class-Path: jt400.jar

to your manifest?
0
 
steve_bagnallAuthor Commented:
It maybe in this case, but I am deplying this using WebStart so I would like the whole application to be in one jar file.  Are you saying this is not possible?

Cheers,
Steve
0
 
TimYatesCommented:
>> Are you saying this is not possible?

I'm not sure :-/

You should just be able to add the jt400.jar to the <resources> section of the jnlp file...

like:

<resources>
  <j2se version="1.2+" />
  <jar href="/lib/jt400.jar"/>
</resources>

This may be a better solution, as JWS will not have to download every file if the webstart app changes (it will recognise that the jt400.jar file hasn't changed)...

Tim
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
steve_bagnallAuthor Commented:
Tim,

Will I still need to modify the manifest file doing it this way?
0
 
TimYatesCommented:
I don't believe so...

(I may be wrong, but I really don't believe so)...

:-/

We're on the fringes of my knowledge here ;-)
0
 
objectsCommented:
you could use this:

http://one-jar.sourceforge.net/
0
 
TimYatesCommented:
What would you recommend objects?  (you're knowledge of JWS is probably greater than mine)...

Seperate jars with jt400 defined in the resources block of the jnlp file, or a single combined jar?
0
 
steve_bagnallAuthor Commented:
Tim,  I used your solution, and objects looks interesting so I split the points.  Hope everyone's OK with that :)

Cheers,
Steve

p.s it works at last! :)
0
 
TimYatesCommented:
no worries :-)

>> p.s it works at last! :)

Yay!! :-D

Good luck!

Tim
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now