Reputation: 2471
Let's say I have 2 jar files with the same name and I put one into glassfish/lib folder and the other into glassfish/domains/domain/lib (or glassfish/domains/domain/applibs).
those 2 jar files have the same class name, let say A, and method name, let say method1, but different implementation of method1.
When I start Glassfish server and call A.method1() in my application,which method gets executed?
I did a test and it seemed that the method in glassfish/lib get executed. Is there a way to get the other method executed?
Upvotes: 1
Views: 886
Reputation: 21
I did somewhat the same on tomcat sometime back wherein i had put one implementation in Tomcat\lib directory and the other in application\lib directory.
If the application\lib contains some implementation its given preference over the server\lib directory, whereas in the absence of application\lib, the server\lib is used to run the application.
Hence in your case i.e. domain, it seems the domain\lib A.method1() would be running if both the implementations exist.
Upvotes: 1