Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
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?
 
Bartender
Posts: 4107
72
Hibernate Fedora Chrome
  • 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
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic