JDBC Authentication Broken in 3.2.3?

2001-07-17 Thread Michael P. McCutcheon



I've been fighting with the JDBC authentication in 
3.2.2 and 3.2.3 using Windows 2000, MySQL 3.23.39, the mm-mysql 2.0.6 drivers 
and JDK 1.3.1.  I just can't get it to work.  I get the messages in 
the console:
 
2001-07-17 15:21:20 - ContextManager: JDBCRealm: 
Starting JDBCRealm, trying to acquire JDBC Driver class and DB 
Connection2001-07-17 15:21:21 - ContextManager: JDBCRealm: JDBCRealm has 
been started succesfully2001-07-17 15:21:22 - PoolTcpConnector: Starting 
HttpConnectionHandler on 802001-07-17 15:21:22 - PoolTcpConnector: Starting 
Ajp12ConnectionHandler on 80072001-07-17 15:21:31 - ContextManager: 
JDBCRealm: The database connection is null or was found to be closed. Trying to 
re-open it.2001-07-17 15:21:31 - ContextManager: JDBCRealm: 
JDBCRealm.authenticate: SELECT user_pass FROM users WHERE user_name = 
?2001-07-17 15:21:31 - ContextManager: JDBCRealm: Authentication successful 
for user michaelm2001-07-17 15:21:31 - ContextManager: JDBCRealm: Auth ok, 
user=michaelm
 
but it won't take me to the page I want to go 
to...in other words, it says I'm successfully authenticated, but the login 
window just keeps popping up.  After 3 tries, I get to the page, but it's 
blank.  Same for form login...keep logging in and keep getting sent to the 
error page.
 
What's up?
 
When I put a garbage login/pass I see:
 
2001-07-17 15:24:29 - ContextManager: JDBCRealm: 
Authentication unsuccessful for user asdf
 
so I know that it is talking to the database 
correctly.
 
Here the security part of my web.xml:
 
   
Protected 
Area    
/main/pgMain.html    
DELETE    
GET    
POST    
PUT    
viewer   
 
   BASIC  Admin 
Here is the database stuff:
 
Welcome to the MySQL monitor.  Commands end 
with ; or \g.Your MySQL connection id is 4 to server version: 
3.23.39-nt
 
Type 'help;' or '\h' for help. Type '\c' to clear 
the buffer.
 
mysql> use testdbDatabase 
changedmysql> select * from users;+---+---+| 
user_name | user_pass |+---+---+| michaelm  | 
indonesia    |+---+---+1 row in set (0.00 
sec)
 
mysql> select * from 
roles;+---+| role_name |+---+| 
viewer    |+---+1 row in set (0.04 
sec)
 
mysql> select * from 
user_roles;+---+---+| user_name | role_name 
|+---+---+| michaelm  | viewer    
|+---+---+1 row in set (0.04 sec)
 
mysql>
 
 
Any clues?
 
Mike
 


Re: Speeding up database accesses

2001-02-05 Thread Michael P. McCutcheon

OOpse...I meant to say that the valueUnbound method of your object will be
called...there you can close the connection...

Mike

- Original Message -
From: "Michael P. McCutcheon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 6:50 PM
Subject: Re: Speeding up database accesses


> You should never rely on garbage collection to handle your connections.
> Just use the HTTPSessionBindingListener interface, and call the
valueUnbound
> when the session exipres...there you can cleanly close the connection.
>
> Mike
>
>
> - Original Message -
> From: "Randy Layman" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 05, 2001 1:13 PM
> Subject: RE: Speeding up database accesses
>
>
> >
> > I hate it when other people beat me to the responses
> >
> > Basically, yes.  Another reason is that some of the JDBC drivers
> > taht I have worked with don't behave properly when garbage collected.
> > Therefore, when the session dies, the Connection would die a
> > garbage-collected death, sometimes leaving hanging connections.
> >
> > Yet another reason is when trying to deal with the JDBC-ODBC bridge
> > and their problem of not handling concurrent connections.  One
connection
> > per session makes it very difficult to limit the access.  Its much
easier
> > where there is one class handling the the database traffic to implement
> this
> > kind of traffic cop approach, or caching, etc.
> >
> > Lastly, it generally breaks the Model/View/Controller design
> > philisophy to include the model (database) with the view (jsp) in the
same
> > class.
> >
> > Randy
> >
> >
> > -Original Message-
> > From: Steve Ruby [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 05, 2001 4:42 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Speeding up database accesses
> >
> >
> >
> >
> > For one reason you are going to have a connection dedicated
> > to that session even if it isn't using it, so you will
> > have one connection per session when you really only need
> > one connection per use which is likely to be MUCH smaller, especially
> > considering the session doesn't die until session-timeout so you
> > will have a buch of lame connection sitting around takeing up
> > memory waiting to die..
> >
> > A pool (especially a good one) will allow you to have
> > only the number of connections you need available to you
> > at any time.
> >
> >
> >
> > CPC Livelink Admin wrote:
> > >
> > > Why is it a bad idea to use a session variable?
> > >
> > > -Original Message-
> > > From: Randy Layman [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, February 05, 2001 3:52 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: Speeding up database accesses
> > >
> > > One possibility (altough a bad idea) is to stick it into your
> > > session.
> > >
> > > Another possibility is to create an object that has a static
> > > variable for the Connection.  Then provide methods to access it.
> Remember
> > > that you need to make sure only one thing at a time is using the
> > connection.
> > >
> > > There are some pooling connection managers out there already.
> One
> > > that I know of off the top of my head is PoolMan.  You can go over to
> > > sourceforge.net and search for it.
> > >
> > > Randy
> > >
> > > -Original Message-
> > > From: John Coonrod [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, February 05, 2001 4:19 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Speeding up database accesses
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
> >
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Speeding up database accesses

2001-02-05 Thread Michael P. McCutcheon

You should never rely on garbage collection to handle your connections.
Just use the HTTPSessionBindingListener interface, and call the valueUnbound
when the session exipres...there you can cleanly close the connection.

Mike


- Original Message -
From: "Randy Layman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 1:13 PM
Subject: RE: Speeding up database accesses


>
> I hate it when other people beat me to the responses
>
> Basically, yes.  Another reason is that some of the JDBC drivers
> taht I have worked with don't behave properly when garbage collected.
> Therefore, when the session dies, the Connection would die a
> garbage-collected death, sometimes leaving hanging connections.
>
> Yet another reason is when trying to deal with the JDBC-ODBC bridge
> and their problem of not handling concurrent connections.  One connection
> per session makes it very difficult to limit the access.  Its much easier
> where there is one class handling the the database traffic to implement
this
> kind of traffic cop approach, or caching, etc.
>
> Lastly, it generally breaks the Model/View/Controller design
> philisophy to include the model (database) with the view (jsp) in the same
> class.
>
> Randy
>
>
> -Original Message-
> From: Steve Ruby [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 05, 2001 4:42 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Speeding up database accesses
>
>
>
>
> For one reason you are going to have a connection dedicated
> to that session even if it isn't using it, so you will
> have one connection per session when you really only need
> one connection per use which is likely to be MUCH smaller, especially
> considering the session doesn't die until session-timeout so you
> will have a buch of lame connection sitting around takeing up
> memory waiting to die..
>
> A pool (especially a good one) will allow you to have
> only the number of connections you need available to you
> at any time.
>
>
>
> CPC Livelink Admin wrote:
> >
> > Why is it a bad idea to use a session variable?
> >
> > -Original Message-
> > From: Randy Layman [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 05, 2001 3:52 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Speeding up database accesses
> >
> > One possibility (altough a bad idea) is to stick it into your
> > session.
> >
> > Another possibility is to create an object that has a static
> > variable for the Connection.  Then provide methods to access it.
Remember
> > that you need to make sure only one thing at a time is using the
> connection.
> >
> > There are some pooling connection managers out there already.
One
> > that I know of off the top of my head is PoolMan.  You can go over to
> > sourceforge.net and search for it.
> >
> > Randy
> >
> > -Original Message-
> > From: John Coonrod [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 05, 2001 4:19 PM
> > To: [EMAIL PROTECTED]
> > Subject: Speeding up database accesses
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Connection failure during handshake? (mm.mysql)

2000-11-09 Thread Michael P. McCutcheon

If memory serves me correctly, a newer version of that MySQL JDBC driver
cured the handshake problem.  I suggest downloading the latest version...

Mike

- Original Message -
From: "Harding, David" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 09, 2000 2:47 PM
Subject: Connection failure during handshake? (mm.mysql)


> i have a Database connection pool and connection pool factory written as
> java classes.  the idea is to pool database connections over all of my
> servlets in my webapp.  so far so good.  things have been working well for
> some time now, but i just ran into a problem.
>
> java.sql.SQLException: Communication failure during handshake.  Is there a
> server running on 
>
> that is the error i get (tracked that down to MySQLIO.java in mm.mysql).
>
> anyhow, the deal is this...there *IS* a server running there.  i can
connect
> to it via Perl:DBI or the mysql client with no problems right after
getting
> that java exception.  then if i try my java stuff right after that, it
still
> fails with the same error.
>
> anyone know what is going on here?  (fyi, this connection pool is being
used
> via a JApplet)
>
>
>




Re: how to run a class on startup of tomcat ??

2000-11-06 Thread Michael P. McCutcheon

How do you get it to load the servlet automatically, without running it,
when Tomcat is started?

Mike

- Original Message -
From: "Christian Mack" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 06, 2000 3:51 AM
Subject: RE: how to run a class on startup of tomcat ??


> Hi Sudheshna
>
> That's easy.
> Just use a servlet which gets startet on tomcats startup.
> In it's init() just start your Runnable.
> The doXXX() methods are empty, as this servlet will never be called.
>
> Tschau
> Christian
>
> > -Original Message-
> > From: Sudheshna Methuku [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, November 06, 2000 7:25 AM
> > To: [EMAIL PROTECTED]
> > Cc: Subhashini Chirunomula; Marthi Nalini
> > Subject: how to run a class on startup of tomcat ??
> >
> >
> > Hi All,
> >
> > We have a startup class which needs to be run when tomcat is
> > started. Could
> > anyone pl. tell us how it is possible. The startup class is
> > not a servlet,
> > it implements runnable and it in turn starts some more threads.
> >
> > Thanks,
> > Sudheshna.M.
> >
>