Why can't it find my JAR files? [message #150758] |
Mon, 05 December 2005 09:04  |
Eclipse User |
|
|
|
Originally posted by: dserodio.gmail.com
I created a web project, and set it to use Tomcat 5.5 Server. Then I
added some JAR files via Project > Properties > Java Build Path >
Libraries. The JARs reside in /MyWebApp/lib. When I access the webapp, I
get a java.lang.NoClassDefFoundError: org/apache/log4j/Logger.
Why can't Tomcat find the JARs?
Thanks in advance,
Daniel Serodio
|
|
|
|
|
Re: Why can't it find my JAR files? [message #150920 is a reply to message #150900] |
Tue, 06 December 2005 10:55  |
Eclipse User |
|
|
|
Daniel Serodio wrote:
>Darryl L. Miles wrote:
>
>
>>Daniel Serodio wrote:
>>
>>
>>>I created a web project, and set it to use Tomcat 5.5 Server. Then I
>>>added some JAR files via Project > Properties > Java Build Path >
>>>Libraries. The JARs reside in /MyWebApp/lib. When I access the webapp, I
>>>get a java.lang.NoClassDefFoundError: org/apache/log4j/Logger.
>>>
>>>Why can't Tomcat find the JARs?
>>>
>>>
>>Try putting your JARs into a directory /MyWebApp/WEB-INF/lib/.
>>
>>If that doesn't work maybe there is a better forum to post this sort of
>>query to in future, you'd be better off seeking a more generic java web
>>technology forum.
>>
>>
>
>Thanks for your response, but I know about WEB-INF/lib/, my point is I'd
>like to use the same structure for web and non-web projects, that is
>with a /lib directory on the project's root. Is that possible with WTP?
>
>
So you keep your 3rd party JARs located in the directory /MyWebApp/lib
inside your project and would like them copied to /WEB-INF/lib/ at
deployment.
Check out the J2EE Module Dependancies project properties page for
button Add External JARs.
However I'm not sure if this feature is 100% working in 1.0RC1 or even
if it will be 100% working by 1.0 final, for this to happen both server
publication and export to WAR need to be able to deal with this new
feature correctly.
Until then your only other option is to copy the files into
WebContent/WEB-INF/lib directory and refresh your project.
Darryl
|
|
|
Powered by
FUDForum. Page generated in 0.04746 seconds