• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Tomcat 4.1.12, can't compile classes

 
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've built a web application with some classes in the "WEB-INF/classes/com/home/puppies/" directory. The application runs fine in JBuilder on my development box. I'm currently trying to deploy the application to my new Linux server running Tomcat 4.1.12 but I keep getting this can't compile classes error. It will say my attempt to instantiate classes are invalid so it seems like I'm missing some libs or my classpath is incorrect (currently I'm not setting one). I've added WebLogic.jar (which holds all libs for the java library) in a directory called "WEB-INF/lib/". This resulted in the same error. Would anyone know what I'm doing wrong here?
 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want to include some library in your tomcat so it can be accesible to tomcat and all your apps you have to place it in $CATALINA_HOME/common/lib dir. If you place it in the WEB_INF/lib it will be visible just for this app.
About the java libraries, you should download them from j2se site or j2ee site and set the proper classpath, JAVA_HOME, CATALINA_HOME enviroment vars.
[ September 27, 2002: Message edited by: Juanjo Bazan ]
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Juanjo Bazan:
If you want to include some library in your tomcat so it can be accesible to tomcat and all your apps you have to place it in $CATALINA_HOME/common/lib dir. If you place it in the WEB_INF/lib it will be visible just for this app.


I've added the jar files needed by my application in each of these directories with no luck.

Originally posted by Juanjo Bazan:
About the java libraries, you should download them from j2se site or j2ee site and set the proper classpath, JAVA_HOME, CATALINA_HOME enviroment vars.


I have downloaded J2SE and added that directory as JAVA_HOME. Should I need to add the jar files needed by my application to the JAVA_HOME as well?
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by James Davis:

I have downloaded J2SE and added that directory as JAVA_HOME. Should I need to add the jar files needed by my application to the JAVA_HOME as well?


No. Now, your JAVA_HOME is OK.
Put the libraries your app need in your WEB-INF/lib.
Now all these classes will be visible to all the classes in WEB-INF/classes dir.
What error do you get? When you do what? May you show the exception message?
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've got the libs in the WEB-INF/lib directory and the classes in the WEB-INF/classes directory. The package it shows on the error screen is also correct under the classes folder. You can see the error here, http://www.puppiesofgreenstone.com/pog/millee.jsp?a=0
 
Juanjo Bazan
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error you are getting is not a classpath problem.
It seems you have a calling within millee.jsp to the getImagesInDirectory() method of the com.home.puppies.FileUtilities class.
Check that calling. Check the input parameters.
You are getting a NullPointerException there, so probably you are passing as parameter something that does not exists or the name is incorrect.
If you still don't know what it is, paste here the reference to getImagesInDirectory.
[ September 30, 2002: Message edited by: Juanjo Bazan ]
[ September 30, 2002: Message edited by: Juanjo Bazan ]
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, it's showing a different error today. After my last post I figured out why it wasn't finiding the classes (FileUtilities.class). Now I'm getting the null pointer because I'm trying to point to a directory and get the image count. Yet for some reason I can't. It works ok locally in Windows but not in Linux. I'll keep playing with it. Thanks for your help.
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cool, it looks like the system is working now.
reply
    Bookmark Topic Watch Topic
  • New Topic