Get your CodeRanch badge!*
The moose likes JSP and the fly likes different classpath for context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "different classpath for context" Watch "different classpath for context" New topic
Author

different classpath for context

Ankit Doshi
Ranch Hand

Joined: Dec 04, 2002
Posts: 222
Hello,

I am running an application for multiple clients and the setup is like the set of classes being used are common and the property files are different for each client. The structure looks as below :
/usr/local/common_application_classes/ - this folder contains all classes
/usr/local/properties/client1/ - this folder contains properties of client1
/usr/local/properties/client2/ - this folder contains properties of client2
...... etc for all the different clients.

Now, this is a web based application and the classes in the /usr/local/common_application_classes/ are being used from the web application (servlet, jsp files). The properties files are being used from the classes contained in the /usr/local/common_application_classes/ folder.

I want to setup a common tomcat for all these clients, but how should I setup the classpath? /usr/local/common_application_classes/ should be in tomcat's classpath. But, properties files are different for different classes, so thought of creating single tomcat and under that, multiple contexts, one for each client and the properties files goes in the respective client's context/WEB-INF/classes. But, since the classes accessing the properties files are outside tomcat (not in context/WEB-INF/classes), are not being able to access properties files - gives MissingResourceException.

Let say, I have a test.jsp file in context /test, which calls a TestClass.class file and this TestClass.class file is looking up some property file through ResourceBundle. The property file is in /test/WEB-INF/classes/ directory. Now, if the TestClass.class is in /test/WEB-INF/classes, then it works perfectly fine, but if the TestClass.class is outside tomcat (included in tomcat's classpath), then it gives MissingResourceException while looking up property file.

Please tell me how can I proceed further?

Ankit
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12678
    
    5
Tomcat does NOT use the environment classpath at all. There is a detailed discussion of how Tomcat finds files
at this site for Tomcat 5 (and there is a similar one for Tomcat 4)
Bill


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: different classpath for context
 
Similar Threads
ANT Javac/classpath problem
executing a java program from web client
confused between jar and war files
how to confgure Tomcat4.0?
how to Import a program from another folder