Women in Technology

Hear us Roar

  Creating a Web Application with Ant and Tomcat 4
Subject:   Fixing Null pointer exception
Date:   2006-02-07 04:08:58
From:   nav327
Using Versions...

Tomcat 5.5.14, MySQL 5.0.18-nt, mysql-connector-java-3.1.12-bin.jar, win2k pro.

When loading up address book application a null pointer exception occurs.


Open server.xml inside tomcat5.5\conf
***IMPORTANT**** STOP tomcat service before editing server.xml ********.

inside the tag <GlobalNamingResources>

insert the following....

<Resource name="jdbc/Public" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="mysqlpassword" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/public?autoReconnect=true"/>

Then edit the context.xml within the AddressBook application changing the Driver in the value tag.


Restart Tomcat and reload AddressBook and cross fingers

Full Threads Newest First

Showing messages 1 through 1 of 1.

  • Fixing Null pointer exception...i forgot
    2006-02-09 01:48:28  nav327 [View]

    Also add the following to the context.xml with tomcatdir\conf
    as follows....
    before the closing tag for context (</context)
    <ResourceLink global="jdbc/Public" name="jdbc/Public" type="javax.sql.DataSource"/>