tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <>
Subject Re: Null Pointer Exception - would you please take a look?
Date Tue, 18 Jun 2002 19:48:07 GMT

----- Original Message -----
From: "John Gregg" <>
To: "'Tomcat Users List'" <>
Sent: Tuesday, June 18, 2002 2:34 PM
Subject: RE: Null Pointer Exception - would you please take a look?

> First, back-off.  Yeah, maybe some people aren't reading your e-mails
> carefully, but some of us are supposed to be billing clients and not
> answering your e-mails.

Not trying to start any flames John.  I'd just prefer that if someone
doesn't have the time to read and understand my question that they not
reply - that's all.  When you look at the third message in a row that says
"Make sure you're not giving a null value" or "He isn't checking to make
sure he has a valid connection" it gets kinda exasperating.  I understand
people have things they have to do - that they get paid to do - and I fault
nobody for that.  Your previous reponse, to be honest, is the most useful
one I have gotten until you sent this one - thank you for honestly trying to
come up with a solution - I DO appreciate it.

> Second, an introduction to the art of reading stack traces.  There's no
> problem loading your driver.  If there had been, you would be getting a
> different error message.  The connection is not null.  Again, if so, you
> never your have gotten as far as you have.  The statement is not null.  If
> it was, the stack trace would finish one line earlier than it does.  The
> problem is that setString() has been called and there's a NPE.  My
> guess is that the String param is null.  The username is the parameter
> there, BTW.  Look at the Tomcat source.

Yes - I agree and these were my thoughts as well - but why? =)  Is it
perhaps a mis-configuration on my part?  I honestly believe I have the XML
right.  It works fine with a MemoryRealm - only when I go to a JDBCRealm
does it start having problems.

> What puzzles me about your situation is that you say you're accessing a
> (a jsp, right?) that you THINK is protected.  What's the url and what does

> your web.xml file say?  Tomcat is obviously trying to log you in via the
> JDBCRealm but you said you're not getting prompted to enter a username and
> password.  That's a stumper to me.  It at least explains why setString()
> might be getting a null param.  With basic authentication, the browser
> remembers the login info and resubmits it on every request, I think.  The
> only way to log out is to restart your brower.  By default Tomcat caches
> login info also, so you wouldn't see an attempt to hit the db unless you
> turned off this caching, which you probably didn't.  So, I would say
> an issue with web.xml not doing what you think it should do but I can't
> my finger on what it is.  Post your url and web.xml contents.

No - I don't think it's protected =)  I know it's protected.  If I access it
with a MemoryRealm everything works as expected.  It's only when I introduce
the JDBCRealm that things get out of whack.

I always restart my browser =)  Heck I've even tried rebooting.  Oh - and I
always close OutlookExpress when I close IE too - I've had things that cause
me to be suspicious of it causing things to be cached between browser
session.  Call me over-paranoid - but I like to be extra sure =)

My web.xml is:

 <?xml version="1.0" encoding="ISO-8859-1" ?>
  <!DOCTYPE web-app (View Source for full doctype...)>
- <web-app>
- <welcome-file-list>
- <security-constraint>
- <web-resource-collection>
- <auth-constraint>
- <user-data-constraint>
- <login-config>
  <realm-name>Authentication Test</realm-name>
- <security-role>

> You might also look at the status codes in the access log.

Will do - but I'm not sure where I can make sense of them - I'll take a look
on the TC site though.

> john

Sorry if I offended you - I wasn't trying to - I was quite offended at the
responses I was getting though.  I felt as though I were being treated like
an idiot - and I am not an idiot =)  I _do_ understand that people are in
business to make money and not just answer questions for free all day long,
however if that person doesn't have time to actually read my question - and
not just the subject - I'd prefer they just pass me by.  It's a waste of
both of our time if they do otherwise - would you not agree?  No - I don't
feel you fall in this category - you've given good, sound advice.



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message