aspose file tools*
The moose likes Glassfish and the fly likes How to find which Jar file, which .WAR is trying to run? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Glassfish
Bookmark "How to find which Jar file, which .WAR is trying to run?" Watch "How to find which Jar file, which .WAR is trying to run?" New topic
Author

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

Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382

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?


Regards
Azrael Noor
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

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.


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Azrael Noor
Ranch Hand

Joined: Jul 29, 2010
Posts: 382
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find which Jar file, which .WAR is trying to run?