-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ramy,

Ugh... I wrote a longer reply and did something stupid with it
(fat-fingered the keyboard... something over by the ENTER/SHIFT/UP keys
and the message just disappeared). You're getting the short-short version.

On 3/31/2009 9:36 PM, Mighty Tornado wrote:
>     validationQuery="select * from family_member;"

This sucks. Use validationQuery="/* PING */SELECT 1" instead.

Your stack trace doesn't include what actually happened, which others
have pointed out. You say that it's not happening anymore and is
probably old. I suspect an NPE because...

> InitialContext ic = new InitialContext();
> 
> if(ic == null)
> {
> System.out.println("context not found");
> }

You don't abort the operation at this point. ic.lookup() will still
execute, but ic is null, so you get an NPE. You should do something like
throw an exception or even return null (or an empty list or whatever is
appropriate).

> DataSource ds =
> (DataSource)ic.lookup("java:comp/env/jdbc/vhousehold");
> 
> if(ds == null)
> {
> System.out.println("DataSource not found");
> }

Same here. If your DataSource is null, you still call getConnection() on
it. NPE.

> conn = ds.getConnection();
> 
> stat = conn.createStatement();
> 
> rs = stat.executeQuery("SELECT * FROM family_member ");

So, rs is null at this point? Are you sure it's rs and not something
like ic or ds? Try adding logging statements after each "real" line of
code and print out the values of these five local variables: ic, ds,
conn, stat, rs.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAknTYOAACgkQ9CaO5/Lv0PDmgACgsplbJtueEOrON9WQ/IJ04Xcc
OcQAoImb6KgWR1Csb2DjG1v7GkY3LJbP
=qc6f
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to