• Post Reply Bookmark Topic Watch Topic
  • New Topic

nested jar files not working while included in web project  RSS feed

 
Pratik Parekh
Greenhorn
Posts: 21
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pratik Parekh
Greenhorn
Posts: 21
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By putting them in WEB-INF/lib before you package the war file.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!