• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

project dependencies ?

 
Ranch Hand
Posts: 311
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 .
 
Ranch Hand
Posts: 724
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
or create an EAR out of the JAR & WAR file.
 
Ranch Hand
Posts: 111
Mac Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That was exacly it.
Thanks very much
reply
    Bookmark Topic Watch Topic
  • New Topic