File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Websphere and the fly likes project dependencies ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "project dependencies ?" Watch "project dependencies ?" New topic

project dependencies ?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311

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

Joined: Aug 04, 2004
Posts: 724
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.

SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
Senthil B Kumar
Ranch Hand

Joined: Feb 09, 2004
Posts: 160
or create an EAR out of the JAR & WAR file.

Work like you don't need the money. Love like you've never been hated. Dance like nobody's watching. Sing like nobody's listening. Live like it's Heaven on Earth.
Currently I Reside Here WEBlog
Ranch Hand

Joined: Dec 08, 2004
Posts: 111

Open application.xml, Go to Modules, and in Project Utility JARs add your utility product.

Hope this helps.
Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
That was exacly it.
Thanks very much
I agree. Here's the link:
subject: project dependencies ?
It's not a secret anymore!