Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » newbie: adding jar files in ETW Servlet project
newbie: adding jar files in ETW Servlet project [message #181637] Fri, 13 October 2006 11:34 Go to next message
Eclipse UserFriend
Originally posted by: peter.kolbe.korasoft.net

WTP Eclipse SDK Version: 3.2.0, Apache Tomcat/5.5.17

Hi experts,

creating and running the sample
HelloWorldServlet extends javax.servlet.http.HttpServlet
is running fine.

Now I'm trying to import a jar file from an external vendor.

At runtime I get an error

java.lang.NoClassDefFoundError: com/sap/mw/jco/JCO

What is the normal way to add jar files in Eclipse environment?
Thank you!

Peter
Re: newbie: adding jar files in ETW Servlet project [message #181650 is a reply to message #181637] Fri, 13 October 2006 14:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kosta.bea.com

The easiest way is to simply drag-n-drop the jar into your web app's
WEB-INF/lib directory.

If you want to keep the jar separate from your app and only bundle it
when the .war archive is created, you can use the "J2EE Module
Dependencies" property page of your web app to make it reference the jar.

- Konstantin
Re: newbie: adding jar files in ETW Servlet project [message #181658 is a reply to message #181650] Fri, 13 October 2006 18:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter.kolbe.korasoft.net

Thanks Konstantin,

the drag-n-drop works.
Unfortunately the lib folder gets an plus in front, but the library is still
invisible.
Doing it again, a warning message occurs.
On the file system the library is copied.

Peter


"Konstantin Komissarchik" <kosta@bea.com> schrieb im Newsbeitrag
news:ego988$jfu$1@utils.eclipse.org...
> The easiest way is to simply drag-n-drop the jar into your web app's
> WEB-INF/lib directory.
>
> If you want to keep the jar separate from your app and only bundle it when
> the .war archive is created, you can use the "J2EE Module Dependencies"
> property page of your web app to make it reference the jar.
>
> - Konstantin
Re: newbie: adding jar files in ETW Servlet project [message #181660 is a reply to message #181658] Fri, 13 October 2006 18:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kosta.bea.com

Peter,

That's actually what's supposed to happen. It's an odd behavior, I know,
but unfortunately we in WTP cannot do anything about it. :( After the
drag-n-drop, you should see the jar under the "Web Application
Libraries" node in the Package Explorer. You will not see it under the
WEB-INF/lib directory unless you switch to the Resource perspective and
use the Resource Navigator view.

- Konstantin
Re: newbie: adding jar files in ETW Servlet project [message #181664 is a reply to message #181660] Sat, 14 October 2006 22:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: luca.nosp.am

Hello,

I am having a problem related to the adding of jar giles to a Dynamic
Web Page. Currently I am using Eclipse 3.2.1 an WTP 1.5.1, just up to
date today.
The problem is that i added a .jar file to my web-inf/lib directory, but
then when i deploy and run the webapp (i am using tomcat 4.1.27 as
server container), i am getting classnotdeffound exception by all my
servlets: in fact i am seeing that the .jar file (which is properly
shown under the "Web application libraries") does not get deployed.
After i copied manually the .jar file to
<workspace> \.metadata\.plugins\org.eclipse.wst.server.core\tmp2\webapps \ <projectname>\WEB-INF\libs
then it worked properly.

Why the jar file did not get deployed automatically?

Greetings,
Luca

Konstantin Komissarchik wrote:
> Peter,
>
> That's actually what's supposed to happen. It's an odd behavior, I know,
> but unfortunately we in WTP cannot do anything about it. :( After the
> drag-n-drop, you should see the jar under the "Web Application
> Libraries" node in the Package Explorer. You will not see it under the
> WEB-INF/lib directory unless you switch to the Resource perspective and
> use the Resource Navigator view.
>
> - Konstantin
Re: newbie: adding jar files in ETW Servlet project [message #181670 is a reply to message #181664] Mon, 16 October 2006 12:58 Go to previous message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
In the future, for what is effectively a new question, I would recommend
starting a new thread.

Based on what you describe, I can't think of any likely reason the jar
wouldn't get published. What would be helpful is to delete the jar
under "/tmp2/webapps/.../WEB-INF/lib" and verify that the jar continues
not to be published. If it still won't publish, open a Bugzilla report
with the details of your environment and attach a copy of the
"publish?.xml" file found under in the
"<workspace>\.metadata\.plugins\org.eclipse.wst.server.core\publish "
directory.

The '2' following "tmp" in your path suggests you may have more than one
Tomcat server at the moment. If there are multiple "publish?.xml"
files, then examine the servers.xml file in the
"<workspace>\.metadata\.plugins\org.eclipse.wst.server.core " directory
to find the "id" attribute associated with the Tomcat 4.1.27 server in
question. Then examine the publish.xml file in the same directory to
find which publish?.xml file is linked to that "id".

After saving a copy for the bug report, you can try deleting the file
and see the publish works any better. This file is where publish
operations cache what has already been copied to avoid copying files
that haven't changed.

Cheers,
Larry

Luca wrote:
> Hello,
>
> I am having a problem related to the adding of jar giles to a Dynamic
> Web Page. Currently I am using Eclipse 3.2.1 an WTP 1.5.1, just up to
> date today.
> The problem is that i added a .jar file to my web-inf/lib directory, but
> then when i deploy and run the webapp (i am using tomcat 4.1.27 as
> server container), i am getting classnotdeffound exception by all my
> servlets: in fact i am seeing that the .jar file (which is properly
> shown under the "Web application libraries") does not get deployed.
> After i copied manually the .jar file to
> <workspace> \.metadata\.plugins\org.eclipse.wst.server.core\tmp2\webapps \ <projectname>\WEB-INF\libs
>
> then it worked properly.
>
> Why the jar file did not get deployed automatically?
>
> Greetings,
> Luca
>
> Konstantin Komissarchik wrote:
>> Peter,
>>
>> That's actually what's supposed to happen. It's an odd behavior, I
>> know, but unfortunately we in WTP cannot do anything about it. :(
>> After the drag-n-drop, you should see the jar under the "Web
>> Application Libraries" node in the Package Explorer. You will not see
>> it under the WEB-INF/lib directory unless you switch to the Resource
>> perspective and use the Resource Navigator view.
>>
>> - Konstantin
Previous Topic:Does anybody have the WTP server definition for Tomcat 5.0 / Tomcat 5.5?
Next Topic:Web project from CVS source (missing Deployment Descriptor)
Goto Forum:
  


Current Time: Fri Apr 19 19:26:46 GMT 2024

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

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

Back to the top