You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Steve <pe...@mindspring.com> on 2004/07/04 23:47:41 UTC
NullPointerException JDBCRealm Oracle Thin
Getting a NullPointerException at Tomcat startup. JDBCRealm configuration
excerpt from server.xml and stack trace below. I've dropped the JDBC driver
JAR into the common\lib directory and set up the realm configuration as
described in the documentation. The driver name and URL are verified because
I successfully use them to configure a datasource in web.xml. Any ideas?
Thanks!
server.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Server debug="0" port="8081" shutdown="SHUTDOWN">
<Service name="Tomcat-Standalone">
<Connector acceptCount="10"
className="org.apache.catalina.connector.http.HttpConnector"
connectionTimeout="60000" debug="0" maxProcessors="75" minProcessors="5"
port="8080"/>
<Engine debug="0" defaultHost="localhost" name="Standalone">
<Host appBase="C:\Documents and
Settings\spearson\jbproject\pots\Tomcat\webapps" debug="0" name="localhost"
unpackWARs="true">
<Context debug="0" docBase="C:\Documents and
Settings\spearson\jbproject\pots\defaultroot" path="" reloadable="true"
workDir="C:\Documents and Settings\spearson\jbproject\pots\Tomcat\work"/>
</Host>
<Realm
className="org.apache.catalina.realm.JDBCRealm"
driverName="oracle.jdbc.OracleDriver"
connectionUrl="jdbc:oracle:thin:@jdbc:oracle:thin:@192.168.1.103:1521:pots"
connectionName="purchasing"
connectionPassword="pots"
userTable="purchasing.pots_roles" userNameCol="email"
userCredCol="email"
userRoleTable="purchasing.pots_roles" roleNameCol="pots_role_type_name"
debug="99"
/>
</Engine>
</Service>
</Server>
Stack trace:
HttpConnector Opening server socket on all host IP addresses
Starting service Tomcat-Standalone
Apache Tomcat/4.0.6
java.lang.NullPointerException
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:164)
at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:548)
at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
at org.apache.catalina.core.StandardService.start(StandardService.java:388)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:243)
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
RE: NullPointerException JDBCRealm Oracle Thin
Posted by Steve <pe...@mindspring.com>.
No joy. The driver name I had is actually as documented, and works in a
separate configuration used by the application. (Should also have mentioned
that the Oracle version is 9.2.0.1). And it's definitely not that it can't
find the driver JAR, since it throws a different error if I remove it from
the Tomcat common/lib directory. NPE means it's expecting something to be
instantiated that isn't, but the previous two issues are the only thing I
can think of that I have control over and could conceivably cause that. I'm
using the XML-based realm in as a stopgap in the meantime, but it sure would
be nice to get this going.
-----Original Message-----
From: Niaz Habib [mailto:niaz.habib@gmail.com]
Sent: Sunday, July 04, 2004 10:39 PM
To: Tomcat Users List
Subject: Re: NullPointerException JDBCRealm Oracle Thin
The last time I used Oracle JDBC Driver (classes12.zip), the JDBC
Driver class was oracle.jdbc.driver.OracleDriver. I see that you are
using oracle.jdbc.OracleDriver as driver class while defining
JDBCDataSourceRealm. Try oracle.jdbc.driver.OracleDriver instead.
Niaz
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
Re: NullPointerException JDBCRealm Oracle Thin
Posted by Niaz Habib <ni...@gmail.com>.
The last time I used Oracle JDBC Driver (classes12.zip), the JDBC
Driver class was oracle.jdbc.driver.OracleDriver. I see that you are
using oracle.jdbc.OracleDriver as driver class while defining
JDBCDataSourceRealm. Try oracle.jdbc.driver.OracleDriver instead.
Niaz
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org