Simple DBCP Conf Question

2005-04-13 Thread Jeff Sexton
I have some questions about the connection pool parameters.
I wonder if someone could give me a quick sketch of the relationship between 
minEvictableIdleTimeMillis and removeAbandonedTimeout ?

I'd like to setup my application so that all connections in a pool are closed during 
times of no activity at all.  Is that the implication of setting maxIdle to zero? 
And how do the timeout parameters allow me to define completely idle periods, like 
off hours when everyone has gone home and the applications are not being used?

Thanks!
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Sybase and Tomcat 5, Possible Problem

2004-06-18 Thread Jeff Sexton
After a lot of effort, I feel there may be some reason that the Sybase
JConnect JDBC driver doesn't work in Tomcat 5.0.24 (I use Tomcat 4 for my
Sybase driven apps quite a bit).
The exception is:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class '' for connect URL 'null', cause: null

META-INF/context.xml is:
  Context path=/forteCommon docBase=forteCommon reloadable=true
  ResourceLink name=jdbc/odsdb03 global=jdbc/odsdb03
type=javax.sql.DataSource/
  /Context
From conf/server.xml contains:
  GlobalNamingResources
Resource name=jdbc/odsdb03
  auth=Container
  type=javax.sql.DataSource/
ResourceParams name=jdbc/odsdb03
  parameter
namefactory/name
valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
  /parameter
  parameter
nameusername/name
valueexcalibur/value
  /parameter
  parameter
namepassword/name
valuemypassword/value
  /parameter
  parameter
namedriverClassName/name
valuecom.sybase.jdbc2.jdbc.SybDriver/value
  /parameter
   parameter
 namedriverName/name
 valuejdbc:sybase:Tds:pdxax12:4100/value
   /parameter
  parameter
nameurl/name
valuejdbc:sybase:Tds:pdxax12:4100/value
  /parameter
  parameter
namemaxActive/name
value5/value
  /parameter
/ResourceParams 
  /GlobalNamingResources
web.xml contains:
web-app
servlet
servlet-name
ProvCICS
/servlet-name
servlet-class
com.ods.forte.cics.servlet.ProvCICS
/servlet-class
load-on-startup1/load-on-startup
/servlet
servlet-mapping
  servlet-nameProvCICS/servlet-name
  url-pattern/ProvCICS/url-pattern
/servlet-mapping
resource-ref
  descriptionodsdb03 Connection Pool/description
  res-ref-namejdbc/odsdb03/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
/resource-ref
/web-app
I have also tried working with the context placed in server.xml
and with the Resource defined in the context, all combinations
yield the same behavior.
*Tomcat does actually log into the database server when it starts*
I can see it from the database side.  Therefore I know the jdbc
jar file is loaded and the connection specification correct and working.
In addition, the stack trace in catalina.out includes a point
in Sybase code:
Cannot create JDBC driver of class '' for connect URL 'null'
java.lang.NullPointerException
at com.sybase.jdbc2.jdbc.SybDriver.acceptsURL(SybDriver.java:197)
at java.sql.DriverManager.getDriver(DriverManager.java:249)
at 
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
...

So can I conclude that the app is actually linked to the resource?  If
so then the problem seems to be that the information required somehow
does not reach down the driver?
Ideas?
Should I rollback to TC 4x for awhile?
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat 5 Database Connections

2004-06-18 Thread Jeff Sexton
This is part question and part observation regarding database
connectivity under Tomcat (5.0.24).
My application normally runs in production at my company on a
Tomcat 4.0.4 server.  The applications includes Cocoon and access
to several databases (Sybase) via both Tomcat connections from
servlets and from Cocoon XSP pages.  I've been at this for awhile
now and I'm a huge fan of Tomcat (and Cocoon).
On a new test server I setup Tomcat 5.0.24 and installed my
applications.  For sometime I thought all was well because
most of my stuff is Cocoon driven, and it's fine, including
database connectivity.
This week I realized that my servlets are getting:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of 
class ''
for connect URL 'null', cause: null

I've spent several days now trying to fix this.  I've read verious posts
from this list's archive, and several other places.  I've studied
many examples, and done google after google on it.
My conclusion is that for whatever reason *a lot* of people have
this trouble with TC 5x.  However there are very few solutions.
Yes, my jdbc jar file is in common/lib (and WEB-INF/lib, both).
Yes, I've tried declarations in GlobalNamingResources and in the apps
context, either.  Yes web.xml contains a resource-ref with the
same res-ref-name.  The only thing I have not done is to create
a META-INF/context.xml (is defining these resources in server.xml
simply broken?).
I'm dead stopped on this - yet I have no trouble at all with Tomcat
4.0.4.
It seems like some people do get this to work.  It seems like many,
many people do not.  Is there a bug at play in all this?
Here's my question - Why is it so hard?
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Sybase and Tomcat 5, Possible Problem

2004-06-18 Thread Jeff Sexton
Shapira, Yoav wrote:
Hi,
Hmm... It's good you can verify the login on the DB side.  You should
try to debug this in tomcat 5 rather than rolling back, if possible.
Where is the driver jar located in your server?
I've been trying to stick with common/lib.  That seems to work.
Since I was able to get a version 4.1.30 to work, I started over,
using those elements, on the 5.0.24 server.  I was able to get the
5.0.24 server to work this time!  Not sure why, however.
I imagine that the original exception was a red herring and my problem
was really some misplaced tags or typo.  I guess.  It all still
seems much harder than it should be.  But once it works, it's rock
solid.
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat 5 Database Connections

2004-06-17 Thread Jeff Sexton
This is part question and part observation regarding database
connectivity under Tomcat (5.0.24).
My application normally runs in production at my company on a
Tomcat 4.0.4 server.  The applications includes Cocoon and access
to several databases (Sybase) via both Tomcat connections from
servlets and from Cocoon XSP pages.  I've been at this for awhile
now and I'm a huge fan of Tomcat (and Cocoon).
On a new test server I setup Tomcat 5.0.24 and installed my
applications.  For sometime I thought all was well because
most of my stuff is Cocoon driven, and it's fine, including
database connectivity.
This week I realized that my servlets are getting:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class ''
for connect URL 'null', cause: null
I've spent several days now trying to fix this.  I've read verious posts
from this list's archive, and several other places.  I've studied
many examples, and done google after google on it.
My conclusion is that for whatever reason *a lot* of people have
this trouble with TC 5x.  However there are very few solutions.
Yes, my jdbc jar file is in common/lib (and WEB-INF/lib, both).
Yes, I've tried declarations in GlobalNamingResources and in the apps
context, either.  Yes web.xml contains a resource-ref with the
same res-ref-name.  The only thing I have not done is to create
a META-INF/context.xml (is defining these resources in server.xml
simply broken?).
I'm dead stopped on this - yet I have no trouble at all with Tomcat
4.0.4.
It seems like some people do get this to work.  It seems like many,
many people do not.  Is there a bug at play in all this?
Here's my question - Why is it so hard?
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Sybase and Tomcat 5, Possible Problem

2004-06-17 Thread Jeff Sexton
After a lot of effort, I feel there may be some reason that the Sybase
JConnect JDBC driver doesn't work in Tomcat 5.0.24 (I use Tomcat 4 for my
Sybase driven apps quite a bit).
The exception is:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class '' for connect URL 'null', cause: null
META-INF/context.xml is:
   Context path=/forteCommon docBase=forteCommon reloadable=true
   ResourceLink name=jdbc/odsdb03 global=jdbc/odsdb03
 type=javax.sql.DataSource/
   /Context
 From conf/server.xml contains:
   GlobalNamingResources
 Resource name=jdbc/odsdb03
   auth=Container
   type=javax.sql.DataSource/
 ResourceParams name=jdbc/odsdb03
   parameter
 namefactory/name
 valueorg.apache.commons.dbcp.BasicDataSourceFactory/value
   /parameter
   parameter
 nameusername/name
 valueexcalibur/value
   /parameter
   parameter
 namepassword/name
 valuemypassword/value
   /parameter
   parameter
 namedriverClassName/name
 valuecom.sybase.jdbc2.jdbc.SybDriver/value
   /parameter
parameter
  namedriverName/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter
   parameter
 nameurl/name
 valuejdbc:sybase:Tds:pdxax12:4100/value
   /parameter
   parameter
 namemaxActive/name
 value5/value
   /parameter
 /ResourceParams 
   /GlobalNamingResources
web.xml contains:
web-app
 servlet
 servlet-name
 ProvCICS
 /servlet-name
 servlet-class
 com.ods.forte.cics.servlet.ProvCICS
 /servlet-class
 load-on-startup1/load-on-startup
 /servlet
 servlet-mapping
   servlet-nameProvCICS/servlet-name
   url-pattern/ProvCICS/url-pattern
 /servlet-mapping
 resource-ref
   descriptionodsdb03 Connection Pool/description
   res-ref-namejdbc/odsdb03/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
 /resource-ref
/web-app
I have also tried working with the context placed in server.xml
and with the Resource defined in the context, all combinations
yield the same behavior.
*Tomcat does actually log into the database server when it starts*
I can see it from the database side.  Therefore I know the jdbc
jar file is loaded and the connection specification correct and working.
In addition, the stack trace in catalina.out includes a point
in Sybase code:
Cannot create JDBC driver of class '' for connect URL 'null'
java.lang.NullPointerException
 at com.sybase.jdbc2.jdbc.SybDriver.acceptsURL(SybDriver.java:197)
 at java.sql.DriverManager.getDriver(DriverManager.java:249)
 at
org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:743)
 ...
So can I conclude that the app is actually linked to the resource?  If
so then the problem seems to be that the information required somehow
does not reach down the driver?
Ideas?
Should I rollback to TC 4x for awhile?
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat 5 Database Connections

2004-06-17 Thread Jeff Sexton
Graham Leggett wrote:
Jeff Sexton wrote:
This week I realized that my servlets are getting:
org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of
class ''
for connect URL 'null', cause: null

As a test, try the binary package as provided by Jakarta for tomcat 
(unless of course you are already doing so).

In my case, the binary Jakarta supplied package v5.0.19 works, whereas 
the jpackage RPM of tomcat v5.0.19 does not. Same config.
Wierd.
I'm working with the binary for 5.0.24.  Maybe I should try 5.0.19.
One thing I did not mention is that I am doing this on AIX, but that
doesn't seem like a factor (?).  Whatever's going wrong *seems* to
all be in the Tomcat world.
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat 5 Database Connections

2004-06-17 Thread Jeff Sexton
Graham Leggett wrote:
I think it's definitely tomcat - my environment is Postgresql on Redhat 
Enterprise and am getting the same thing.
Dang, that's not good...  I really like other things about the recent
releases.
But I have to agree.  I just changed my java to call for a bogus resource
name.  The exception changed to no such resource in the context exactly as
expected.
So that's that.  The server is connecting the database, and the app is
looking up and finding the resource.  But somehow the information needed
to create the connection doesn't get through.
Could there even be a work around?  I mean other than re-writing my
java to connect to the database on its own...
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat 5 Database Connections

2004-06-17 Thread Jeff Sexton
Is the order of elements in the ResourceParams block
meaningful?  Rightly or wrongly meaningful that is...
I keep looking for some way to understand way this seems to
work for some people.
Jeff Sexton wrote:
Graham Leggett wrote:
I think it's definitely tomcat - my environment is Postgresql on 
Redhat Enterprise and am getting the same thing.

Dang, that's not good...  I really like other things about the recent
releases.
But I have to agree.  I just changed my java to call for a bogus resource
name.  The exception changed to no such resource in the context 
exactly as
expected.

So that's that.  The server is connecting the database, and the app is
looking up and finding the resource.  But somehow the information needed
to create the connection doesn't get through.
Could there even be a work around?  I mean other than re-writing my
java to connect to the database on its own...

--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Tomcat 5 Database Connections - from wierd to crazy

2004-06-17 Thread Jeff Sexton
I switched from TC 5 to Tomcat 4.1.30 and again copied my
(working) app again from the Tomcat 4.0.4 install.  This
time, it knew the driver but not the url.  So in server.xml
I changed one parameter
From:
parameter
  namedriverName/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter !-- Works in 4.0.4 --
To:
parameter
  nameurl/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter
That cured the no url exception.  However now I get this exception:
org.apache.commons.dbcp.SQLNestedException: Cannot create 
PoolableConnectionFactory, cause: JZ004: User name property missing in 
DriverManager.getConnection(..., Properties).

Here's the whole context entry from server.xml:
Context path=/forteCommon docBase=forteCommon 
reloadable=true
 Resource name=jdbc/odsdb03 auth=Container
type=javax.sql.DataSource/
  ResourceParams name=jdbc/odsdb03
parameter
  nameuser/namevalueexcalibur/value
/parameter
parameter
  namepassword/namevaluepassword/value
/parameter
parameter
  namedriverClassName/name
  valuecom.sybase.jdbc2.jdbc.SybDriver/value
/parameter
parameter
  nameurl/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter
  /ResourceParams
/Context

I think I'm losing my mind.
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Tomcat 5 Database Connections - from wierd to crazy

2004-06-17 Thread Jeff Sexton
Jeff Sexton wrote:
I switched from TC 5 to Tomcat 4.1.30 and again copied my
(working) app again from the Tomcat 4.0.4 install.  This
time, it knew the driver but not the url.  So in server.xml
I changed one parameter
From:
parameter
  namedriverName/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter !-- Works in 4.0.4 --
To:
parameter
  nameurl/name
  valuejdbc:sybase:Tds:pdxax12:4100/value
/parameter
That cured the no url exception.  However now I get this exception:
org.apache.commons.dbcp.SQLNestedException: Cannot create 
PoolableConnectionFactory, cause: JZ004: User name property missing in 
DriverManager.getConnection(..., Properties).
Changing this 4.0.4 version entry
 parameter
   nameuser/namevalueexcalibur/value
 /parameter
to this:
 parameter
   nameusername/name
   valueexcalibur/value
 /parameter
Allows 4.1.30 to work perfectly!  So to sum up for now, 4.0.4 works
for my app and 4.1.3 works if I change two entries in the resource.
Still no luck with 5.0.24 though.
--
The ODS Companies
Jeff Sexton
Information Services
(503) 228-6554   x1026
http://www.odscompanies.com
This message is intended for the sole use of the individual and entity
to whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose
or distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Alternate password encyption code?

2003-06-05 Thread Jeff Sexton

Nice!  Thanks!


Jeff Sexton
The ODS Companies
[EMAIL PROTECTED]


On Tue, 3 Jun 2003, Extance, Paul wrote:
 We've already done this as part of the Jaffa (jaffa.sourceforge.net) open
 source project. For more details see...

 The Source Code @
 http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jaffa/JaffaCore/source/java/o
 rg/jaffa/tomcat/realm/JDBCEncryptionRealm.java?rev=HEADcontent-type=text/vn
 d.viewcvs-markup

 The Jaffa Site @ http://jaffa.sf.net

 The JAR, if you want the easy way... is attached!

 This has been tested with most tomcat releases from 3.3a upto 4.1.24 and
 works. It supports two types of encryption signatures

 String xxx(String password) and
 String xxx(String password, String Userid) in case you want to use their
 user id as part of the key for the encryption

 You provide the class name and the method name in server.xml, and it looks
 for either method 1 or 2 and uses that to encrypt the password, before
 comparing it with the one in the database. It does not try to decrypt the
 database password, so a one way encryption algorithm can be supported.

 This Realm also allow you some other features like extending the where
 clause for the retrieve on user records, and the select for how to read the
 roles (incase you don't want to create additional views!)

 An example of how it can be used in server.xml is...

 Realm
 className  = org.jaffa.tomcat.realm.JDBCEncryptionRealm
 debug  = 0
 driverName = oracle.jdbc.driver.OracleDriver
 connectionURL  = jdbc:oracle:thin:@myhost.mydomain.com:1521:mydb
 connectionName = mydbuser
 connectionPassword = mydbpass
 userTable  = users
 userNameCol= user_id
 userCredCol= password
 userClause = password is not null and user_status='Active'
 userRoleTable  = user_roles
 roleNameCol= role_name
 encryptionClass= com.mycompany.services.Encryption
 encryptionMethod   = encrypt
 /

 Just make sure you but the attached JAR, and your JAR in the /server/lib
 directory, and put the database driver JAR(s) in the same place or in
 /common/lib

 Hope this helps...

 Paul Extance

 -Original Message-
 From: Phil Steitz [mailto:[EMAIL PROTECTED]
 Sent: Saturday, May 31, 2003 9:25 AM
 To: Tomcat Users List
 Subject: Re: Alternate password encyption code?

 Jeff Sexton wrote:
  On Thu, 29 May 2003, Raible, Matt wrote:
 
 Why don't you just have the JDBCRealm do it - add digest=SHA.
 
 
  I need something other than SHA, I need to use my own custom code for an
  encyrption method of my own that is not provided by JDBCRealm
 
 
 To programmatically do it using form-based authentication, I've used a
 LoginServlet that's mapped to auth in my login.jsp's form.  In this
 servlet, I encrypt the password and redirect to j_security_check - is
 that
 what you're looking for?
 
 
  Maybe.  I'll do some reading about form-based authentication.  I'm not
  sure.
 
  I'm after this because I already have set up a JDBCRealm based system,
  with BASIC authentication, and SHA, under Tomcat for both servlets and
  cocoon stuff.  Now I want to tie this together with another application
  that encypts passwords differently from any method available in JDBCRealm.
 
  I have the code for the encyption.  If I could simply drop this code into
  the user validation JDBCRealm does for me in Tomcat, it'd be great because
  the security would all work and I wouldn't have to create any
  user/password management pages of my own.

 Based on the documentation here

 http://jakarta.apache.org/tomcat/tomcat-4.1-doc/realm-howto.html#Digested%20
 Passwords

 and a quick look at the sources here

 http://cvs.apache.org/viewcvs.cgi/*checkout*/jakarta-tomcat-4.0/catalina/src
 /
 share/org/apache/catalina/realm/JDBCRealm.java?rev=HEADcontent-type=text/pl
 ain

 it does not look to me like you are going to be able to do this without
 hacking the JDBC Realm implementation.  The tomcat JDBC Realm
 implementation supports digested (*not* encrytped) passwords using
 java.security.MessageDigest to do the hashing.  This means that the
 hashing must be performed using one of the standard algorithms specified
 here
 http://java.sun.com/j2se/1.4.1/docs/guide/security/CryptoSpec.html#AppA

 You are probably best off going with one of the approaches that Matt has
 outlined if you want to serve login pages from the tomcat nodes.


 Phil



 
  If I can do this, I can tie Tomcat authentication to the password system
  my company has on other systems.
 
  Any tips are helpful!  I'm a little lost with this.
 
 
  -
  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

Alternate password encyption code?

2003-05-30 Thread Jeff Sexton

I need to use my own bit of java to encrypt passwords for a JDBCRealm.  I
have no idea what approach is best to take with this, anyone have any
suggestions?

Thanks


Jeff Sexton
The ODS Companies
[EMAIL PROTECTED]



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



RE: Alternate password encyption code?

2003-05-30 Thread Jeff Sexton


On Thu, 29 May 2003, Raible, Matt wrote:
 Here's how I do it - and I generally use SHA as my algorithm:


Thanks, but my question is really related to the setup - I have the code I
want to use for the encyrption, but I'm not sure how to tie it in with the
existing JDBCRealm mechanism.

How did you do that?  A custom realm class?


 -Original Message-
 From: Jeff Sexton [mailto:[EMAIL PROTECTED]
 Sent: Thursday, May 29, 2003 4:25 PM
 To: [EMAIL PROTECTED]
 Subject: Alternate password encyption code?



 I need to use my own bit of java to encrypt passwords for a JDBCRealm.  I
 have no idea what approach is best to take with this, anyone have any
 suggestions?

 Thanks


 Jeff Sexton
 The ODS Companies
 [EMAIL PROTECTED]



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



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



RE: Alternate password encyption code?

2003-05-30 Thread Jeff Sexton

On Thu, 29 May 2003, Raible, Matt wrote:
 Why don't you just have the JDBCRealm do it - add digest=SHA.

I need something other than SHA, I need to use my own custom code for an
encyrption method of my own that is not provided by JDBCRealm

 To programmatically do it using form-based authentication, I've used a
 LoginServlet that's mapped to auth in my login.jsp's form.  In this
 servlet, I encrypt the password and redirect to j_security_check - is that
 what you're looking for?

Maybe.  I'll do some reading about form-based authentication.  I'm not
sure.

I'm after this because I already have set up a JDBCRealm based system,
with BASIC authentication, and SHA, under Tomcat for both servlets and
cocoon stuff.  Now I want to tie this together with another application
that encypts passwords differently from any method available in JDBCRealm.

I have the code for the encyption.  If I could simply drop this code into
the user validation JDBCRealm does for me in Tomcat, it'd be great because
the security would all work and I wouldn't have to create any
user/password management pages of my own.

If I can do this, I can tie Tomcat authentication to the password system
my company has on other systems.

Any tips are helpful!  I'm a little lost with this.


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



RE: listen on two ports simultaneously - related question

2003-03-13 Thread Jeff Sexton

Along these lines, today I tried to start two instances of Tomcat 4.0.4 on
one box.  I changed the shutdown port and the http port but the second
server to start still failed with 'port in use'.

Can anyone tell me what other ports tomcat listens at?

PS - yes I know starting two 4.0.4 Tomcats in a strange thing to do, it's
a long story

Thanks!


 -Original Message-
 From: Marina McGale [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 13, 2003 9:43 AM
 To: [EMAIL PROTECTED]
 Subject: Can Tomcat 4 be configured to listen on two ports
 simultaneously


 Hi.
 I am using Tomcat 4.1.12 and would like it to listen on both port 80 and
 8080 because I have already sent out URLs with 8080 in them but want to
 remove the 8080 for the future (and still want everyone to be able to
 access my apps).  I had tried adding another Connector for port 80 for
 Tomcat running stand-alone in the server.xml file (so there are two
 Connectors - one each for port 80 and 8080) and it worked on my
 localhost (Windows) machine but not when I tried the same thing on
 Redhat 8.  I do not have Apache running so there is no conflict between
 it and Tomcat trying to listen on the same port.


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