my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problem with jar-files" Watch "Problem with jar-files" New topic
Author

Problem with jar-files

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5142
    
  12

Hello,

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
http://www.javaroe.be/
William Brogden
Author and all-around good cowpoke
Rancher

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

Joined: Jul 19, 2004
Posts: 5142
    
  12

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
author
Ranch Hand

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

- Peter
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5142
    
  12

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

Joined: Jul 19, 2004
Posts: 5142
    
  12

I fixed it myself.

Solution:

my classes under the %tomcat_home%/common/lib are
be.aqf.a.A
be.aqf.b.B

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:
be.aqf.a.AA
be.aqf.a.AAA
be.aqf.b.BB

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with jar-files
 
Similar Threads
xml parser in tomcat
what is common and shared directory in tomcat folder , when use each of them
getting weblogic to add jar to classpath (axis.jar)
not able to run two site simultaneously in a tomcat websrever
properties file in shared/classes