You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Eddie Bush <ek...@swbell.net> on 2002/06/18 00:17:46 UTC

Null Pointer Exception - would you please take a look?

I'm running Tomcat 4.0.1, InterBase 6 Super Server, and Apache 1.3.22.

Everything works super, until I throw in a JDBC realm and try to connect to an application protected by a security constraint.  When I do, I get the following exception in my server log:

2002-06-17 12:29:28 [org.apache.catalina.connector.warp.WarpRequestHandler]
java.lang.NullPointerException
    at interbase.interclient.PreparedStatement.setString(Unknown Source)
    at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
    
... and it continues.  I hate to paste it all unless it's necessary to do so.

My thought was that someone may have experienced this - or that it may be a known issue.  I checked the docs to ensure that my driver implements PreparedStatement and setString() ... and it does.  It's a JDBC 1.0 driver though.

What would be the recommended course of action?  I'm not sure what's going on here for certain, and that's why I'm posting.

Thanks in Advance!

Eddie



Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
Yeah - it works fine except when I use it in this context.   The double //
after the host is a ... well it's like this: =)

protocol:subprotocol://server/path

... and because my path starts with a /, I have two of them - works super on
everything else.  I run on RHL 7.2 =)  The first one is a delimiter - the
second is necessary to indicate the path.  ... at least that's how I've
always done it.  I read it somewhere I think, but I couldn't tell you where.

I just downloaded Firebird - and upon looking at the docs I think I quite
like it.  I'm in the process of uninstalling interclient, as it wasn't an
RPM install - so I guess I get to do that part by hand =)  Ignacio tells me
I won't need interserver anymore, so ... I want to be sure everything is as
'tight' (security-wise and file-system-wise) as it can be.  I abhor needless
clutter floating around ... unless it's in my personal directory ;) lol

>From the looks/sound of things, I can either use the driver approach or I
have the option of binding a datasource into JNDI - InterBase didn't offer
that, so it's a step ahead, I think.  I figure the JDBCRealm will use the
driver approach (since the only JNDI lookup supported by TC is currently
LDAP), and then I can just have my initialization servlet bind a reference
to the appropriate POOLING datasource (I liked that part =) provided by
Firebird into JNDI and have the rest of my app get it from there.  I wish
the TC guys would let you configure a pool for the JDBCRealm.  I know ... I
know ... it's in the works.  That'll be really nice!

Thanks for your comments - I'm not sure where I'm going to turn for sure at
this point.  In the end I'll either wind up using TC stand-alone or using
mod_jk instead of mod_webapp.  I'll cross that bridge later ;)

Thanks =)

Eddie

----- Original Message -----
From: "Rick Fincher" <rn...@tbird.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 4:04 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> Hi Eddie,
>
> I use Interbasse to do what you are trying, but directly to Tomcat, so I
> know it can be done.  My server.xml entry follows.  The only thing I see
> different is that you have two forward slashes after the host name.  Is
this
> a typo?  Does this work with your other JDBC apps?  I'm accessing a
database
> on a Solaris system so Windows would be a little different.  The error
> message you are getting is from the Interbase driver so Tomcat IS finding
> interclient.jar.  It is basically saying that it is getting a bad filename
>
> The only other thing I can think of with Interbase is that you have to be
> sure that "file.gdb" has granted read authorization to "username" on your
> "member" table.
>
> <Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"
>
> driverName="interbase.interclient.Driver"
>
>
connectionURL="jdbc:interbase://myhost.mydomain.com/dbDir/databases/usersdb.
> gdb"
>
> connectionName="username"
>
> connectionPassword="password"
>
> userTable="USERS"
>
> userNameCol="USER_NAME"
>
> userCredCol="USER_PASS"
>
> userRoleTable="USER_ROLES"
>
> roleNameCol="ROLE_NAME" />
>
>
>
> Rick


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Rick Fincher <rn...@tbird.com>.
Hi Eddie,

I use Interbasse to do what you are trying, but directly to Tomcat, so I
know it can be done.  My server.xml entry follows.  The only thing I see
different is that you have two forward slashes after the host name.  Is this
a typo?  Does this work with your other JDBC apps?  I'm accessing a database
on a Solaris system so Windows would be a little different.  The error
message you are getting is from the Interbase driver so Tomcat IS finding
interclient.jar.  It is basically saying that it is getting a bad filename

The only other thing I can think of with Interbase is that you have to be
sure that "file.gdb" has granted read authorization to "username" on your
"member" table.

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="0"

driverName="interbase.interclient.Driver"

connectionURL="jdbc:interbase://myhost.mydomain.com/dbDir/databases/usersdb.
gdb"

connectionName="username"

connectionPassword="password"

userTable="USERS"

userNameCol="USER_NAME"

userCredCol="USER_PASS"

userRoleTable="USER_ROLES"

roleNameCol="ROLE_NAME" />



Rick

----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 3:26 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> But why would this be happening?  I haven't even been presented with a
> prompt at which I could enter a usename/password!  I understand what you
are
> saying - but I'm not sure ... I'm not sure =)  No, I don't really have
> another DBMS I can plug in easily.  Let me go ahead and post my realm
> definition - maybe someone will see a problem with it:
>
> <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
>              driverName="interbase.interclient.Driver"
>
connectionURL="jdbc:interbase://host//path/to/my/data/file.gdb"
>              connectionName="validuser"
>              connectionPassword="validuserpswd"
>              userTable="member"
>              userNameCol="username"
>              userCredCol="passwd"
>              userRoleTable="member_role"
>              roleNameCol="rolename"
> />
>
> Is this good?  It's nested in an Engine element (WarpEngine) which is
nested
> in a Connector element (WarpConnector) which is nested in a Service
element
> which is nested in a Server element.  Basically what I did was take the
> config file that came with Tomcat, cut out ALL of the stand-alone stuff -
> and leave the Warp stuff.  Does it sound as though I've approached this
> poorly?  It works for everything except this danged authentication!
>
> Thanks so much!
>
> Eddie
>
> ----- Original Message -----
> From: "Tim Funk" <fu...@joedog.org>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, June 18, 2002 2:22 PM
> Subject: Re: Null Pointer Exception - would you please take a look?
>
>
> > This may be to much to ask for - but are you able to get this to work
> > with a different DBMS?  On first glance, it appears you (not literally)
> > might be passing null to the JDBC driver's setString() method and the
> > JDBC driver can't handle the null value. Consequently - things explode.
> > If so - it would be JDBC driver's fault and not tomcat. (But that could
> > be subject to opinion too)
> >
> > -Tim
> >
> > Eddie Bush wrote:
> > > I'm getting really annoyed =)  It seems you people haven't actually
read
> my
> > > question thoroughly enough to actually understand what I'm doing.  The
> > > thought crosses my mind that you see the subject and then just scan
and
> put
> > > in some standard "Oh he's an idiot - he needs to do this" response.
The
> > > problem is with a JDBCRealm!  I do NOTHING to send/receive anything
> to/from
> > > the database.  I was of the understanding that Tomcat did this when I
> > > configured the realm and set up the security-constraint.
> > >
> > > While I believe my XML to be valid and correct, I will happily post it
> for
> > > inspection if someone thinks it would help.  Here is a sequence of
what
> > > happens and the actors that are involved:
> > >
> > > Actors:  Me and Tomcat
> > >
> > > Me:  Enter url of page that is protected by a security constraint into
> my
> > > browsers address bar.  Press enter.
> > > Tomcat:  Returns to the client a page that looks like:
> > >
> > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > > <HTML><HEAD>
> > > <META http-equiv=Content-Type content="text/html;
> > > charset=windows-1252"></HEAD>
> > > <BODY><PRE></PRE></BODY></HTML>
> > >
> > > (This is not what the actual page is - it's a JSP file - index.jsp -
> with
> > > much different content.  Also notice I'm not calling a servlet!  Even
if
> I
> > > were, it wouldn't make a bit of difference at this point because
Tomcat
> > > hasn't authenticated me!  This happens when Tomcat should authenticate
> me -
> > > it is NOT my coding!!!)
> > >
> > > In my server log file, I have an error that starts off as:
> > >
> > > 2002-06-17 12:29:28
> [org.apache.catalina.connector.warp.WarpRequestHandler]
> > > java.lang.NullPointerException
> > >     at interbase.interclient.PreparedStatement.setString(Unknown
Source)
> > >     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
> > >     at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> > >     at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> > >
> > > My catalina.out has no indication of anything having gone awry - it
> merely
> > > has status messages indicating that the server was started (why isn't
> there
> > > a timestamp in here?).
> > >
> > > Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so
you
> > > UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry
> but
> > > I'm frustrated by the responses I am getting - makes me wanna just
jump
> up
> > > and down and scream at the top of my lungs ... Please - I BEG of you -
> clue
> > > me in here - any thoughts why this is happening?  Again, I can post my
> XML
> > > if you think I need to.
> > >
> > > A couple of questions people have asked up to this point, along with
the
> > > answer:
> > >
> > > Q: Are you passing a null string?
> > > A: I get this when I try to visit a URL that falls under a security
> > > constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my
code.
> > >
> > > Q: Are you sure the fields in your table match what Tomcat is
expecting?
> > > A: Initially they didn't.  My fields were of length 14 and Tomcat says
> they
> > > should be 15 -- but they're varchar, so does that really matter?  I
> rebuilt
> > > the tables so that anything Tomcat uses matches exactly what the docs
> say -
> > > meaning I made my fields to be of length 15.  I still get the same
> > > response - exactly the same response.
> > >
> > > Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat
> SHOULD
> > > be able to find it - right?  Is this the appropriate spot?  Is it
> possible
> > > (and how possible?) that this is my driver?  I use this driver just
fine
> > > doing JDBC stuff all the time - no problem.
> > >
> > > Thanks for your time!
> > >
> > > Eddie
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
But why would this be happening?  I haven't even been presented with a
prompt at which I could enter a usename/password!  I understand what you are
saying - but I'm not sure ... I'm not sure =)  No, I don't really have
another DBMS I can plug in easily.  Let me go ahead and post my realm
definition - maybe someone will see a problem with it:

<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
             driverName="interbase.interclient.Driver"
             connectionURL="jdbc:interbase://host//path/to/my/data/file.gdb"
             connectionName="validuser"
             connectionPassword="validuserpswd"
             userTable="member"
             userNameCol="username"
             userCredCol="passwd"
             userRoleTable="member_role"
             roleNameCol="rolename"
/>

Is this good?  It's nested in an Engine element (WarpEngine) which is nested
in a Connector element (WarpConnector) which is nested in a Service element
which is nested in a Server element.  Basically what I did was take the
config file that came with Tomcat, cut out ALL of the stand-alone stuff -
and leave the Warp stuff.  Does it sound as though I've approached this
poorly?  It works for everything except this danged authentication!

Thanks so much!

Eddie

