Different jar version

2007-10-10 Thread Andrew Hole
What happens if I put different jar versions of same classes on WEB-INF/lib?
Example:
project.jar (new version)
project_old.jar (old version)

Tomcat load and use both? Could Tomcat be confused with this situation?

Thanks a lot

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Different jar version

2007-10-10 Thread Peter Crowther
 From: Andrew Hole [mailto:[EMAIL PROTECTED] 
 What happens if I put different jar versions of same classes 
 on WEB-INF/lib?
 Example:
 project.jar (new version)
 project_old.jar (old version)
 
 Tomcat load and use both? Could Tomcat be confused with this 
 situation?

Each time a class is requested, the classloader looks through the jars
until it finds a class with that name, then immediately loads the one it
finds.  There may be other copies in other jars; they are not loaded.

To my knowledge*, there's no way of knowing in advance in which order
Tomcat will look through the jars.  If you have two classes with the
same name, you have no way of knowing in advance which one will be
loaded.  Tomcat won't be confused, but you sure will be if you have
different versions of the same classes in different jars :-).

- Peter

* As always, happy to be corrected by those who know better!

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Different jar version

2007-10-10 Thread Tim Funk
It uses the first version of the class it finds when findClass is 
called. First version depends on which jar it looks in first. There is 
no defined order in which jars should be read first. So the behavior of 
Tomcat would be like any other java application - unknown.


-Tim

Andrew Hole wrote:

What happens if I put different jar versions of same classes on WEB-INF/lib?
Example:
project.jar (new version)
project_old.jar (old version)

Tomcat load and use both? Could Tomcat be confused with this situation?



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Different jar version

2007-10-10 Thread David Delbecq
The question is better

what happen if you have 2 classes with same name and package in the
same classloader?
Knowing which of both classes will be indeed loaded and used when need
is undetermined. Only one of those classes will be used, but it there is
no rule as to which will be used. This is mainly depended on the order
at which tomcat looks at .jar which itself is dependent on order in
which filesystem returns them, which depend on os, date, filename, etc.


En l'instant précis du 10/10/07 16:45, Andrew Hole s'exprimait en ces
termes:
 What happens if I put different jar versions of same classes on WEB-INF/lib?
 Example:
 project.jar (new version)
 project_old.jar (old version)

 Tomcat load and use both? Could Tomcat be confused with this situation?

 Thanks a lot

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
   


-- 
http://www.devlog.be (a belgian developer's logs)



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Different jar version

2007-10-10 Thread Caldarale, Charles R
 From: Andrew Hole [mailto:[EMAIL PROTECTED] 
 Subject: Different jar version
 
 What happens if I put different jar versions of same classes 
 on WEB-INF/lib?

Really Bad Things.

 Could Tomcat be confused with this situation?

Yes, as is the person who did such a thing.

Depending on the order the jars happen to show up in the directory (the
real directory, not the sorted one shown by ls or dir commands), one
will likely take precedence over the other, but you can't predict which
that will be.  This is a Very Bad Idea.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Different jar version

2007-10-10 Thread Andrew Hole
I'm getting OutofMemoryError ... Could have some relationship having
two different versions of jar and memory leak?

Thanks

On 10/10/07, Caldarale, Charles R [EMAIL PROTECTED] wrote:
  From: Andrew Hole [mailto:[EMAIL PROTECTED]
  Subject: Different jar version
 
  What happens if I put different jar versions of same classes
  on WEB-INF/lib?

 Really Bad Things.

  Could Tomcat be confused with this situation?

 Yes, as is the person who did such a thing.

 Depending on the order the jars happen to show up in the directory (the
 real directory, not the sorted one shown by ls or dir commands), one
 will likely take precedence over the other, but you can't predict which
 that will be.  This is a Very Bad Idea.

  - Chuck


 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.

 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Different jar version

2007-10-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
 I'm getting OutofMemoryError ... Could have some relationship having
 two different versions of jar and memory leak?

It's very unlikely. As other posters have said, either one class gets
loaded or the other one does, not both. The effect is as if the other
one were not available at all. Therefore, the memory leak is unlikely to
be related to the duplicate JARs.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDPkW9CaO5/Lv0PARAsKuAJoCFDqH+Mwu5FaiQzFrLqNFt0IF6gCgvkZ/
3WKGOJMEMvQRwooNfteXcM0=
=uAoS
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Different jar version

2007-10-10 Thread Caldarale, Charles R
 From: Andrew Hole [mailto:[EMAIL PROTECTED] 
 Subject: Re: Different jar version
 
 I'm getting OutofMemoryError ... Could have some relationship having
 two different versions of jar and memory leak?

Not likely, but it really depends on how your classes interact.

Instead of indulging in rather pointless speculation, why not fix the
obvious error by removing the redundant jar and see what happens?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]