tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simone Pierazzini <make...@gmail.com>
Subject Re: weird tomcat5.0.30 behaviour with jar in WEB-INF/classes
Date Wed, 01 Dec 2004 15:30:28 GMT
On Wed, 1 Dec 2004 10:11:49 -0500, Shapira, Yoav <yoav.shapira@mpi.com> wrote:
> 
> Hi,
> 
> >it should be but it isn't because tomcat does not make a copy, and the
> >returned url is unresolvable.
> 
> So you're saying the jar in $CATALINA_HOME/work is physically different
> than the one in your WEB-INF/lib directory, i.e. Tomcat's copying
> corrupts the jar?

yes... and no.
when you ask for non-jar resources, the returned url points to the
correct path (inside context directory, and tomcat doens't need to
copy them).
When you ask for jar resources, the returned url points to a directory
inside $CATALINA_HOME/work, but Tomcat does not copy anything in that
path from WEB-INF/classes (you wrote WEB-INF/lib).

In my first mail a made an example of what happens. I'll report it here:

com.mydomain.mypackage.MyClass.class.getClassLoader().getResource("pippo.txt")

returns:
file:/ ... /webapps/myapp/WEB-INF/classes/pippo.txt
           ^^^^^^^^^

while:
com.mydomain.mypackage.MyClass.class.getClassLoader().getResource("pippo.jar")

returns:
file:/ ... /work/Catalina/localhost/myapp/loader/pippo.jar
            ^^^^^^^^^^^^^^^^^^^^

where "..." stands for a path that is $CATALINA_HOME

note the difference between the two urls.

bye

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message