Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

project dependencies ?

 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Would anyone please happen to have any experience with the following "project dependencies" problem ?

I'm trying to defined 2 projects as follows:
1) PlainProject : a simple java project, holding some plain utility classes.
2) WebProject : a web project, *that uses code from PlainProject*

I have, of course, edited the "project properties" of WebProject,
and made sure that "PlainProject" is checked in both:
- "project dependencies"
- "build path/projects".

No, I have no problem *compiling* the WebProject (I can even see my PlainProject methods when using auto completion).
However, it fails on *runtime* : when running WebProject (on WSAD 5.1.1 test environmet), it throws a NoClassDefFoundException.

Both projects hold straight-forward code, no tricky usage of ClassLoaders, and no 3rd party jars.

Any ideas would be greatly appreciated.

Thanks .
 
David Ulicny
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to put your Java project to web project as JAR file in WEB-INF\lib directory. Than the web application will be able to access the clasess from your Java project.
 
Senthil B Kumar
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
or create an EAR out of the JAR & WAR file.
 
sanat
Ranch Hand
Posts: 111
Eclipse IDE Java Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open application.xml, Go to Modules, and in Project Utility JARs add your utility product.

Hope this helps.
 
Sol Mayer-Orn
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That was exacly it.
Thanks very much
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic