power
power

Reputation: 53

tomcat and his classpath manager

if deploy on tomcat myapp.war contains two lib (lib1.jar and lib2.jar), which contain both a.b.c.MyObj

which one chooses at the time of the creation of MyObj ?

Upvotes: 1

Views: 68

Answers (1)

Faisal Feroz
Faisal Feroz

Reputation: 12785

The behavior is not predictable. The class loader loads the first properly named class it finds in the classpath and effectively "hides" all other properly named classes.

Look at this tip from javaworld which references a tool named JWhich to help in these scenarios.

Upvotes: 1

Related Questions