File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes Problem with jar-files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem with jar-files" Watch "Problem with jar-files" New topic

Problem with jar-files

Roel De Nijs

Joined: Jul 19, 2004
Posts: 8412


I am working with Tomcat 4.1.29 and i have some jar-files that are used by my 2 web-apps. So i placed these jars into %tomcat_home%/common/lib and into %tomcat_home%/shared/lib, but then my webapps won't work anymore. I even unzipped them and placed those classes into %tomcat_home%/common/classes and %tomcat_home%/shared/classes (including the directory structure according to package name), but that's also not working.

when i place this jar's into the lib-directory of both my apps, those work just fine.

Does anyone has a clue ???

SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
"won't work anymore" - what (exactly) happens? If you get error messages in logs, what is the cause?
Roel De Nijs

Joined: Jul 19, 2004
Posts: 8412

On the first line of my web-app where such a class is called (a class in a jar under tomcat_home/common/lib) he returns this error

HTTP Status 500 - Dispatch[/kaart] to method init returned an exception


type Status report

message Dispatch[/kaart] to method init returned an exception

description The server encountered an internal error (Dispatch[/kaart] to method init returned an exception) that prevented it from fulfilling this request.


Apache Tomcat/4.1.29

So my guess is: he can't find the class but it's certainly there
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Surely there's a stack trace in the Tomcat log?

- Peter
Roel De Nijs

Joined: Jul 19, 2004
Posts: 8412

i checked all my logs and there is nowhere any stackthrace
Roel De Nijs

Joined: Jul 19, 2004
Posts: 8412

I fixed it myself.


my classes under the %tomcat_home%/common/lib are

in the jar that's in the lib-directory of my web-apps there are also several classes in the same package as above, so for example:

So i changed the following
be.aqf.a.A into be.aqf.c.A
be.aqf.b.B into be.aqf.c.B

then jarred them up and placed it under the %tomcat_home%/common/lib directory and it's working fine. So i conclude that packages are overwritten are something like that !?

Thanks for the help.
I agree. Here's the link:
subject: Problem with jar-files
It's not a secret anymore!