You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by btodd_22 <br...@mortech-inc.com> on 2010/06/29 17:01:10 UTC
Help with tomcat configuration
I am trying to track down a problem that has something to do with this error
below
[CODE]java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:418)
at java.util.Properties.load0(Properties.java:337)
at java.util.Properties.load(Properties.java:325)
at
snaq.db.ConnectionPoolManager.loadProperties(ConnectionPoolManager.java:278)
at
snaq.db.ConnectionPoolManager.getInstance(ConnectionPoolManager.java:167)
at
snaq.db.ConnectionPoolManager.getInstance(ConnectionPoolManager.java:221)[/CODE]
Now here is what i know, the code that is calling the Connection pool is
correct since i can put the .war file out on another machine and it works
fine. I have been looking through the conf files for some sort of
incosistency between the two environment. Is it incorrect to assume that
tomcat can't find my db.properties file if so where do i tell tomcat to
look? or does any one else have a better idea on where to look.
Thanks in advance.
Brandon
--
View this message in context: http://old.nabble.com/Help-with-tomcat-configuration-tp29024672p29024672.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Help with tomcat configuration
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: btodd_22 [mailto:brandon@mortech-inc.com]
> Subject: Re: Help with tomcat configuration
>
> it was my understanding that tomcat used the context.xml
> within the project itself as the base and not the global
> within the Catalina Ba
Not quite sure what your unfinished sentence was supposed to say, but if you read the doc:
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html
you'll notice that a <Context> element in conf/Catalina/[host]/[appName].xml takes precedence over the one in the webapp's META-INF/xml file.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Help with tomcat configuration
Posted by btodd_22 <br...@mortech-inc.com>.
btodd_22 wrote:
>
> I am trying to track down a problem that has something to do with this
> error below
>
> [CODE]java.lang.NullPointerException
> at java.util.Properties$LineReader.readLine(Properties.java:418)
> at java.util.Properties.load0(Properties.java:337)
> at java.util.Properties.load(Properties.java:325)
> at
> snaq.db.ConnectionPoolManager.loadProperties(ConnectionPoolManager.java:278)
> at
> snaq.db.ConnectionPoolManager.getInstance(ConnectionPoolManager.java:167)
> at
> snaq.db.ConnectionPoolManager.getInstance(ConnectionPoolManager.java:221)[/CODE]
>
> Now here is what i know, the code that is calling the Connection pool is
> correct since i can put the .war file out on another machine and it works
> fine. I have been looking through the conf files for some sort of
> incosistency between the two environment. Is it incorrect to assume that
> tomcat can't find my db.properties file if so where do i tell tomcat to
> look? or does any one else have a better idea on where to look.
>
> Thanks in advance.
>
> Brandon
>
I found what the issue was. I found that within my
usr/local/tomcat/conf/Catalina/localhost there is a bunch of xml files each
resembling each project that is on tomcat. I found that within the project
that was failing it had a docbase pointing to my home file which houses all
my java code but not my property file and all I did was take that parameter
out of there. Restarted tomcat and it worked. Now correct me if i am wrong
here but it was my understanding that tomcat used the context.xml within the
project itself as the base and not the global within the Catalina Ba someone
please enlighten me on this.
Thanks in advance.
Brandon
--
View this message in context: http://old.nabble.com/Help-with-tomcat-configuration-tp29024672p29025752.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Help with tomcat configuration
Posted by btodd_22 <br...@mortech-inc.com>.
n828cl wrote:
>
>> Now here is what i know, the code that is calling the
>> Connection pool is correct
>
> All evidence to the contrary...
>
>> Is it incorrect to assume that tomcat can't find my
>> db.properties file
>
> Yes, it is incorrect to assume that, especially since Tomcat isn't looking
> for it - your code is.
>
> When you post, at a bare minimum, tell us the Tomcat version you're using,
> along with the JVM level and the platform you're running on. Since this
> particular problem appears to be related to the code in
> snaq.db.ConnectionPoolManager that's attempting to read the properties,
> you should provide that code as well.
>
> - Chuck
>
>
I am on Fedora 12 and using tomcat 6 along with java version 1.6 ******
Here is one more line of the stack trace.
[CODE]
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:418)
at java.util.Properties.load0(Properties.java:337)
at java.util.Properties.load(Properties.java:325)
at
snaq.db.ConnectionPoolManager.loadProperties(ConnectionPoolManager.java:278)
at
snaq.db.ConnectionPoolManager.getInstance(ConnectionPoolManager.java:167)
at
snaq.db.ConnectionPoolManager.getInstance(ConnectionPoolManager.java:221)
at com.******.<init>(*******.java:23)
[/CODE]
which correlates to this method
[CODE]
try
{
connMgr = ConnectionPoolManager.getInstance(); //THIS IS LINE
23
}
catch (Exception e)
{
e.printStackTrace();
}
[/CODE]
The init method is the following
[CODE]
InputStream is = getClass().getResourceAsStream("/db.properties");
Properties dbProps = null;
try {
dbProps = new Properties();
dbProps.load(is);
}
catch (Exception e) {
System.err.println("Can't read the properties file. " +
"Make sure db.properties is in the CLASSPATH");
return;
}
loadDrivers(dbProps);
createPools(dbProps);
[/CODE]
--
View this message in context: http://old.nabble.com/Help-with-tomcat-configuration-tp29024672p29024973.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Help with tomcat configuration
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: btodd_22 [mailto:brandon@mortech-inc.com]
> Subject: Help with tomcat configuration
>
> Now here is what i know, the code that is calling the
> Connection pool is correct
All evidence to the contrary...
> Is it incorrect to assume that tomcat can't find my
> db.properties file
Yes, it is incorrect to assume that, especially since Tomcat isn't looking for it - your code is.
When you post, at a bare minimum, tell us the Tomcat version you're using, along with the JVM level and the platform you're running on. Since this particular problem appears to be related to the code in snaq.db.ConnectionPoolManager that's attempting to read the properties, you should provide that code as well.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org