tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel J Zimmerman <g...@groundzero.com>
Subject Strange problems happening with virtualhosting: URGENT
Date Thu, 25 Oct 2001 15:40:49 GMT

Hi,

I am using Tomcat 3.2.3 on a Linux system with a setup of multiple
virtual hosts. Most of my class files are in the <TOMCAT_HOME>/lib
directory, but when I move them out, I still get these problems.

I am having two very strange problems:

First, the java classes do not seem to be able to load a properties file
located in the classes directory using the following code snipit:

			InputStream is =
getClass().getResourceAsStream("/prop_file_name.properties");
			Properties props=new Properties();
			props.load(is);

I get a null pointer exception at the "props.load(is)" line. This would
assumedly mean that the properties file is not there, but it is there
under the correct name. In fact, this is a program copied from another
server with a similar configuration, except it did not use the virtual
hosting. This problem is especially weird, because the webapps recognize
my tld files located in the lib directory.

Second, I am using the mailer taglib, and although everything seems to
go through fine and the taglib reports no errors and there are no
exceptions thrown, the mail doesn't get sent. I tried this from all
virtual hosts on the box with the same problem both using a general mail
server and localhost as the mail server. On another box this same code
works fine, and sendmail works on the box. The code is posted below.

In my investigating this problem there are a couple direct questions:
1) Is there anything I need to do to add a virtual host to Tomcat other
than adding the following lines to the server.xml file?:
        <Host name="myhost.com">
          <Context path="" docBase="/usr/local/www/docs/www.myhost.com"
debug="0"/>
        </Host>
        <Host name="www.myhost.com">
          <Context path="" docBase="/usr/local/www/docs/www.myhost.com"
debug="0"/>
        </Host>
2) Might there be some problem with a class located in the
TOMCAT_HOME/lib directory trying to call getResourceAsStream on a class
that is located in an individual webapp, even if that webapp is the one
that is using the class file in TOMCAT_HOME/lib?
3) Is there anything else that anyone can think that might be causing
this?

This a very urgent problem. Any help would be greatly appreciated.

Thanks,
Gabe

Mime
View raw message