Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

eclipse ClassNotFoundException

Thread view: 
spam@cognisense.com - 19 Apr 2006 14:27 GMT
I seem to be missing something obvious, but I can't get an external JAR
to be recognized at runtime when using eclipse 3.1.2 and wtp 1.0.1.  I
have some servlets which import a 3rd party .jar file.

When I right-click my project, select properties, click Java Build
Path, select the Libraries tab, and click the Add External JARs button,
I am able to add the JAR and the servlets are compiled successfully.
However, when I attempt to run the web app, using Tomcat 5.5.16, I get
the notorious ClassNotFoundException.

The ONLY way I've been able to overcome this runtime issue is by
manually copying the JAR file to the JVM's runtime externals directory
- on my WinXP box that's c:\java\jre1.5.0\lib\ext.

Great that I've found a work-around, but surely there's something I can
do within eclipse to make these JARs available to tomcat at runtime.

Suggestions?
chris brat - 19 Apr 2006 14:41 GMT
Hi,

As far as I know with Tomcat you either have to copy to the external
jars to the common library location (think its /shared/lib/**) or have
the external libs included in your war (guessing you build your package
into a war) under the /WEB-INF/lib directory.

I generally keep my external libs under the WEB-INF directory  - this
makes the package larger but at least I know that my libs are there and
will always be the right version.

Hope this help,

Chris


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.