It's not a secret anymore!
The moose likes Tomcat and the fly likes Problems configurung DataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Problems configurung DataSource" Watch "Problems configurung DataSource" New topic

Problems configurung DataSource

Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178

I'm working through James Goodwill's "Mastering Jakarte Struts" and I'm at the point where to use a Struts powered website to access a database. The book's example uses MySql, but I'm fairly familiar with HSQLDB so I thought I should better use this. I created tables etc to fit the example and made some changes to make it work with the following versions:

Struts 1.3.5
Tomcat 5.0.28

Whenever I start Tomcat and try to get data I get a NPE. After debugging I found out that I can't get a proper DataSource, the specific method returns null for me.

I created a DataSource with Tomcat's admin console, the server.xml looks like this:


What is the problem? The DataSource configuration or the way in which I access it in the source?
I agree. Here's the link:
subject: Problems configurung DataSource
It's not a secret anymore!