Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Compiler/classpath question
Compiler/classpath question [message #165816] Thu, 04 December 2003 14:02
Eclipse UserFriend
Originally posted by: rhino1.NOSPAM.sympatico.ca

I'm having some compile problems with the Commons Fileupload package that I
am trying to use in one of my servlets. Can anyone help?

First of all, I am using Eclipse 2.1.1, Tomcat 4.1.24, and Sysdeo V2.1 on
Windows XP as my development machine. We also have Tomcat 4.1.24 on our
server, which is running Linux.

According to the Class Loader HowTo at the Apache site, jars that are
intended to be shared among several applications should normally be put at
$CATALINA_HOME\server\lib and jars that are intended to be used by one
application alone should be put in the applications WEB-INF\lib.

I'm developing three servlets that do file uploading so I tried putting
commons-fileupload-1.0.jar in the $CATALINA_HOME\servler\lib and made sure
that the build path for the project included this external jar. But the
compiler was not able to see it. I tried clicking the export box in front of
the jar name in the Order and Export tab of the build path preferences but
that made no difference, the compiler still couldn't see the jar. I tried
moving the file upload jar to the top of the Order and Export list and the
compiler still couldn't see the jar, regardless of whether the export
checkbox was selected or not. In each case, all references to classes within
this jar were underlined in red and "Organize imports" failed to resolve
these references.

Since that was obviously not working, I decided to put the jar in my
application's WEB-INF\lib directory as a workaround. That didn't work
either, all references to classes within this jar were underlined in red and
"Organize imports" failed to resolve these references.

The only way I was able to resolve the compiler references for file upload
classes was to put the jar in $CATALINA_HOME\common\lib.

I can live with that as far as developing my code goes but this seems to
cause deployment problems when I try to install my application in Tomcat. I
was told that the best practice was to always place jars in the same place
in development as you do in deployment but putting the file upload jar in
common\lib causes my application serious issues: it either won't install at
all or it soon crashes within the Tomcat code due to classes or classdefs
not found.

Can anyone tell me what I'm doing wrong, particularly with regards to the
compiler? Why won't it see the jars unless they are in Tomcat's common\lib?

--

Rhino
---
rhino1 AT sympatico DOT ca
"If you want the best seat in the house, you'll have to move the cat."
Previous Topic:[ANN] CodePro WebCast Today/Thursday 1:00pm EST
Next Topic:Eclipse FAQ?
Goto Forum:
  


Current Time: Sat Dec 21 13:50:44 GMT 2024

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

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

Back to the top