----- Original Message -----
From: "Tim Funk" <fu...@joedog.org>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 2:22 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> This may be to much to ask for - but are you able to get this to work
> with a different DBMS?  On first glance, it appears you (not literally)
> might be passing null to the JDBC driver's setString() method and the
> JDBC driver can't handle the null value. Consequently - things explode.
> If so - it would be JDBC driver's fault and not tomcat. (But that could
> be subject to opinion too)
>
> -Tim
>
> Eddie Bush wrote:
> > I'm getting really annoyed =)  It seems you people haven't actually read
my
> > question thoroughly enough to actually understand what I'm doing.  The
> > thought crosses my mind that you see the subject and then just scan and
put
> > in some standard "Oh he's an idiot - he needs to do this" response.  The
> > problem is with a JDBCRealm!  I do NOTHING to send/receive anything
to/from
> > the database.  I was of the understanding that Tomcat did this when I
> > configured the realm and set up the security-constraint.
> >
> > While I believe my XML to be valid and correct, I will happily post it
for
> > inspection if someone thinks it would help.  Here is a sequence of what
> > happens and the actors that are involved:
> >
> > Actors:  Me and Tomcat
> >
> > Me:  Enter url of page that is protected by a security constraint into
my
> > browsers address bar.  Press enter.
> > Tomcat:  Returns to the client a page that looks like:
> >
> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> > <HTML><HEAD>
> > <META http-equiv=Content-Type content="text/html;
> > charset=windows-1252"></HEAD>
> > <BODY><PRE></PRE></BODY></HTML>
> >
> > (This is not what the actual page is - it's a JSP file - index.jsp -
with
> > much different content.  Also notice I'm not calling a servlet!  Even if
I
> > were, it wouldn't make a bit of difference at this point because Tomcat
> > hasn't authenticated me!  This happens when Tomcat should authenticate
me -
> > it is NOT my coding!!!)
> >
> > In my server log file, I have an error that starts off as:
> >
> > 2002-06-17 12:29:28
[org.apache.catalina.connector.warp.WarpRequestHandler]
> > java.lang.NullPointerException
> >     at interbase.interclient.PreparedStatement.setString(Unknown Source)
> >     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
> >     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> >     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> >
> > My catalina.out has no indication of anything having gone awry - it
merely
> > has status messages indicating that the server was started (why isn't
there
> > a timestamp in here?).
> >
> > Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so you
> > UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry
but
> > I'm frustrated by the responses I am getting - makes me wanna just jump
up
> > and down and scream at the top of my lungs ... Please - I BEG of you -
clue
> > me in here - any thoughts why this is happening?  Again, I can post my
XML
> > if you think I need to.
> >
> > A couple of questions people have asked up to this point, along with the
> > answer:
> >
> > Q: Are you passing a null string?
> > A: I get this when I try to visit a URL that falls under a security
> > constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my code.
> >
> > Q: Are you sure the fields in your table match what Tomcat is expecting?
> > A: Initially they didn't.  My fields were of length 14 and Tomcat says
they
> > should be 15 -- but they're varchar, so does that really matter?  I
rebuilt
> > the tables so that anything Tomcat uses matches exactly what the docs
say -
> > meaning I made my fields to be of length 15.  I still get the same
> > response - exactly the same response.
> >
> > Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat
SHOULD
> > be able to find it - right?  Is this the appropriate spot?  Is it
possible
> > (and how possible?) that this is my driver?  I use this driver just fine
> > doing JDBC stuff all the time - no problem.
> >
> > Thanks for your time!
> >
> > Eddie
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Tim Funk <fu...@joedog.org>.
This may be to much to ask for - but are you able to get this to work 
with a different DBMS?  On first glance, it appears you (not literally) 
might be passing null to the JDBC driver's setString() method and the 
JDBC driver can't handle the null value. Consequently - things explode. 
If so - it would be JDBC driver's fault and not tomcat. (But that could 
be subject to opinion too)

-Tim

Eddie Bush wrote:
> I'm getting really annoyed =)  It seems you people haven't actually read my
> question thoroughly enough to actually understand what I'm doing.  The
> thought crosses my mind that you see the subject and then just scan and put
> in some standard "Oh he's an idiot - he needs to do this" response.  The
> problem is with a JDBCRealm!  I do NOTHING to send/receive anything to/from
> the database.  I was of the understanding that Tomcat did this when I
> configured the realm and set up the security-constraint.
> 
> While I believe my XML to be valid and correct, I will happily post it for
> inspection if someone thinks it would help.  Here is a sequence of what
> happens and the actors that are involved:
> 
> Actors:  Me and Tomcat
> 
> Me:  Enter url of page that is protected by a security constraint into my
> browsers address bar.  Press enter.
> Tomcat:  Returns to the client a page that looks like:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=windows-1252"></HEAD>
> <BODY><PRE></PRE></BODY></HTML>
> 
> (This is not what the actual page is - it's a JSP file - index.jsp - with
> much different content.  Also notice I'm not calling a servlet!  Even if I
> were, it wouldn't make a bit of difference at this point because Tomcat
> hasn't authenticated me!  This happens when Tomcat should authenticate me -
> it is NOT my coding!!!)
> 
> In my server log file, I have an error that starts off as:
> 
> 2002-06-17 12:29:28 [org.apache.catalina.connector.warp.WarpRequestHandler]
> java.lang.NullPointerException
>     at interbase.interclient.PreparedStatement.setString(Unknown Source)
>     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> 
> My catalina.out has no indication of anything having gone awry - it merely
> has status messages indicating that the server was started (why isn't there
> a timestamp in here?).
> 
> Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so you
> UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry but
> I'm frustrated by the responses I am getting - makes me wanna just jump up
> and down and scream at the top of my lungs ... Please - I BEG of you - clue
> me in here - any thoughts why this is happening?  Again, I can post my XML
> if you think I need to.
> 
> A couple of questions people have asked up to this point, along with the
> answer:
> 
> Q: Are you passing a null string?
> A: I get this when I try to visit a URL that falls under a security
> constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my code.
> 
> Q: Are you sure the fields in your table match what Tomcat is expecting?
> A: Initially they didn't.  My fields were of length 14 and Tomcat says they
> should be 15 -- but they're varchar, so does that really matter?  I rebuilt
> the tables so that anything Tomcat uses matches exactly what the docs say -
> meaning I made my fields to be of length 15.  I still get the same
> response - exactly the same response.
> 
> Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat SHOULD
> be able to find it - right?  Is this the appropriate spot?  Is it possible
> (and how possible?) that this is my driver?  I use this driver just fine
> doing JDBC stuff all the time - no problem.
> 
> Thanks for your time!
> 
> Eddie


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
I think I'm about to that point.  This is reeeeally starting to peeve me
off.

----- Original Message -----
From: "Markus Kirsten" <ma...@iped.vxu.se>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 2:27 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> Hi Eddie,
> Have you tried accessing Tomcat directly and not going through Apache? I
> was having too much trouble using mod_webapp together with Apache and
> Tomcat due to that form-based authentication didn't work through Apache
> but it did directly with Tomcat.
>
> Maybe we should all use mod_jk instead. Is anybody running it on Mac OS
> X BTW?
>
>
> Markus
>
> On tisdag, juni 18, 2002, at 09:15 , Eddie Bush wrote:
>
> > Ok, I just bumped it down to a MemoryRealm and tried that - and it works
> > just fine.  What gives with the JDBCRealm?  I really need to get this
> > going!
> >
> > Thank you for your input!
> >
> > Eddie
> >
> > ----- Original Message -----
> > From: "Eddie Bush" <ek...@swbell.net>
> > To: "Tomcat Users List" <to...@jakarta.apache.org>;
> > <au...@codemagi.com>
> > Sent: Tuesday, June 18, 2002 1:57 PM
> > Subject: Re: Null Pointer Exception - would you please take a look?
> >
> >
> >> I'm getting really annoyed =)  It seems you people haven't actually
> >> read
> > my
> >> question thoroughly enough to actually understand what I'm doing.  The
> >> thought crosses my mind that you see the subject and then just scan and
> > put
> >> in some standard "Oh he's an idiot - he needs to do this" response.
> >> The
> >> problem is with a JDBCRealm!  I do NOTHING to send/receive anything
> > to/from
> >> the database.  I was of the understanding that Tomcat did this when I
> >> configured the realm and set up the security-constraint.
> >>
> >> While I believe my XML to be valid and correct, I will happily post it
> >> for
> >> inspection if someone thinks it would help.  Here is a sequence of what
> >> happens and the actors that are involved:
> >>
> >> Actors:  Me and Tomcat
> >>
> >> Me:  Enter url of page that is protected by a security constraint into
> >> my
> >> browsers address bar.  Press enter.
> >> Tomcat:  Returns to the client a page that looks like:
> >>
> >> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> >> <HTML><HEAD>
> >> <META http-equiv=Content-Type content="text/html;
> >> charset=windows-1252"></HEAD>
> >> <BODY><PRE></PRE></BODY></HTML>
> >>
> >> (This is not what the actual page is - it's a JSP file - index.jsp -
> >> with
> >> much different content.  Also notice I'm not calling a servlet!  Even
> >> if I
> >> were, it wouldn't make a bit of difference at this point because Tomcat
> >> hasn't authenticated me!  This happens when Tomcat should authenticate
> > me -
> >> it is NOT my coding!!!)
> >>
> >> In my server log file, I have an error that starts off as:
> >>
> >> 2002-06-17 12:29:28
> > [org.apache.catalina.connector.warp.WarpRequestHandler]
> >> java.lang.NullPointerException
> >>     at interbase.interclient.PreparedStatement.setString(Unknown
> >> Source)
> >>     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
> >>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> >>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> >>
> >> My catalina.out has no indication of anything having gone awry - it
> >> merely
> >> has status messages indicating that the server was started (why isn't
> > there
> >> a timestamp in here?).
> >>
> >> Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so
> >> you
> >> UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry
> >> but
> >> I'm frustrated by the responses I am getting - makes me wanna just
> >> jump up
> >> and down and scream at the top of my lungs ... Please - I BEG of you -
> > clue
> >> me in here - any thoughts why this is happening?  Again, I can post my
> >> XML
> >> if you think I need to.
> >>
> >> A couple of questions people have asked up to this point, along with
> >> the
> >> answer:
> >>
> >> Q: Are you passing a null string?
> >> A: I get this when I try to visit a URL that falls under a security
> >> constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my
> >> code.
> >>
> >> Q: Are you sure the fields in your table match what Tomcat is
> >> expecting?
> >> A: Initially they didn't.  My fields were of length 14 and Tomcat says
> > they
> >> should be 15 -- but they're varchar, so does that really matter?  I
> > rebuilt
> >> the tables so that anything Tomcat uses matches exactly what the docs
> > say -
> >> meaning I made my fields to be of length 15.  I still get the same
> >> response - exactly the same response.
> >>
> >> Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat
> > SHOULD
> >> be able to find it - right?  Is this the appropriate spot?  Is it
> >> possible
> >> (and how possible?) that this is my driver?  I use this driver just
> >> fine
> >> doing JDBC stuff all the time - no problem.
> >>
> >> Thanks for your time!
> >>
> >> Eddie
> >>
> >> ----- Original Message -----
> >> From: "August Detlefsen" <au...@yahoo.com>
> >> To: "Tomcat Users List" <to...@jakarta.apache.org>
> >> Sent: Tuesday, June 18, 2002 1:24 PM
> >> Subject: Re: Null Pointer Exception - would you please take a look?
> >>
> >>
> >>> If you are trying to insert a NULL into a NOT NULL column (or are
> >>> trying to insert special chars or the String is too long), you should
> >>> get a SQLException, not a NullPointerException.
> >>>
> >>> You should recheck that you are actually getting a valid Connection
> >>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> >> For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >>
> >
> >
> > --
> > To unsubscribe, e-mail:   <mailto:tomcat-user-
> > unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail: <mailto:tomcat-user-
> > help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Markus Kirsten <ma...@iped.vxu.se>.
Hi Eddie,
Have you tried accessing Tomcat directly and not going through Apache? I 
was having too much trouble using mod_webapp together with Apache and 
Tomcat due to that form-based authentication didn't work through Apache 
but it did directly with Tomcat.

Maybe we should all use mod_jk instead. Is anybody running it on Mac OS 
X BTW?


Markus

On tisdag, juni 18, 2002, at 09:15 , Eddie Bush wrote:

> Ok, I just bumped it down to a MemoryRealm and tried that - and it works
> just fine.  What gives with the JDBCRealm?  I really need to get this 
> going!
>
> Thank you for your input!
>
> Eddie
>
> ----- Original Message -----
> From: "Eddie Bush" <ek...@swbell.net>
> To: "Tomcat Users List" <to...@jakarta.apache.org>;
> <au...@codemagi.com>
> Sent: Tuesday, June 18, 2002 1:57 PM
> Subject: Re: Null Pointer Exception - would you please take a look?
>
>
>> I'm getting really annoyed =)  It seems you people haven't actually 
>> read
> my
>> question thoroughly enough to actually understand what I'm doing.  The
>> thought crosses my mind that you see the subject and then just scan and
> put
>> in some standard "Oh he's an idiot - he needs to do this" response.  
>> The
>> problem is with a JDBCRealm!  I do NOTHING to send/receive anything
> to/from
>> the database.  I was of the understanding that Tomcat did this when I
>> configured the realm and set up the security-constraint.
>>
>> While I believe my XML to be valid and correct, I will happily post it 
>> for
>> inspection if someone thinks it would help.  Here is a sequence of what
>> happens and the actors that are involved:
>>
>> Actors:  Me and Tomcat
>>
>> Me:  Enter url of page that is protected by a security constraint into 
>> my
>> browsers address bar.  Press enter.
>> Tomcat:  Returns to the client a page that looks like:
>>
>> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>> <HTML><HEAD>
>> <META http-equiv=Content-Type content="text/html;
>> charset=windows-1252"></HEAD>
>> <BODY><PRE></PRE></BODY></HTML>
>>
>> (This is not what the actual page is - it's a JSP file - index.jsp - 
>> with
>> much different content.  Also notice I'm not calling a servlet!  Even 
>> if I
>> were, it wouldn't make a bit of difference at this point because Tomcat
>> hasn't authenticated me!  This happens when Tomcat should authenticate
> me -
>> it is NOT my coding!!!)
>>
>> In my server log file, I have an error that starts off as:
>>
>> 2002-06-17 12:29:28
> [org.apache.catalina.connector.warp.WarpRequestHandler]
>> java.lang.NullPointerException
>>     at interbase.interclient.PreparedStatement.setString(Unknown 
>> Source)
>>     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
>>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>>
>> My catalina.out has no indication of anything having gone awry - it 
>> merely
>> has status messages indicating that the server was started (why isn't
> there
>> a timestamp in here?).
>>
>> Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so 
>> you
>> UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry 
>> but
>> I'm frustrated by the responses I am getting - makes me wanna just 
>> jump up
>> and down and scream at the top of my lungs ... Please - I BEG of you -
> clue
>> me in here - any thoughts why this is happening?  Again, I can post my 
>> XML
>> if you think I need to.
>>
>> A couple of questions people have asked up to this point, along with 
>> the
>> answer:
>>
>> Q: Are you passing a null string?
>> A: I get this when I try to visit a URL that falls under a security
>> constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my 
>> code.
>>
>> Q: Are you sure the fields in your table match what Tomcat is 
>> expecting?
>> A: Initially they didn't.  My fields were of length 14 and Tomcat says
> they
>> should be 15 -- but they're varchar, so does that really matter?  I
> rebuilt
>> the tables so that anything Tomcat uses matches exactly what the docs
> say -
>> meaning I made my fields to be of length 15.  I still get the same
>> response - exactly the same response.
>>
>> Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat
> SHOULD
>> be able to find it - right?  Is this the appropriate spot?  Is it 
>> possible
>> (and how possible?) that this is my driver?  I use this driver just 
>> fine
>> doing JDBC stuff all the time - no problem.
>>
>> Thanks for your time!
>>
>> Eddie
>>
>> ----- Original Message -----
>> From: "August Detlefsen" <au...@yahoo.com>
>> To: "Tomcat Users List" <to...@jakarta.apache.org>
>> Sent: Tuesday, June 18, 2002 1:24 PM
>> Subject: Re: Null Pointer Exception - would you please take a look?
>>
>>
>>> If you are trying to insert a NULL into a NOT NULL column (or are
>>> trying to insert special chars or the String is too long), you should
>>> get a SQLException, not a NullPointerException.
>>>
>>> You should recheck that you are actually getting a valid Connection
>>
>>
>>
>> --
>> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
>> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>>
>
>
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-
> unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-
> help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
Ok, I just bumped it down to a MemoryRealm and tried that - and it works
just fine.  What gives with the JDBCRealm?  I really need to get this going!

Thank you for your input!

Eddie

