Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jars within jars

 
louise rochford
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help, my head is spinning with confusion...
I've 3 projects:
a) an Ear project containing:
b) a Web project &
c) a utility "Framework" Java project
I have project references from the Ear to the Web & Java projects,
and from the Web to the Java project.
The Java project is also on the build path for the Web project.
The Java project needs to use log4j-1.2.8.jar. Since this isn't
standarly included by WSAD, I've created a 'lib' folder within the
project, placed the jar in there & then used 'Add JAR' to add the
library to the build path.
I didn't put the log4j.jar in the Ear, cos I want to be able to use
the Java project in other Ears potentially.
Everything compiles OK, but I get the dreaded NoClassDefFound (
of a class in the log4j.jar) when the Web code runs code in the Java project for the first time.
Obviously some classpath issue but I don;t know how to start sorting it out.
Can anyone help?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Louise,
WSAD has two types of classpaths. The build path (accessed through right clicking and selecting properties) gives you the compile time classpath. This is probably where you added the jar.
The module dependencies give you the runtime classpath. Anything added to the module dependencies is automatically added to the build path. You can access this in the J2EE view by right clicking and selecting edit module dependencies.
 
louise rochford
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorted it out.
I tidied up the module dependencies but it still wasn't working.
Turned out to be a version conflict between the log4j..jars.
I'm now using the one buried within the eclipe runtime (log4j-1.2.4.jar) & that seems OK.
Thanks for your help,
Louise
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic