• 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

nested jar files not working while included in web project

 
Greenhorn
Posts: 21
Netbeans IDE Eclipse IDE Java
  • 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.


 
Rancher
Posts: 43016
76
  • 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
Netbeans IDE Eclipse IDE Java
  • 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: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By putting them in WEB-INF/lib before you package the war file.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic