Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Why can't it find my JAR files?
Why can't it find my JAR files? [message #150758] Mon, 05 December 2005 14:04 Go to next message
Eclipse UserFriend
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 #150861 is a reply to message #150758] Mon, 05 December 2005 22:53 Go to previous messageGo to next message
Darryl Miles is currently offline Darryl MilesFriend
Messages: 123
Registered: July 2009
Senior Member
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.


Darryl
Re: Why can't it find my JAR files? [message #150900 is a reply to message #150861] Tue, 06 December 2005 14:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dserodio.gmail.com

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?

TIA,
Daniel Serodio
Re: Why can't it find my JAR files? [message #150920 is a reply to message #150900] Tue, 06 December 2005 15:55 Go to previous message
Darryl Miles is currently offline Darryl MilesFriend
Messages: 123
Registered: July 2009
Senior Member
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
Previous Topic:JSP Editor code-complete in non DynamicWeb project
Next Topic:JSP Editor not seeing taglibs in non-wtp projects
Goto Forum:
  


Current Time: Tue Apr 23 06:21:08 GMT 2024

Powered by FUDForum. Page generated in 0.02693 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top