• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 579
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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