• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

How to connect Tomcat 4.1 to MS SQL2000?

<Context path="/boa"
         docBase="C:\BOA\BOACommonDB\WebSite"
         debug="9"
         reloadable="true" >

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
connectionURL="jdbc:microsoft:sqlserver://localhost:1433/webuserstest?user=sa"
userTable="users" userNameCol="user_name" userCredCol="USER_PASS" userRoleTable="user_roles"
roleNameCol="ROLE_NAME" />
</Context>

Above is the tag I have in my server.xml to define the site and the Realm to connect to MS SQL2000.  I have put the driver jar file into /server/lib folder of Tomcat but I keep getting the error below, any reason for it? I have made sure I use the JDBCRealm that comes with Tomcat.


INFO: Initializing Coyote HTTP/1.1 on http-8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.31
java.lang.NullPointerException
        at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:624)
        at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:688)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:707)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1141)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:316
        at org.apache.catalina.core.StandardService.start(StandardService.java:4
        at org.apache.catalina.core.StandardServer.s
tThe application exiteda
rt(StandardServer.java:2143)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:463)
        at org.apache.catalina.startup.Catalina.execute(Catalina.java:350)
        at org.apache.catalina.startup.Catalina.process(Catalina.java:129)
        at sun.reflect.NativeMetC:\BOA\Tomcat\bin>
C:\BOA\Tomcat\bin>
0
fylix0000
Asked:
fylix0000
1 Solution
 
bloodredsunCommented:
Can you connect to the database using a JSP? This would check that the database permissions are correctly set for the user that you are using. and that the password is correct
0
 
KuldeepchaturvediCommented:
It is also possible that database is not listening at port 1433 for incoming connection ( will have if somebody has dorked around the SQL server settings)..
0
 
colr__Commented:
What data types are you using? Are you using blobs anywhere?

colr__
0
 
fylix0000Author Commented:
The database I have uses just varchar, bigint, smallint, tinyint, dont think I have blobs anywhere.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now