User not logged in - login - register
Home Calendar Books School Tool Photo Gallery Message Boards Users Statistics Advertise Site Info
go to bottom | |
 Message Boards » » need java help -- how do i include a .jar file? Page [1]  
psnarula
All American
1540 Posts
user info
edit post

i'm taking this jsp/servlets class at school. i do my development at home via eclipse and run my servlets locally using tomcat. then upload my .class files to a server where my instructor can see them and grade them.

i have to import some special .jar files (servlet-api.jar and jsp-api.jar) into eclipse so that Eclipse can resolve objects such as javax.servlet.http.HttpServletRequest. These .jar files come in the tomcat_install_dir\common\lib\. i've got this working just fine and had no problems with last week's homework assignment -- when i upload the .class files that Eclipse generates to the server at school everything works fine.

now I'm doing this week's homework assignment which requires the use of the Jakarta Commons package that can be downloaded from apache.org. i've got everything working just fine locally but when i upload to the server, i get:

java.lang.NoClassDefFoundError: org/apache/commons/beanutils/BeanUtils
coreservlets.beans.BeanUtilities.populateBean(BeanUtilities.java:52)


so obviously the server doesn't know about the commons package. how do i fix this problem?

i guess this question gets at a larger issue that I don't understand either -- how does the tomcat server at school know where to find the other two .jar files that I had to include for the first homework assignment?

i'd send email to the teacher but he's on a flight to Manilla for some conference and won't respond until tomorrow night. so hopefully somebody here can tell me what's going on before then...

9/21/2005 1:44:42 PM

zorthage
1+1=5
17148 Posts
user info
edit post

tomcat will include jars in the following directories:

tomcat_install_dir\common\lib
tomcat_install_dir\shared\lib
tomcat_install_dir\webapps\webappname\WEB-INF\lib


The first is (i believe) used by tomcat as well
the shared is if multiple webapps are going to need the same jar
the webapp is any custom code for only the webapp

In the past, ive added them to either common or to the webapp (from a server i have running at home). If you have access, look in the directories to make sure the jar you're using is there, and also to make sure you're using the same version of the file (BeanUtils might not be in the one on the server?)



Webapps can be a pain to configure, so have fun bashing your head

9/21/2005 10:27:46 PM

esgargs
Suspended
97470 Posts
user info
edit post

I have used Tomcat a lot

and gotta say that JBoss is a lot better.

9/21/2005 10:33:41 PM

psnarula
All American
1540 Posts
user info
edit post

hey thanks for the tip. i put the commons jar in

~username/public_html/WEB-INF/lib

and it worked great on the server.

9/22/2005 10:27:43 PM

niteman
Veteran
374 Posts
user info
edit post

i fucking take the brute-force approach throw the .class .lib files in every directory that already has a bundle of them. (don't take this advice too seriously)

9/22/2005 11:14:20 PM

philihp
All American
8349 Posts
user info
edit post

^^^what is with the aversion to providing useful help?

9/23/2005 2:01:44 PM

niteman
Veteran
374 Posts
user info
edit post

sorry mon

9/23/2005 7:08:19 PM

 Message Boards » Tech Talk » need java help -- how do i include a .jar file? Page [1]  
go to top | |
Admin Options : move topic | lock topic

© 2024 by The Wolf Web - All Rights Reserved.
The material located at this site is not endorsed, sponsored or provided by or on behalf of North Carolina State University.
Powered by CrazyWeb v2.39 - our disclaimer.