Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple version of same jar  RSS feed

 
Ritesh Chopade
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have multiple versions(4 versions) of the same jar in my web application lib directory, here I am getting the class cast exception for the class in this jar. Is it due to the multiple version of the jar? But when I restart my jboss server, it works fine(means doesn't throw the exception).

Thanks in advance.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is there 4 versions of the same jar file in your web application's classpath?

ClassLoaders tend to load classes from the first resource in the classpath that has the available class, so whichever Jar it finds first is liable to be where it gets the class.
 
Ritesh Chopade
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Multiple versions because I have not removed the old one and just added the new jars as per my need.
Also most of the time it works fine, but at certain situation it throws exception. So I want to confirm that the problem due to multiple versions or there may be another reason?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most probably yes. But again, as Paul already said - why have 4 versions of the same jar. This can lead to other issues too.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!