> From: Robert Blackburn [mailto:rwblackb...@gmail.com]
> Subject: "java.lang.NullPointerException" with JDBC
> connection from InitialContext
>
>       <Realm className="org.apache.catalina.realm.JDBCRealm"
> connectionName="username" connectionPassword="password"
> connectionURL="jdbc:mysql://localhost:3306/db_name?
> autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF8"
> driverName="com.mysql.jdbc.Driver" roleNameCol="roleNameCol"
> userCredCol="userCredCol" userNameCol="userNameCol"
> userRoleTable="userRoleTable" userTable="userTable"/>

The above indicates the database for the realm is on "localhost"; is that true 
for both your test (Windows) system and the server (Linux) box?  Is localhost 
defined in the Linux box /etc/hosts file?

> And I put this in the /conf/Catalina/webapps/ROOT.xml ...

Unless you have a <Host> named "webapps" defined in server.xml, that doesn't do 
anything.  Also, any <Resource> would have to be nested inside a <Context> 
element, and you haven't indicated that's the case.

>     <Resource name="jdbc/tranzzle" auth="Container"
> type="javax.sql.DataSource"  username="username" password="password"
> driverClassName="com.mysql.jdbc.Driver"
> url="jdbc:mysql://localhost:3306/db_name?autoReconnect=true
> &amp;useUnicode=true&amp;characterEncoding=UTF8"
> validationQuery="select 1"/>

Again, this is using localhost; is that correct?  Are you using the same 
database for both application data and authentication/authorization?  (If so, 
that's a bit unusual.)

> (I've tried puting this in my /conf/context.xml too, hoping that would
> help, but it didn't)

That would make it available to all webapps, not just the one you're interested 
in.

Where did you put the jar containing the MySQL driver classes?  Make sure you 
don't have it in more than one place.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to