Forums Register Login

nested jar files not working while included in web project

+Pie Number of slices to send: Send
I have created a standalone project and included its jar file in lib folder as follows :
Sample->lib>jar files
sample->src->source files

After constructing my Sample application jar file as sample.jar and trying to include it in my another web project as follows:

WebSample->WebContent->WEB-INF->lib->sample.jar

and constructed war files as WebSample.war

After deploying it is not able to access jar files of sample application and throwing NoClassDefFoundError. Where as if I am running it as standalone project it is working.
What is best solution to resolve this issue.


1
+Pie Number of slices to send: Send
Nested jar files do not work anywhere in the Java environment. You should not package your app as jar file in the first place before including it in the war file.
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:Nested jar files do not work anywhere in the Java environment. You should not package your app as jar file in the first place before including it in the war file.



That's fine. I agree on that. So how to access my libraries in web application.
+Pie Number of slices to send: Send
By putting them in WEB-INF/lib before you package the war file.
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 715 times.
Similar Threads
Not able to read XML file from dependent project
Loading the newly created class at runtime
How to read a file packaged in a jar file
Regarding Jar File
Resolving URIs to TLD files locations
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 10:25:39.