----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>;
<au...@codemagi.com>
Sent: Tuesday, June 18, 2002 1:57 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> I'm getting really annoyed =)  It seems you people haven't actually read
my
> question thoroughly enough to actually understand what I'm doing.  The
> thought crosses my mind that you see the subject and then just scan and
put
> in some standard "Oh he's an idiot - he needs to do this" response.  The
> problem is with a JDBCRealm!  I do NOTHING to send/receive anything
to/from
> the database.  I was of the understanding that Tomcat did this when I
> configured the realm and set up the security-constraint.
>
> While I believe my XML to be valid and correct, I will happily post it for
> inspection if someone thinks it would help.  Here is a sequence of what
> happens and the actors that are involved:
>
> Actors:  Me and Tomcat
>
> Me:  Enter url of page that is protected by a security constraint into my
> browsers address bar.  Press enter.
> Tomcat:  Returns to the client a page that looks like:
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> <HTML><HEAD>
> <META http-equiv=Content-Type content="text/html;
> charset=windows-1252"></HEAD>
> <BODY><PRE></PRE></BODY></HTML>
>
> (This is not what the actual page is - it's a JSP file - index.jsp - with
> much different content.  Also notice I'm not calling a servlet!  Even if I
> were, it wouldn't make a bit of difference at this point because Tomcat
> hasn't authenticated me!  This happens when Tomcat should authenticate
me -
> it is NOT my coding!!!)
>
> In my server log file, I have an error that starts off as:
>
> 2002-06-17 12:29:28
[org.apache.catalina.connector.warp.WarpRequestHandler]
> java.lang.NullPointerException
>     at interbase.interclient.PreparedStatement.setString(Unknown Source)
>     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>
> My catalina.out has no indication of anything having gone awry - it merely
> has status messages indicating that the server was started (why isn't
there
> a timestamp in here?).
>
> Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so you
> UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry but
> I'm frustrated by the responses I am getting - makes me wanna just jump up
> and down and scream at the top of my lungs ... Please - I BEG of you -
clue
> me in here - any thoughts why this is happening?  Again, I can post my XML
> if you think I need to.
>
> A couple of questions people have asked up to this point, along with the
> answer:
>
> Q: Are you passing a null string?
> A: I get this when I try to visit a URL that falls under a security
> constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my code.
>
> Q: Are you sure the fields in your table match what Tomcat is expecting?
> A: Initially they didn't.  My fields were of length 14 and Tomcat says
they
> should be 15 -- but they're varchar, so does that really matter?  I
rebuilt
> the tables so that anything Tomcat uses matches exactly what the docs
say -
> meaning I made my fields to be of length 15.  I still get the same
> response - exactly the same response.
>
> Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat
SHOULD
> be able to find it - right?  Is this the appropriate spot?  Is it possible
> (and how possible?) that this is my driver?  I use this driver just fine
> doing JDBC stuff all the time - no problem.
>
> Thanks for your time!
>
> Eddie
>
> ----- Original Message -----
> From: "August Detlefsen" <au...@yahoo.com>
> To: "Tomcat Users List" <to...@jakarta.apache.org>
> Sent: Tuesday, June 18, 2002 1:24 PM
> Subject: Re: Null Pointer Exception - would you please take a look?
>
>
> > If you are trying to insert a NULL into a NOT NULL column (or are
> > trying to insert special chars or the String is too long), you should
> > get a SQLException, not a NullPointerException.
> >
> > You should recheck that you are actually getting a valid Connection
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
----- Original Message -----
From: "John Gregg" <jo...@techarch.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
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
educated
> 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
url
> (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
the
> 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
there's
> an issue with web.xml not doing what you think it should do but I can't
put
> 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>
  <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
- <security-constraint>
- <web-resource-collection>
  <web-resource-name>admin</web-resource-name>
  <url-pattern>/*</url-pattern>
  </web-resource-collection>
- <auth-constraint>
  <role-name>manager</role-name>
  </auth-constraint>
- <user-data-constraint>
  <transport-guarantee>NONE</transport-guarantee>
  </user-data-constraint>
  </security-constraint>
- <login-config>
  <auth-method>BASIC</auth-method>
  <realm-name>Authentication Test</realm-name>
  </login-config>
- <security-role>
  <role-name>manager</role-name>
  </security-role>
  </web-app>

> 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.

Sincerely,

Eddie



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Null Pointer Exception - would you please take a look?

Posted by John Gregg <jo...@techarch.com>.
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.

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 educated
guess is that the String param is null.  The username is the parameter
there, BTW.  Look at the Tomcat source.

What puzzles me about your situation is that you say you're accessing a url
(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 the
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 there's
an issue with web.xml not doing what you think it should do but I can't put
my finger on what it is.  Post your url and web.xml contents.

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

john

-----Original Message-----
From:
tomcat-user-return-23060-john.gregg=techarch.com@jakarta.apache.org
[mailto:tomcat-user-return-23060-john.gregg=techarch.com@jakarta.apache.
org]On Behalf Of Eddie Bush
Sent: Tuesday, June 18, 2002 1:57 PM
To: Tomcat Users List; augustd@codemagi.com
Subject: Re: Null Pointer Exception - would you please take a look?


I'm getting really annoyed =)  It seems you people haven't actually read my
question thoroughly enough to actually understand what I'm doing.  The
thought crosses my mind that you see the subject and then just scan and put
in some standard "Oh he's an idiot - he needs to do this" response.  The
problem is with a JDBCRealm!  I do NOTHING to send/receive anything to/from
the database.  I was of the understanding that Tomcat did this when I
configured the realm and set up the security-constraint.

While I believe my XML to be valid and correct, I will happily post it for
inspection if someone thinks it would help.  Here is a sequence of what
happens and the actors that are involved:

Actors:  Me and Tomcat

Me:  Enter url of page that is protected by a security constraint into my
browsers address bar.  Press enter.
Tomcat:  Returns to the client a page that looks like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY><PRE></PRE></BODY></HTML>

(This is not what the actual page is - it's a JSP file - index.jsp - with
much different content.  Also notice I'm not calling a servlet!  Even if I
were, it wouldn't make a bit of difference at this point because Tomcat
hasn't authenticated me!  This happens when Tomcat should authenticate me -
it is NOT my coding!!!)

In my server log file, I have an error that starts off as:

2002-06-17 12:29:28 [org.apache.catalina.connector.warp.WarpRequestHandler]
java.lang.NullPointerException
    at interbase.interclient.PreparedStatement.setString(Unknown Source)
    at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)

My catalina.out has no indication of anything having gone awry - it merely
has status messages indicating that the server was started (why isn't there
a timestamp in here?).

Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so you
UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry but
I'm frustrated by the responses I am getting - makes me wanna just jump up
and down and scream at the top of my lungs ... Please - I BEG of you - clue
me in here - any thoughts why this is happening?  Again, I can post my XML
if you think I need to.

A couple of questions people have asked up to this point, along with the
answer:

Q: Are you passing a null string?
A: I get this when I try to visit a URL that falls under a security
constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my code.

Q: Are you sure the fields in your table match what Tomcat is expecting?
A: Initially they didn't.  My fields were of length 14 and Tomcat says they
should be 15 -- but they're varchar, so does that really matter?  I rebuilt
the tables so that anything Tomcat uses matches exactly what the docs say -
meaning I made my fields to be of length 15.  I still get the same
response - exactly the same response.

Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat SHOULD
be able to find it - right?  Is this the appropriate spot?  Is it possible
(and how possible?) that this is my driver?  I use this driver just fine
doing JDBC stuff all the time - no problem.

Thanks for your time!

Eddie

----- Original Message -----
From: "August Detlefsen" <au...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 1:24 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> If you are trying to insert a NULL into a NOT NULL column (or are
> trying to insert special chars or the String is too long), you should
> get a SQLException, not a NullPointerException.
>
> You should recheck that you are actually getting a valid Connection



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
I'm getting really annoyed =)  It seems you people haven't actually read my
question thoroughly enough to actually understand what I'm doing.  The
thought crosses my mind that you see the subject and then just scan and put
in some standard "Oh he's an idiot - he needs to do this" response.  The
problem is with a JDBCRealm!  I do NOTHING to send/receive anything to/from
the database.  I was of the understanding that Tomcat did this when I
configured the realm and set up the security-constraint.

While I believe my XML to be valid and correct, I will happily post it for
inspection if someone thinks it would help.  Here is a sequence of what
happens and the actors that are involved:

Actors:  Me and Tomcat

Me:  Enter url of page that is protected by a security constraint into my
browsers address bar.  Press enter.
Tomcat:  Returns to the client a page that looks like:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html;
charset=windows-1252"></HEAD>
<BODY><PRE></PRE></BODY></HTML>

(This is not what the actual page is - it's a JSP file - index.jsp - with
much different content.  Also notice I'm not calling a servlet!  Even if I
were, it wouldn't make a bit of difference at this point because Tomcat
hasn't authenticated me!  This happens when Tomcat should authenticate me -
it is NOT my coding!!!)

In my server log file, I have an error that starts off as:

2002-06-17 12:29:28 [org.apache.catalina.connector.warp.WarpRequestHandler]
java.lang.NullPointerException
    at interbase.interclient.PreparedStatement.setString(Unknown Source)
    at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)

My catalina.out has no indication of anything having gone awry - it merely
has status messages indicating that the server was started (why isn't there
a timestamp in here?).

Any ideas?  Thank you for having actually READ THE ENTIRE MESSAGE so you
UNDERSTAND my problem before having issued a reply =)  Ack!  I'm sorry but
I'm frustrated by the responses I am getting - makes me wanna just jump up
and down and scream at the top of my lungs ... Please - I BEG of you - clue
me in here - any thoughts why this is happening?  Again, I can post my XML
if you think I need to.

A couple of questions people have asked up to this point, along with the
answer:

Q: Are you passing a null string?
A: I get this when I try to visit a URL that falls under a security
constraint.  It's a JDBCRealm.  Tomcat handles this - it is not my code.

Q: Are you sure the fields in your table match what Tomcat is expecting?
A: Initially they didn't.  My fields were of length 14 and Tomcat says they
should be 15 -- but they're varchar, so does that really matter?  I rebuilt
the tables so that anything Tomcat uses matches exactly what the docs say -
meaning I made my fields to be of length 15.  I still get the same
response - exactly the same response.

Is this the JDBCRealm?  I put my DB driver in common/lib - so Tomcat SHOULD
be able to find it - right?  Is this the appropriate spot?  Is it possible
(and how possible?) that this is my driver?  I use this driver just fine
doing JDBC stuff all the time - no problem.

Thanks for your time!

Eddie

----- Original Message -----
From: "August Detlefsen" <au...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, June 18, 2002 1:24 PM
Subject: Re: Null Pointer Exception - would you please take a look?


> If you are trying to insert a NULL into a NOT NULL column (or are
> trying to insert special chars or the String is too long), you should
> get a SQLException, not a NullPointerException.
>
> You should recheck that you are actually getting a valid Connection



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by August Detlefsen <au...@yahoo.com>.
If you are trying to insert a NULL into a NOT NULL column (or are
trying to insert special chars or the String is too long), you should
get a SQLException, not a NullPointerException. 

You should recheck that you are actually getting a valid Connection



--- Eddie Bush <ek...@swbell.net> wrote:
> There are also no nulls in that column.
> 
> ----- Original Message -----
> From: "Eddie Bush" <ek...@swbell.net>
> To: "Tomcat Users List" <to...@jakarta.apache.org>;
> <jo...@techarch.com>
> Sent: Tuesday, June 18, 2002 8:09 AM
> Subject: Re: Null Pointer Exception - would you please take a look?
> 
> 
> >
> > ----- Original Message -----
> > From: "John Gregg" <jo...@techarch.com>
> >
> >
> > > Is the String you're setting null?  I can't say how your driver
> handles
> > that
> > > case, but maybe it doesn't like it.  The jdk javadocs don't
> mention it.
> > Is
> > > the String too big for the column, does it have weird characters
> in it?
> > If
> >
> > There are no special characters in that  field, although I never
> imagined
> > that the field size might cause a problem.  I will check that.
> >
> > Thank You!
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
There are also no nulls in that column.

----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Tomcat Users List" <to...@jakarta.apache.org>;
<jo...@techarch.com>
Sent: Tuesday, June 18, 2002 8:09 AM
Subject: Re: Null Pointer Exception - would you please take a look?


>
> ----- Original Message -----
> From: "John Gregg" <jo...@techarch.com>
>
>
> > Is the String you're setting null?  I can't say how your driver handles
> that
> > case, but maybe it doesn't like it.  The jdk javadocs don't mention it.
> Is
> > the String too big for the column, does it have weird characters in it?
> If
>
> There are no special characters in that  field, although I never imagined
> that the field size might cause a problem.  I will check that.
>
> Thank You!
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
----- Original Message -----
From: "John Gregg" <jo...@techarch.com>


> Is the String you're setting null?  I can't say how your driver handles
that
> case, but maybe it doesn't like it.  The jdk javadocs don't mention it.
Is
> the String too big for the column, does it have weird characters in it?
If

There are no special characters in that  field, although I never imagined
that the field size might cause a problem.  I will check that.

Thank You!



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
I'm not exactly sure what's going on.  It happens when I try to visit an
area of a site that has a security constraint.  My user authentication
database is in a RDBMS, and I use the JDBC realm to connect to it.  I'm
never supplied with a prompt to login.

----- Original Message -----
From: "John Gregg" <jo...@techarch.com>
To: "'Tomcat Users List'" <to...@jakarta.apache.org>
Sent: Monday, June 17, 2002 5:38 PM
Subject: RE: Null Pointer Exception - would you please take a look?


> Is the String you're setting null?  I can't say how your driver handles
that
> case, but maybe it doesn't like it.  The jdk javadocs don't mention it.
Is
> the String too big for the column, does it have weird characters in it?
If
> you can turn on debugging for the driver, try that.  If you have the
source,
> recompile with debugging on and run in a debugger.  If you're desperate
> enough, decompile the bytecode, recompile with debugging on, and run it in
> the debugger.  You didn't hear it from me.
>
> john
>
>
> -----Original Message-----
> From:
> tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.org
> [mailto:tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.
> org]On Behalf Of Eddie Bush
> Sent: Monday, June 17, 2002 5:18 PM
> To: Tomcat Users Mailing List
> Subject: Null Pointer Exception - would you please take a look?
>
>
> I'm running Tomcat 4.0.1, InterBase 6 Super Server, and Apache 1.3.22.
>
> Everything works super, until I throw in a JDBC realm and try to connect
to
> an application protected by a security constraint.  When I do, I get the
> following exception in my server log:
>
> 2002-06-17 12:29:28
[org.apache.catalina.connector.warp.WarpRequestHandler]
> java.lang.NullPointerException
>     at interbase.interclient.PreparedStatement.setString(Unknown Source)
>     at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>     at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>
> ... and it continues.  I hate to paste it all unless it's necessary to do
> so.
>
> My thought was that someone may have experienced this - or that it may be
a
> known issue.  I checked the docs to ensure that my driver implements
> PreparedStatement and setString() ... and it does.  It's a JDBC 1.0 driver
> though.
>
> What would be the recommended course of action?  I'm not sure what's going
> on here for certain, and that's why I'm posting.
>
> Thanks in Advance!
>
> Eddie
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Null Pointer Exception - would you please take a look?

Posted by Eddie Bush <ek...@swbell.net>.
Alas, I do not have code to the JDBCRealm =(

I figured that this would be a cut-and-dried problem -- either the JDBCRealm
implementation or perhaps my driver behaving poorly.  In either case, I
figured someone would be able to tell right off my my description, but
perhaps I described the circumstance poorly.

It happens when I visit a page that has a security constraint.  I'm never
offered a login dialog.  I'm using BASIC authentication - no SSL --
transport-guarantee is NONE.  I'm just trying to get the BASIC auth down and
then move on to configuring SSL and doing it properly via form-based login.

Thanks!

----- Original Message -----
From: "August Detlefsen" <au...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>;
<jo...@techarch.com>
Sent: Monday, June 17, 2002 6:14 PM
Subject: RE: Null Pointer Exception - would you please take a look?


> Are you sure you are actually getting a Connection?
> Are you sure that your PreparedStatement itself is not null?
>
> Can you post the offending code?
>
>
>
> --- John Gregg <jo...@techarch.com> wrote:
> > Is the String you're setting null?  I can't say how your driver
> > handles that
> > case, but maybe it doesn't like it.  The jdk javadocs don't mention
> > it.  Is
> > the String too big for the column, does it have weird characters in
> > it?  If
> > you can turn on debugging for the driver, try that.  If you have the
> > source,
> > recompile with debugging on and run in a debugger.  If you're
> > desperate
> > enough, decompile the bytecode, recompile with debugging on, and run
> > it in
> > the debugger.  You didn't hear it from me.
> >
> > john
> >
> >
> > -----Original Message-----
> > From:
> > tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.org
> >
> [mailto:tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.
> > org]On Behalf Of Eddie Bush
> > Sent: Monday, June 17, 2002 5:18 PM
> > To: Tomcat Users Mailing List
> > Subject: Null Pointer Exception - would you please take a look?
> >
> >
> > I'm running Tomcat 4.0.1, InterBase 6 Super Server, and Apache
> > 1.3.22.
> >
> > Everything works super, until I throw in a JDBC realm and try to
> > connect to
> > an application protected by a security constraint.  When I do, I get
> > the
> > following exception in my server log:
> >
> > 2002-06-17 12:29:28
> > [org.apache.catalina.connector.warp.WarpRequestHandler]
> > java.lang.NullPointerException
> >     at interbase.interclient.PreparedStatement.setString(Unknown
> > Source)
> >     at
> > org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
> >     at
> > org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> >     at
> > org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> >
> > ... and it continues.  I hate to paste it all unless it's necessary
> > to do
> > so.
> >
> > My thought was that someone may have experienced this - or that it
> > may be a
> > known issue.  I checked the docs to ensure that my driver implements
> > PreparedStatement and setString() ... and it does.  It's a JDBC 1.0
> > driver
> > though.
> >
> > What would be the recommended course of action?  I'm not sure what's
> > going
> > on here for certain, and that's why I'm posting.
> >
> > Thanks in Advance!
> >
> > Eddie
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Null Pointer Exception - would you please take a look?

Posted by August Detlefsen <au...@yahoo.com>.
Are you sure you are actually getting a Connection? 
Are you sure that your PreparedStatement itself is not null? 

Can you post the offending code? 



--- John Gregg <jo...@techarch.com> wrote:
> Is the String you're setting null?  I can't say how your driver
> handles that
> case, but maybe it doesn't like it.  The jdk javadocs don't mention
> it.  Is
> the String too big for the column, does it have weird characters in
> it?  If
> you can turn on debugging for the driver, try that.  If you have the
> source,
> recompile with debugging on and run in a debugger.  If you're
> desperate
> enough, decompile the bytecode, recompile with debugging on, and run
> it in
> the debugger.  You didn't hear it from me.
> 
> john
> 
> 
> -----Original Message-----
> From:
> tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.org
>
[mailto:tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.
> org]On Behalf Of Eddie Bush
> Sent: Monday, June 17, 2002 5:18 PM
> To: Tomcat Users Mailing List
> Subject: Null Pointer Exception - would you please take a look?
> 
> 
> I'm running Tomcat 4.0.1, InterBase 6 Super Server, and Apache
> 1.3.22.
> 
> Everything works super, until I throw in a JDBC realm and try to
> connect to
> an application protected by a security constraint.  When I do, I get
> the
> following exception in my server log:
> 
> 2002-06-17 12:29:28
> [org.apache.catalina.connector.warp.WarpRequestHandler]
> java.lang.NullPointerException
>     at interbase.interclient.PreparedStatement.setString(Unknown
> Source)
>     at
> org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
>     at
> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
>     at
> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
> 
> ... and it continues.  I hate to paste it all unless it's necessary
> to do
> so.
> 
> My thought was that someone may have experienced this - or that it
> may be a
> known issue.  I checked the docs to ensure that my driver implements
> PreparedStatement and setString() ... and it does.  It's a JDBC 1.0
> driver
> though.
> 
> What would be the recommended course of action?  I'm not sure what's
> going
> on here for certain, and that's why I'm posting.
> 
> Thanks in Advance!
> 
> Eddie
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Null Pointer Exception - would you please take a look?

Posted by John Gregg <jo...@techarch.com>.
Is the String you're setting null?  I can't say how your driver handles that
case, but maybe it doesn't like it.  The jdk javadocs don't mention it.  Is
the String too big for the column, does it have weird characters in it?  If
you can turn on debugging for the driver, try that.  If you have the source,
recompile with debugging on and run in a debugger.  If you're desperate
enough, decompile the bytecode, recompile with debugging on, and run it in
the debugger.  You didn't hear it from me.

john


-----Original Message-----
From:
tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.org
[mailto:tomcat-user-return-22966-john.gregg=techarch.com@jakarta.apache.
org]On Behalf Of Eddie Bush
Sent: Monday, June 17, 2002 5:18 PM
To: Tomcat Users Mailing List
Subject: Null Pointer Exception - would you please take a look?


I'm running Tomcat 4.0.1, InterBase 6 Super Server, and Apache 1.3.22.

Everything works super, until I throw in a JDBC realm and try to connect to
an application protected by a security constraint.  When I do, I get the
following exception in my server log:

2002-06-17 12:29:28 [org.apache.catalina.connector.warp.WarpRequestHandler]
java.lang.NullPointerException
    at interbase.interclient.PreparedStatement.setString(Unknown Source)
    at org.apache.catalina.realm.JDBCRealm.credentials(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)
    at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java)

... and it continues.  I hate to paste it all unless it's necessary to do
so.

My thought was that someone may have experienced this - or that it may be a
known issue.  I checked the docs to ensure that my driver implements
PreparedStatement and setString() ... and it does.  It's a JDBC 1.0 driver
though.

What would be the recommended course of action?  I'm not sure what's going
on here for certain, and that's why I'm posting.

Thanks in Advance!

Eddie




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>