RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log shows
the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear, in
stead of taking me to the next page, by design.
the top url address is like:

http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James

-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)

The logs would seem to imply the JDBC driver is blowing up creating the 
prepared statement in the second step (ie reading from the roles table).
I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181

HTH,

Jon

Ostad, James wrote:
 The line above the line you mentioned in the error log indicates that
 the connection was established at one point:
 
 2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
 authenticated
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication
 
 So, I don't think that the parameters are wrong, neither the database
 setup. The web application functions with form base authentication
 without usage of realm. 
 
 It is my next step to implement the realm, which I having problem.
 
 but, I will double check my settings and configuration to make sure
that
 I didn't miss anything.
 
 thanks,
 
 James
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 26, 2003 4:00 PM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 The problem is this:
 
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication
 java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Can't
 start 
 a cloned connection while in manual transaction mode.
 
 Since I don't use SQL server and Java, I can't be of more help, but my
 guess is
 - Database setup
 - Driver parameter missing
 
 -Tim
 
 Ostad, James wrote:
 
Hi everyone,
Hope everyone will have a great TG Day.

Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm

I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use
 
 jdbcrealm.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 ---In (14)
 
 
 
 
 Out--- (3)
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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



---In (14)




Out--- (3)



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



RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
I just noticed this errors in the following files under tomcat log
directory:

catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in the
container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)


localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
persisted sessions: java.io.EOFException
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
va:2150)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
am.java:2619)


Any help would be appreciated
thanks,

James


-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log shows
the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear, in
stead of taking me to the next page, by design.
the top url address is like:

http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James

-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)

The logs would seem to imply the JDBC driver is blowing up creating the 
prepared statement in the second step (ie reading from the roles table).
I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181

HTH,

Jon

Ostad, James wrote:
 The line above the line you mentioned in the error log indicates that
 the connection was established at one point:
 
 2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
 authenticated
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication
 
 So, I don't think that the parameters are wrong, neither the database
 setup. The web application functions with form base authentication
 without usage of realm. 
 
 It is my next step to implement the realm, which I having problem.
 
 but, I will double check my settings and configuration to make sure
that
 I didn't miss anything.
 
 thanks,
 
 James
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 26, 2003 4:00 PM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 The problem is this:
 
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication
 java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Can't
 start 
 a cloned connection while in manual transaction mode.
 
 Since I don't use SQL server and Java, I can't be of more help, but my
 guess is
 - Database setup
 - Driver parameter missing
 
 -Tim
 
 Ostad, James wrote:
 
Hi everyone,
Hope everyone will have a great TG Day.

Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm

I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use
 
 jdbcrealm.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 ---In (14)
 
 
 
 
 Out--- (3)
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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



---In (14)




Out--- (3)



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



---In (14)




Out--- (3)



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



RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
One more thing,
when I commented out the realm section in server.xml, the program does
work with the default realm.

James

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


I just noticed this errors in the following files under tomcat log
directory:

catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in the
container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)


localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
persisted sessions: java.io.EOFException
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
va:2150)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
am.java:2619)


Any help would be appreciated
thanks,

James


-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log shows
the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear, in
stead of taking me to the next page, by design.
the top url address is like:

http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James

-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)

The logs would seem to imply the JDBC driver is blowing up creating the 
prepared statement in the second step (ie reading from the roles table).
I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181

HTH,

Jon

Ostad, James wrote:
 The line above the line you mentioned in the error log indicates that
 the connection was established at one point:
 
 2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
 authenticated
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication
 
 So, I don't think that the parameters are wrong, neither the database
 setup. The web application functions with form base authentication
 without usage of realm. 
 
 It is my next step to implement the realm, which I having problem.
 
 but, I will double check my settings and configuration to make sure
that
 I didn't miss anything.
 
 thanks,
 
 James
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 26, 2003 4:00 PM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 The problem is this:
 
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication
 java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Can't
 start 
 a cloned connection while in manual transaction mode.
 
 Since I don't use SQL server and Java, I can't be of more help, but my
 guess is
 - Database setup
 - Driver parameter missing
 
 -Tim
 
 Ostad, James wrote:
 
Hi everyone,
Hope everyone will have a great TG Day.

Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm

I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use
 
 jdbcrealm.
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 ---In (14)
 
 
 
 
 Out--- (3)
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 




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



---In (14)




Out--- (3)



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



---In (14)




Out--- (3

Re: JDBCRealm problem

2003-12-03 Thread Tim Funk
If you have a NPE, it might being thrown by the Realm. This can happen when 
there is a null role or similar. This has since been patched. You can test it 
by getting the latest JDBCRealm from source, compiling it and placing it in 
the appropriate nested dir in server/classes. (Which has a higher precedence 
than the lib dir)

-Tim

Ostad, James wrote:

One more thing,
when I commented out the realm section in server.xml, the program does
work with the default realm.
James

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem

I just noticed this errors in the following files under tomcat log
directory:
catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in the
container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
henticator.java:263)
localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
persisted sessions: java.io.EOFException
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
va:2150)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
am.java:2619)
Any help would be appreciated
thanks,
James

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem

Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log shows
the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear, in
stead of taking me to the next page, by design.
the top url address is like:
http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)
The logs would seem to imply the JDBC driver is blowing up creating the 
prepared statement in the second step (ie reading from the roles table).
I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
HTH,

Jon

Ostad, James wrote:

The line above the line you mentioned in the error log indicates that
the connection was established at one point:
2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm. 

It is my next step to implement the realm, which I having problem.

but, I will double check my settings and configuration to make sure
that

I didn't miss anything.

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Can't

start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing
-Tim

Ostad, James wrote:


Hi everyone,
Hope everyone will have a great TG Day.
Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm
I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use
jdbcrealm.



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


---In (14)



Out--- (3)



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





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

RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?

thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


If you have a NPE, it might being thrown by the Realm. This can happen
when 
there is a null role or similar. This has since been patched. You can
test it 
by getting the latest JDBCRealm from source, compiling it and placing it
in 
the appropriate nested dir in server/classes. (Which has a higher
precedence 
than the lib dir)

-Tim

Ostad, James wrote:

 One more thing,
 when I commented out the realm section in server.xml, the program does
 work with the default realm.
 
 James
 
 -Original Message-
 From: Ostad, James 
 Sent: Wednesday, December 03, 2003 10:08 AM
 To: Tomcat Users List
 Subject: RE: JDBCRealm problem
 
 
 I just noticed this errors in the following files under tomcat log
 directory:
 
 catalina_log.2003-12-03.txt
 
 2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in
the
 container during the request processing
 java.lang.NullPointerException
   at
 org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
   at
 org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
   at

org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
 henticator.java:263)
 
 
 localhost_log.2003-11-26.txt
 2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
 generator has been completed
 2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
 persisted sessions: java.io.EOFException
 java.io.EOFException
   at

java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
 va:2150)
   at

java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
 am.java:2619)
 
 
 Any help would be appreciated
 thanks,
 
 James
 
 
 -Original Message-
 From: Ostad, James 
 Sent: Wednesday, December 03, 2003 9:51 AM
 To: Tomcat Users List
 Subject: RE: JDBCRealm problem
 
 
 Hi,
 Thanks for the info.
 Apparently, the database was not set correctly.
 After correcting the previous problem, I am able to login. The log
shows
 the correct authentication with no errors.
 Yet, I not getting anything after the login. the web page is clear, in
 stead of taking me to the next page, by design.
 the top url address is like:
 
 http://localhost/login/j_security_check
 
 any help, suggestion, or comment would be nice.
 
 Thanks,
 James
 
 -Original Message-
 From: Jon Wingfield [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 27, 2003 5:01 AM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 The JDBCRealm does two things:
 1) Authenticates the user (by checking password)
 2) Authorizes the user (by checking roles)
 
 The logs would seem to imply the JDBC driver is blowing up creating
the 
 prepared statement in the second step (ie reading from the roles
table).
 I think Tim is right - he usually is - that there is a config problem 
 with the db or the connection to the db.
 
 A quick google later:
 http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
 
 HTH,
 
 Jon
 
 Ostad, James wrote:
 
The line above the line you mentioned in the error log indicates that
the connection was established at one point:

2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication

So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm. 

It is my next step to implement the realm, which I having problem.

but, I will double check my settings and configuration to make sure
 
 that
 
I didn't miss anything.

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
 
 JDBC]Can't
 
start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing

-Tim

Ostad, James wrote:


Hi everyone,
Hope everyone will have a great TG Day.

Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm

I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use

jdbcrealm

Re: JDBCRealm problem

2003-12-03 Thread Tim Funk
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JNDIRealm.java

The easiest way to compile in this case:
CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java
-Tim

Ostad, James wrote:

I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?
thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
If you have a NPE, it might being thrown by the Realm. This can happen
when 
there is a null role or similar. This has since been patched. You can
test it 
by getting the latest JDBCRealm from source, compiling it and placing it
in 
the appropriate nested dir in server/classes. (Which has a higher
precedence 
than the lib dir)

-Tim

Ostad, James wrote:


One more thing,
when I commented out the realm section in server.xml, the program does
work with the default realm.
James

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem

I just noticed this errors in the following files under tomcat log
directory:
catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in
the

container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut

henticator.java:263)

localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
persisted sessions: java.io.EOFException
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja

va:2150)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre

am.java:2619)

Any help would be appreciated
thanks,
James

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem

Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log
shows

the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear, in
stead of taking me to the next page, by design.
the top url address is like:
http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)
The logs would seem to imply the JDBC driver is blowing up creating
the 

prepared statement in the second step (ie reading from the roles
table).

I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
HTH,

Jon

Ostad, James wrote:


The line above the line you mentioned in the error log indicates that
the connection was established at one point:
2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm. 

It is my next step to implement the realm, which I having problem.

but, I will double check my settings and configuration to make sure
that


I didn't miss anything.

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
JDBC]Can't


start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing
-Tim

Ostad, James wrote:



Hi everyone,
Hope everyone will have a great TG Day.
Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm
I am

RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
Tim,
I got the source files.
Now there are three jdbcrealm files:
jdbcrealm.java
jdbcrealmform.java

do I need to compile them all, or just the first one?

thanks, 

james

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


If you have a NPE, it might being thrown by the Realm. This can happen
when 
there is a null role or similar. This has since been patched. You can
test it 
by getting the latest JDBCRealm from source, compiling it and placing it
in 
the appropriate nested dir in server/classes. (Which has a higher
precedence 
than the lib dir)

-Tim

Ostad, James wrote:

 One more thing,
 when I commented out the realm section in server.xml, the program does
 work with the default realm.
 
 James
 
 -Original Message-
 From: Ostad, James 
 Sent: Wednesday, December 03, 2003 10:08 AM
 To: Tomcat Users List
 Subject: RE: JDBCRealm problem
 
 
 I just noticed this errors in the following files under tomcat log
 directory:
 
 catalina_log.2003-12-03.txt
 
 2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in
the
 container during the request processing
 java.lang.NullPointerException
   at
 org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
   at
 org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
   at

org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
 henticator.java:263)
 
 
 localhost_log.2003-11-26.txt
 2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
 generator has been completed
 2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
 persisted sessions: java.io.EOFException
 java.io.EOFException
   at

java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
 va:2150)
   at

java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
 am.java:2619)
 
 
 Any help would be appreciated
 thanks,
 
 James
 
 
 -Original Message-
 From: Ostad, James 
 Sent: Wednesday, December 03, 2003 9:51 AM
 To: Tomcat Users List
 Subject: RE: JDBCRealm problem
 
 
 Hi,
 Thanks for the info.
 Apparently, the database was not set correctly.
 After correcting the previous problem, I am able to login. The log
shows
 the correct authentication with no errors.
 Yet, I not getting anything after the login. the web page is clear, in
 stead of taking me to the next page, by design.
 the top url address is like:
 
 http://localhost/login/j_security_check
 
 any help, suggestion, or comment would be nice.
 
 Thanks,
 James
 
 -Original Message-
 From: Jon Wingfield [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 27, 2003 5:01 AM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 The JDBCRealm does two things:
 1) Authenticates the user (by checking password)
 2) Authorizes the user (by checking roles)
 
 The logs would seem to imply the JDBC driver is blowing up creating
the 
 prepared statement in the second step (ie reading from the roles
table).
 I think Tim is right - he usually is - that there is a config problem 
 with the db or the connection to the db.
 
 A quick google later:
 http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
 
 HTH,
 
 Jon
 
 Ostad, James wrote:
 
The line above the line you mentioned in the error log indicates that
the connection was established at one point:

2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication

So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm. 

It is my next step to implement the realm, which I having problem.

but, I will double check my settings and configuration to make sure
 
 that
 
I didn't miss anything.

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for
 
 JDBC]Can't
 
start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing

-Tim

Ostad, James wrote:


Hi everyone,
Hope everyone will have a great TG Day.

Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm

I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use

jdbcrealm

Re: JDBCRealm problem

2003-12-03 Thread Tim Funk
Oops, wrong file:
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JDBCRealm.java
-Tim

Tim Funk wrote:

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/realm/JNDIRealm.java 

The easiest way to compile in this case:
CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java
-Tim

Ostad, James wrote:

I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?
thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
If you have a NPE, it might being thrown by the Realm. This can happen
when there is a null role or similar. This has since been patched. You 
can
test it by getting the latest JDBCRealm from source, compiling it and 
placing it
in the appropriate nested dir in server/classes. (Which has a higher
precedence than the lib dir)

-Tim

Ostad, James wrote:


One more thing,
when I commented out the realm section in server.xml, the program does
work with the default realm.
James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem
I just noticed this errors in the following files under tomcat log
directory:
catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in


the

container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut

henticator.java:263)

localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random number
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while loading
persisted sessions: java.io.EOFException
java.io.EOFException
at
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja

va:2150)
at
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre

am.java:2619)

Any help would be appreciated
thanks,
James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem
Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log


shows

the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear, in
stead of taking me to the next page, by design.
the top url address is like:
http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)
The logs would seem to imply the JDBC driver is blowing up creating


the

prepared statement in the second step (ie reading from the roles


table).

I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
HTH,

Jon

Ostad, James wrote:


The line above the line you mentioned in the error log indicates that
the connection was established at one point:
2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm.
It is my next step to implement the realm, which I having problem.
but, I will double check my settings and configuration to make sure


that


I didn't miss anything.

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for


JDBC]Can't


start a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing
-Tim

Ostad, James wrote:



Hi everyone,
Hope everyone will have a great TG Day.
Problem: I am not able to login successfully. It keeps failing.

Structure: using

RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
Tim,
I am afraid that I am not familiar with the first line, CP=...
is that a copy command on unix?

thanks
james


-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 11:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


Oops, wrong file:
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
org/apache/catalina/realm/JDBCRealm.java

-Tim

Tim Funk wrote:


http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
org/apache/catalina/realm/JNDIRealm.java 
 
 
 The easiest way to compile in this case:
 CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
 javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java
 
 -Tim
 
 Ostad, James wrote:
 
 I am new in tomcat.
 I am looking in tomcat site for source file for JDBCRealm.
 Is this part of the tomcat source files? or it is separate?

 thanks

 James

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 03, 2003 10:20 AM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem


 If you have a NPE, it might being thrown by the Realm. This can
happen
 when there is a null role or similar. This has since been patched.
You 
 can
 test it by getting the latest JDBCRealm from source, compiling it and

 placing it
 in the appropriate nested dir in server/classes. (Which has a higher
 precedence than the lib dir)

 -Tim

 Ostad, James wrote:


 One more thing,
 when I commented out the realm section in server.xml, the program
does
 work with the default realm.

 James

 -Original Message-
 From: Ostad, James Sent: Wednesday, December 03, 2003 10:08 AM
 To: Tomcat Users List
 Subject: RE: JDBCRealm problem


 I just noticed this errors in the following files under tomcat log
 directory:

 catalina_log.2003-12-03.txt

 2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in


 the

 container during the request processing
 java.lang.NullPointerException
 at
 org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
 at
 org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
 at



org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut

 henticator.java:263)


 localhost_log.2003-11-26.txt
 2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random
number
 generator has been completed
 2003-12-03 09:58:53 StandardManager[/webdav] IOException while
loading
 persisted sessions: java.io.EOFException
 java.io.EOFException
 at



java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja

 va:2150)
 at



java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre

 am.java:2619)


 Any help would be appreciated
 thanks,

 James


 -Original Message-
 From: Ostad, James Sent: Wednesday, December 03, 2003 9:51 AM
 To: Tomcat Users List
 Subject: RE: JDBCRealm problem


 Hi,
 Thanks for the info.
 Apparently, the database was not set correctly.
 After correcting the previous problem, I am able to login. The log


 shows

 the correct authentication with no errors.
 Yet, I not getting anything after the login. the web page is clear,
in
 stead of taking me to the next page, by design.
 the top url address is like:

 http://localhost/login/j_security_check

 any help, suggestion, or comment would be nice.

 Thanks,
 James

 -Original Message-
 From: Jon Wingfield [mailto:[EMAIL PROTECTED]
 Sent: Thursday, November 27, 2003 5:01 AM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem


 The JDBCRealm does two things:
 1) Authenticates the user (by checking password)
 2) Authorizes the user (by checking roles)

 The logs would seem to imply the JDBC driver is blowing up creating


 the

 prepared statement in the second step (ie reading from the roles


 table).

 I think Tim is right - he usually is - that there is a config
problem 
 with the db or the connection to the db.

 A quick google later:
 http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181

 HTH,

 Jon

 Ostad, James wrote:


 The line above the line you mentioned in the error log indicates
that
 the connection was established at one point:

 2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin
successfully
 authenticated
 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
 authentication

 So, I don't think that the parameters are wrong, neither the
database
 setup. The web application functions with form base authentication
 without usage of realm.
 It is my next step to implement the realm, which I having problem.

 but, I will double check my settings and configuration to make sure


 that


 I didn't miss anything.

 thanks,

 James

 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, November 26, 2003 4:00 PM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem


 The problem is this:

 2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing

Re: JDBCRealm problem

2003-12-03 Thread Tim Funk
It was a lazy way to set environment variables in unix.

Here is a simple way in ant: (just the relevant snippets, not a lesson in ant)

...
path id=classpath
  pathelement location=${catalina.home}/common/classes/
  fileset dir=${catalina.home}/common/lib
include name=**/*.jar/
  /fileset
  pathelement location=${catalina.home}/server/classes/
  fileset dir=${catalina.home}/server/lib
include name=**/*.jar/
  /fileset
/path
...
  !-- Assuming java file is in a dir called src --
  target name=compile
javac srcdir=src deprecation=true debug=true
  destdir=${catalina.home}/server/classes
 classpath refid=classpath/
/javac
  /target
...
-Tim

Ostad, James wrote:

Tim,
I am afraid that I am not familiar with the first line, CP=...
is that a copy command on unix?
thanks
james
-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 11:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
Oops, wrong file:
http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
org/apache/catalina/realm/JDBCRealm.java
-Tim

Tim Funk wrote:

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
org/apache/catalina/realm/JNDIRealm.java 

The easiest way to compile in this case:
CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java
-Tim

Ostad, James wrote:


I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?
thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
If you have a NPE, it might being thrown by the Realm. This can
happen

when there is a null role or similar. This has since been patched.
You 

can
test it by getting the latest JDBCRealm from source, compiling it and


placing it
in the appropriate nested dir in server/classes. (Which has a higher
precedence than the lib dir)
-Tim

Ostad, James wrote:



One more thing,
when I commented out the realm section in server.xml, the program
does

work with the default realm.

James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem
I just noticed this errors in the following files under tomcat log
directory:
catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in


the


container during the request processing
java.lang.NullPointerException
   at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
   at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
   at


org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut

henticator.java:263)

localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random
number

generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while
loading

persisted sessions: java.io.EOFException
java.io.EOFException
   at


java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja

va:2150)
   at


java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre

am.java:2619)

Any help would be appreciated
thanks,
James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem
Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log


shows


the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear,
in

stead of taking me to the next page, by design.
the top url address is like:
http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)
The logs would seem to imply the JDBC driver is blowing up creating


the


prepared statement in the second step (ie reading from the roles


table).


I think Tim is right - he usually is - that there is a config
problem 

with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
HTH,

Jon

Ostad, James wrote:



The line above the line you mentioned in the error log indicates
that

the connection was established at one point:

2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin
successfully

authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
So, I don't think that the parameters

RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
Thank you.
What a educational ride.

I did the compilation of the jdbcrealm.java
Now I am getting the http status 403 !!!

again, without this realm setup in server.xml, by just using the DD
file, I don't have any restriction problem.

any suggestion?

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 12:13 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


It was a lazy way to set environment variables in unix.

Here is a simple way in ant: (just the relevant snippets, not a lesson
in ant)

...
path id=classpath
   pathelement location=${catalina.home}/common/classes/
   fileset dir=${catalina.home}/common/lib
 include name=**/*.jar/
   /fileset
   pathelement location=${catalina.home}/server/classes/
   fileset dir=${catalina.home}/server/lib
 include name=**/*.jar/
   /fileset
/path
...

   !-- Assuming java file is in a dir called src --
   target name=compile
 javac srcdir=src deprecation=true debug=true
   destdir=${catalina.home}/server/classes
  classpath refid=classpath/
 /javac
   /target
...

-Tim

Ostad, James wrote:

 Tim,
 I am afraid that I am not familiar with the first line, CP=...
 is that a copy command on unix?
 
 thanks
 james
 
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 03, 2003 11:20 AM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 Oops, wrong file:

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
 org/apache/catalina/realm/JDBCRealm.java
 
 -Tim
 
 Tim Funk wrote:
 
 

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
 org/apache/catalina/realm/JNDIRealm.java 
 

The easiest way to compile in this case:
CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java

-Tim

Ostad, James wrote:


I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?

thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


If you have a NPE, it might being thrown by the Realm. This can
 
 happen
 
when there is a null role or similar. This has since been patched.
 
 You 
 
can
test it by getting the latest JDBCRealm from source, compiling it and
 
 
placing it
in the appropriate nested dir in server/classes. (Which has a higher
precedence than the lib dir)

-Tim

Ostad, James wrote:



One more thing,
when I commented out the realm section in server.xml, the program
 
 does
 
work with the default realm.

James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


I just noticed this errors in the following files under tomcat log
directory:

catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in


the


container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at




org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
 
henticator.java:263)


localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random
 
 number
 
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while
 
 loading
 
persisted sessions: java.io.EOFException
java.io.EOFException
at




java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
 
va:2150)
at




java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
 
am.java:2619)


Any help would be appreciated
thanks,

James


-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log


shows


the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear,
 
 in
 
stead of taking me to the next page, by design.
the top url address is like:

http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James

-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 27, 2003 5:01 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)

The logs would seem to imply the JDBC driver is blowing up creating


the


prepared statement in the second step (ie reading from the roles


table).


I think

RE: JDBCRealm problem

2003-12-03 Thread Ostad, James
I noticed in the log file that after authentication of admin user,
another line indicates that the user admin does not have the role admin.

I am checking database to make sure that the role and user have
relationship.
any suggestion?

thanks,

james

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 2:51 PM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


Thank you.
What a educational ride.

I did the compilation of the jdbcrealm.java
Now I am getting the http status 403 !!!

again, without this realm setup in server.xml, by just using the DD
file, I don't have any restriction problem.

any suggestion?

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 12:13 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


It was a lazy way to set environment variables in unix.

Here is a simple way in ant: (just the relevant snippets, not a lesson
in ant)

...
path id=classpath
   pathelement location=${catalina.home}/common/classes/
   fileset dir=${catalina.home}/common/lib
 include name=**/*.jar/
   /fileset
   pathelement location=${catalina.home}/server/classes/
   fileset dir=${catalina.home}/server/lib
 include name=**/*.jar/
   /fileset
/path
...

   !-- Assuming java file is in a dir called src --
   target name=compile
 javac srcdir=src deprecation=true debug=true
   destdir=${catalina.home}/server/classes
  classpath refid=classpath/
 /javac
   /target
...

-Tim

Ostad, James wrote:

 Tim,
 I am afraid that I am not familiar with the first line, CP=...
 is that a copy command on unix?
 
 thanks
 james
 
 
 -Original Message-
 From: Tim Funk [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, December 03, 2003 11:20 AM
 To: Tomcat Users List
 Subject: Re: JDBCRealm problem
 
 
 Oops, wrong file:

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
 org/apache/catalina/realm/JDBCRealm.java
 
 -Tim
 
 Tim Funk wrote:
 
 

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/
 org/apache/catalina/realm/JNDIRealm.java 
 

The easiest way to compile in this case:
CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java

-Tim

Ostad, James wrote:


I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?

thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


If you have a NPE, it might being thrown by the Realm. This can
 
 happen
 
when there is a null role or similar. This has since been patched.
 
 You 
 
can
test it by getting the latest JDBCRealm from source, compiling it and
 
 
placing it
in the appropriate nested dir in server/classes. (Which has a higher
precedence than the lib dir)

-Tim

Ostad, James wrote:



One more thing,
when I commented out the realm section in server.xml, the program
 
 does
 
work with the default realm.

James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


I just noticed this errors in the following files under tomcat log
directory:

catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in


the


container during the request processing
java.lang.NullPointerException
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
at




org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut
 
henticator.java:263)


localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random
 
 number
 
generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while
 
 loading
 
persisted sessions: java.io.EOFException
java.io.EOFException
at




java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja
 
va:2150)
at




java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre
 
am.java:2619)


Any help would be appreciated
thanks,

James


-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem


Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log


shows


the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear,
 
 in
 
stead of taking me to the next page, by design.
the top url address is like:

http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James

-Original Message-
From: Jon Wingfield [mailto

Re: JDBCRealm problem

2003-12-03 Thread Tim Funk
Turn debugging up to 99.

-Tim

Ostad, James wrote:
I noticed in the log file that after authentication of admin user,
another line indicates that the user admin does not have the role admin.
I am checking database to make sure that the role and user have
relationship.
any suggestion?
thanks,

james

-Original Message-
From: Ostad, James 
Sent: Wednesday, December 03, 2003 2:51 PM
To: Tomcat Users List
Subject: RE: JDBCRealm problem

Thank you.
What a educational ride.
I did the compilation of the jdbcrealm.java
Now I am getting the http status 403 !!!
again, without this realm setup in server.xml, by just using the DD
file, I don't have any restriction problem.
any suggestion?

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 12:13 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
It was a lazy way to set environment variables in unix.

Here is a simple way in ant: (just the relevant snippets, not a lesson
in ant)
...
path id=classpath
   pathelement location=${catalina.home}/common/classes/
   fileset dir=${catalina.home}/common/lib
 include name=**/*.jar/
   /fileset
   pathelement location=${catalina.home}/server/classes/
   fileset dir=${catalina.home}/server/lib
 include name=**/*.jar/
   /fileset
/path
...
   !-- Assuming java file is in a dir called src --
   target name=compile
 javac srcdir=src deprecation=true debug=true
   destdir=${catalina.home}/server/classes
  classpath refid=classpath/
 /javac
   /target
...
-Tim

Ostad, James wrote:


Tim,
I am afraid that I am not familiar with the first line, CP=...
is that a copy command on unix?
thanks
james
-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 11:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
Oops, wrong file:

http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/

org/apache/catalina/realm/JDBCRealm.java

-Tim

Tim Funk wrote:



http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-4.0/catalina/src/share/

org/apache/catalina/realm/JNDIRealm.java 


The easiest way to compile in this case:
CP=*All jars in $CATALINA/common/lib,All jars in $CATALINA/server/lib*
javac -classpath $CP -d $CATALINA_HOME/server/classes JNDIRealm.java
-Tim

Ostad, James wrote:



I am new in tomcat.
I am looking in tomcat site for source file for JDBCRealm.
Is this part of the tomcat source files? or it is separate?
thanks

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 10:20 AM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
If you have a NPE, it might being thrown by the Realm. This can
happen


when there is a null role or similar. This has since been patched.
You 


can
test it by getting the latest JDBCRealm from source, compiling it and


placing it
in the appropriate nested dir in server/classes. (Which has a higher
precedence than the lib dir)
-Tim

Ostad, James wrote:




One more thing,
when I commented out the realm section in server.xml, the program
does


work with the default realm.

James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 10:08 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem
I just noticed this errors in the following files under tomcat log
directory:
catalina_log.2003-12-03.txt

2003-12-03 09:59:06 CoyoteAdapter An exception or error occurred in


the



container during the request processing
java.lang.NullPointerException
  at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:478)
  at
org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:394)
  at


org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAut

henticator.java:263)

localhost_log.2003-11-26.txt
2003-12-03 09:58:53 StandardManager[/webdav]: Seeding of random
number


generator has been completed
2003-12-03 09:58:53 StandardManager[/webdav] IOException while
loading


persisted sessions: java.io.EOFException
java.io.EOFException
  at


java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.ja

va:2150)
  at


java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStre

am.java:2619)

Any help would be appreciated
thanks,
James

-Original Message-
From: Ostad, James Sent: Wednesday, December 03, 2003 9:51 AM
To: Tomcat Users List
Subject: RE: JDBCRealm problem
Hi,
Thanks for the info.
Apparently, the database was not set correctly.
After correcting the previous problem, I am able to login. The log


shows



the correct authentication with no errors.
Yet, I not getting anything after the login. the web page is clear,
in


stead of taking me to the next page, by design.
the top url address is like:
http://localhost/login/j_security_check

any help, suggestion, or comment would be nice.

Thanks,
James
-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday

Re: JDBCRealm problem

2003-11-27 Thread Jon Wingfield
The JDBCRealm does two things:
1) Authenticates the user (by checking password)
2) Authorizes the user (by checking roles)
The logs would seem to imply the JDBC driver is blowing up creating the 
prepared statement in the second step (ie reading from the roles table).
I think Tim is right - he usually is - that there is a config problem 
with the db or the connection to the db.

A quick google later:
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B313181
HTH,

Jon

Ostad, James wrote:
The line above the line you mentioned in the error log indicates that
the connection was established at one point:
2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm. 

It is my next step to implement the realm, which I having problem.

but, I will double check my settings and configuration to make sure that
I didn't miss anything.
thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem
The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't
start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing
-Tim

Ostad, James wrote:

Hi everyone,
Hope everyone will have a great TG Day.
Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm
I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use
jdbcrealm.



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


---In (14)



Out--- (3)



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





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


RE: JDBCRealm problem

2003-11-26 Thread Ostad, James
one more thing, you might have notice by my first email, I am
initializing the database connection within the web.xml. I am not sure
that has to do with the problem.
The initialization in web.xml is for internal bean usage.

thanks,
James

-Original Message-
From: Ostad, James 
Sent: Wednesday, November 26, 2003 12:23 PM
To: Tom (E-mail)
Subject: JDBCRealm problem


Hi everyone,
Hope everyone will have a great TG Day.

Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm

I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use jdbcrealm.
 
you will find them in this email accordingly.

Any help will be appreciated.


server.xml**

Realm className=org.apache.catalina.realm.JDBCRealm debug=99 
driverName=com.microsoft.jdbc.sqlserver.SQLServerDriver

connectionURL=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=us
ers;User=image;Password=image
userTable=users userNameCol=username userCredCol=userpass
userRoleTable=userroles roleNameCole=rolename
/

web.xml*

web-app

 context-param
   param-namejdbcDriver/param-name
 
param-valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/param-value
/context-param
context-param
   param-namejdbcURL/param-name
 
param-valuejdbc:microsoft:sqlserver://localhost:1433;DatabaseName=imag
e/param-value
/context-param
context-param
   param-namejdbcUserName/param-name
   param-valueimage/param-value !-- no user name --
/context-param
context-param
   param-namejdbcPassword/param-name
   param-valueimage/param-value !-- no password --
/context-param
context-param
   param-nameminimumConnections/param-name
   param-value1/param-value
/context-param
context-param
   param-namemaximumConnections/param-name
   param-value5/param-value
/context-param
listener
   listener-classweb.InitializeConnectionPool/listener-class
/listener
!-- END: Initialization of the WebApp Connection Pool --

  servlet-namegateway/servlet-name
 display-nameGateway/display-name
descriptionEntry to CRC/description
  jsp-file/Gateway.jsp/jsp-file
  /servlet
  servlet
  servlet-namecrcForm/servlet-name
 display-namecrcForm/display-name
descriptionForm to request data/description
  jsp-file/Forms/crcForm.jsp/jsp-file
  /servlet
  servlet-mapping
servlet-namegateway/servlet-name
url-pattern/Gateway/url-pattern
  /servlet-mapping
  servlet-mapping
servlet-namecrcForm/servlet-name
url-pattern/form/url-pattern
  /servlet-mapping
  session-config
session-timeout
20
/session-timeout
/session-config
 error-page
exception-typeutil.sql.ConnNotAvailException/exception-type
location/error/server_busy.html/location
/error-page
error-page
exception-typeutil.sql.ShuttingDownException/exception-type
location/error/server_shutdown.html/location
/error-page
   
security-constraint
web-resource-collection
  web-resource-nameRestrictedResources/web-resource-name
   url-pattern/form/url-pattern
  http-methodPOST/http-method
  http-methodGET/http-method
/web-resource-collection
auth-constraint
  role-nameadmin/role-name
/auth-constraint
  /security-constraint
  login-config
auth-methodFORM/auth-method
form-login-config
  form-login-page/login/login.jsp/form-login-page
  form-error-page/login/error.jsp/form-error-page
/form-login-config
  /login-config
  security-role
descriptionA simple restricted-access user role./description
role-nameadmin/role-name
  /security-role
 
/web-app

errorlogfile*


some of you would like to have all errors, some don't. So I attached the
error logfile.


Thanks,

James Ostad
Application Developer/Analyst
TMS Department
Ex. 4457
E-mail: [EMAIL PROTECTED]


Out--- (3)


---In (14)


Out--- (3)



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



Re: JDBCRealm problem

2003-11-26 Thread Tim Funk
The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my guess is
- Database setup
- Driver parameter missing
-Tim

Ostad, James wrote:
Hi everyone,
Hope everyone will have a great TG Day.
Problem: I am not able to login successfully. It keeps failing.

Structure: using JDBCRealm + form authentication

database property: match exactly as explained in tomcat documentation
for setting up JDBCRealm
I am including three things:

1-server.xml part for realm setup
2-web.xml of the web apps
3-errorlog file is the error log I get when I attempt to use jdbcrealm.


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


RE: JDBCRealm problem

2003-11-26 Thread Ostad, James
The line above the line you mentioned in the error log indicates that
the connection was established at one point:

2003-11-26 11:53:19 JDBCRealm[localhost]: Username admin successfully
authenticated
2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication

So, I don't think that the parameters are wrong, neither the database
setup. The web application functions with form base authentication
without usage of realm. 

It is my next step to implement the realm, which I having problem.

but, I will double check my settings and configuration to make sure that
I didn't miss anything.

thanks,

James

-Original Message-
From: Tim Funk [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 26, 2003 4:00 PM
To: Tomcat Users List
Subject: Re: JDBCRealm problem


The problem is this:

2003-11-26 11:53:19 JDBCRealm[localhost]: Exception performing
authentication
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't
start 
a cloned connection while in manual transaction mode.

Since I don't use SQL server and Java, I can't be of more help, but my
guess is
- Database setup
- Driver parameter missing

-Tim

Ostad, James wrote:
 Hi everyone,
 Hope everyone will have a great TG Day.
 
 Problem: I am not able to login successfully. It keeps failing.
 
 Structure: using JDBCRealm + form authentication
 
 database property: match exactly as explained in tomcat documentation
 for setting up JDBCRealm
 
 I am including three things:
 
 1-server.xml part for realm setup
 2-web.xml of the web apps
 3-errorlog file is the error log I get when I attempt to use
jdbcrealm.



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



---In (14)




Out--- (3)



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



RE: JDBCRealm problem with MySQL after adding password and changing user account (bug, unclear tomcat documentation or my stupidity?)

2003-01-14 Thread mech
Sorry, for the post... Solved it myself.
The trick was that you should NOT put your password into the
connectionURL

instead one can use:

Realm className=org.apache.catalina.realm.JDBCRealm debug=99
driverName=com.mysql.jdbc.Driver
connectionURL=jdbc:mysql://localhost:3307/praksis
connectionName=praksis
connectionPassword=siskarp
userTable=benutzer userNameCol=email
userCredCol=passwort
userRoleTable=rollen roleNameCol=rollenname
digest=SHA-1/

Although I have no idea why the tomcat documentation offers an example
for exactly the case where you put username and password into the
connectionURL. 
For some reason it works unless you only specify a user in the URL, but
for more one has to split the data into connectionURL,
connectionName and connectionPassword

Did anybody have similar experiences? Is this a bug while parsing the
server.xml?
At least it doesn't seem to be very consistent, if connectionURL works
with jdbc:mysql://localhost:3307/praksis?user=root but not with
jdbc:mysql://localhost:3307/praksis?user=rootpassword=test

So I start using ONLY connectionName and connectionPassword as I
might get gray hairs soon enough anyway... ;-)

Michael


 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]] 
 Sent: Dienstag, 14. Januar 2003 14:06
 To: [EMAIL PROTECTED]
 Subject: JDBCRealm problem with MySQL after adding password 
 and changing user account
 
 
 Hi,
 
 I have a problem with my Tomcat 4.1.18 JDBCRealm setup on 
 Solaris in server.xml
 
 Previously I had this in my context definition in server.xml 
 and it works fine:
 
   Realm className=org.apache.catalina.realm.JDBCRealm 
 debug=99
   driverName=com.mysql.jdbc.Driver
  
 connectionURL=jdbc:mysql://localhost:3307/praksis?user=root
   userTable=benutzer 
 userNameCol=email userCredCol=passwort
   userRoleTable=rollen roleNameCol=rollenname 
 digest=SHA-1/
 
 Then I added a new user in MySQL named praksis to replace 
 the root access and tried to change to this setup:
 
   Realm className=org.apache.catalina.realm.JDBCRealm 
 debug=99
   driverName=com.mysql.jdbc.Driver
  
 connectionURL=jdbc:mysql://localhost:3307/praksis?user=praksi
 spassword
 =siskarp
   userTable=benutzer 
 userNameCol=email userCredCol=passwort
   userRoleTable=rollen roleNameCol=rollenname 
 digest=SHA-1/
 
 Now I only get weird error messages from the xml parser:
   org.xml.sax.SAXParseException: The reference to entity 
 password must end with the ';' delimiter.
 
 Thus I tried 
 jdbc:mysql://localhost:3307/praksis?user=praksispassword=sis
 karp; but this didn't do the trick... Does it mean anything 
 else? I use mysql-connector-java-2.0.14.jar in common/lib 
 (for tomcat) and webapps/praksis/WEB-INF/libs (for struts)
 
 But I believe the connectionURL is correct because I looked 
 it up in the tomcat doc under jdbc realms. 
 The MySQL setup/user setup should be okay aswell, because my 
 Struts connection pool works with:
 
   data-sources
   data-source
   set-property property=driverClass 
 value=com.mysql.jdbc.Driver/
   set-property property=url 
 value=jdbc:mysql://localhost:3307/praksis/
   set-property property=maxCount value=25/
   set-property property=minCount value=5/
   set-property property=user value=praksis/
   set-property property=password
 value=siskarp/
   /data-source  
   /data-sources
 
 So right now, I'm using a root access without password for my 
 JDBC Realm, because the different JDBC Realm prohibits Tomcat 
 from starting up. But my webapp itself can utilize the struts 
 connection pool with above user account setup without any problems.
 
 Actually I don't know what I did wrong and was hoping for 
 help that I can use the praksis user for both purposes.
 
 Thanks!
 Michael
 
 
 --
 To unsubscribe, e-mail:   
 mailto:tomcat-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 


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




RE: JDBCRealm problem with MySQL after adding password and changing user account

2003-01-14 Thread Ralph Einfeldt
If you want to use  inside xml you have to encode it.

?user=praksispassword=foo
should be changed to
?user=praksisamp;password=foo


BTW: In the JDBCRealm-howto they use ; to seperate
the password from the user.

?user=praksis;password=foo

As I'm not using mysql I'm not shure if that is correct.

 -Original Message-
 From: mech [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, January 14, 2003 2:06 PM
 To: [EMAIL PROTECTED]
 Subject: JDBCRealm problem with MySQL after adding password 
 and changing
 user account
 
 
 connectionURL=jdbc:mysql://localhost:3307/praksis?user=praksi
 spassword
 =siskarp
   userTable=benutzer userNameCol=email
 userCredCol=passwort
   userRoleTable=rollen roleNameCol=rollenname
 digest=SHA-1/
 
 Now I only get weird error messages from the xml parser:
   org.xml.sax.SAXParseException: The reference to entity
 password must end with the ';' delimiter.
 

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




RE: JDBCRealm problem with MySQL after adding password and changing user account

2003-01-14 Thread mech
Strange, I found this non-;-separated example in:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#JDBCRea
lm


Realm className=org.apache.catalina.realm.JDBCRealm debug=99
  driverName=org.gjt.mm.mysql.Driver
 
connectionURL=jdbc:mysql://localhost/authority?user=dbuserpassword=dbp
ass
   userTable=users userNameCol=user_name userCredCol=user_pass
   userRoleTable=user_roles roleNameCol=role_name/

Your note for the  in xml is true, but shouldn't matter in a quoted
string, or do I mix something up now?

Anyway... Using the connectionName, connectionPassword attributes and
you are on the safe side...

Michael


 -Original Message-
 From: Ralph Einfeldt [mailto:[EMAIL PROTECTED]] 
 Sent: Dienstag, 14. Januar 2003 14:25
 To: Tomcat Users List; [EMAIL PROTECTED]
 Subject: RE: JDBCRealm problem with MySQL after adding 
 password and changing user account
 
 
 If you want to use  inside xml you have to encode it.
 
 ?user=praksispassword=foo
 should be changed to
 ?user=praksisamp;password=foo
 
 
 BTW: In the JDBCRealm-howto they use ; to seperate
 the password from the user.
 
 ?user=praksis;password=foo
 
 As I'm not using mysql I'm not shure if that is correct.
 
  -Original Message-
  From: mech [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, January 14, 2003 2:06 PM
  To: [EMAIL PROTECTED]
  Subject: JDBCRealm problem with MySQL after adding password
  and changing
  user account
  
  
  connectionURL=jdbc:mysql://localhost:3307/praksis?user=praksi
  spassword
  =siskarp
  userTable=benutzer userNameCol=email 
  userCredCol=passwort
  userRoleTable=rollen roleNameCol=rollenname 
 digest=SHA-1/
  
  Now I only get weird error messages from the xml parser:
  org.xml.sax.SAXParseException: The reference to entity 
 password 
  must end with the ';' delimiter.
  
 
 --
 To unsubscribe, e-mail:   
 mailto:tomcat-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 


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




Re: jdbcRealm problem

2001-08-09 Thread Taavi Tiirik

 From: Francois Bronsard 
 ...
 The trace of the session state that authetication was successful,
 yet, the system keeps asking for username and password and finally
 fails. Any idea what could be wrong?

Make sure you comment out SimpleRealm interceptor if you use JDBCRealm.
I accidentally left in both interceptors on one server and it did the
very same thing... JDBCRealm log messages said that authentication
was successful but it still displayed an error page.

Did it help?

with best wishes,
Taavi





RE: jdbcRealm problem

2001-08-06 Thread Michael Wentzel

Check your Remote User, User Principal and Auth Type header values 
and see if they are getting set after the authorization call.  If
not this could be the problem.  If this is the case I would suggest
putting some additional debug code in JDBCRealm and recompiling it
(or using a debugger) to figure out where everything's going wrong.

Also, do you have any roles set up or are your constraints global?


---
Michael Wentzel
Software Developer
Software As We Think - http://www.aswethink.com