• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jars within jars

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Paper jam tastes about as you would expect. Try some on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic