• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to find which Jar file, which .WAR is trying to run?

 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have deployed a .WAR file, with ABC.jar in it's LIB folder. ABC.jar has a class containing XYZ Method.

---------

When program is running in .WAR, it is unable to find XYZ method in ABC.jar.

---------

I found same ABC.jar in Lib folder of Glassfish domain(same name version).
I also replaced that ABC.jar with new ABC.jar containing XYZ method.

Still i am getting same exception i.e XYZ method not found.

Question:

Which .JAR file will be picked at first?
The one present in .WAR file or the one present in LIB folder of Glassfish.

Is there any program or code snippet for finding the path of jar, which .WAR program is trying to run?
 
Vijitha Kumara
Bartender
Posts: 3914
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not a good practice to have same jar in two locations. If it is shipped with the application server then it should not be packaged in your WAR/EAR files. It will be used from the container.
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha Kumara wrote:It is not a good practice to have same jar in two locations. If it is shipped with the application server then it should not be packaged in your WAR/EAR files. It will be used from the container.


Suppose we have a single domain in Glassfish or any server have already running projects.

Lib folder contains ABC.JAR.1.0

It is used in two projects.

Now we are deploying a project in same domain of same domain nature
but it use ABC.JAR.1.1, having certain changes which impact previous project which we do not want
but required for new project.

So what to do in that scenario
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic