You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pedro <ps...@gmail.com> on 2007/10/25 15:03:22 UTC

JDBC Realm with case insensitive user name

Hi all,

I basically need to implement case insensitive user names, can this be 
done with a servlet filter or do I need to subclass JDBC realm:

public class CustomJdbcRealm extends JDBCRealm {

      public CustomJdbcRealm() {
       super();
      }
     
      public Principal authenticate(String username, String credentials) {
        return super.authenticate(username.toLowerCase(), credentials);
        }
}

And in server.xml:
<Realm className="mypackage.CustomJdbcRealm" ...>

I tried this approach but get class not found exceptions, I am using 
tomcat6 in development and 5.5 in production. I package this class in a 
jar and drop it in the $CATALENA_BASE/server/lib folder.

Thanks
Peter

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Pedro <ps...@gmail.com>.
Hi Christopher,

I knew that MySql does this, but I am using Postgres for this project 
and don't know if it is possible, the default is case sensitive for 
Postgres. 

The unique key option is out, as it has to be an id field for our 
database beans to work, but a unique constraint is possible I guess... 
maybe worth looking at!

Thanks
Peter

Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Pedro,
>
> Pedro wrote:
>   
>> I basically need to implement case insensitive user names, can this be
>> done with a servlet filter or do I need to subclass JDBC realm:
>>     
>
> Er, before you get too far on this, check to see if your database
> already does this without you realizing that it does.
>
> For instance, MySQL does case-insensitive VARCHAR and CHAR lookups
> unless the column type is marked BINARY or you cast the type to BINARY
> in your SQL query.
>
> For instance, 'chris' = 'CHRIS' in MySQL inder normal circumstances.
>
> Primary and unique keys respect this behavior, too, so I can't have
> "chris" and "CHRIS" as two separate usernames in my user table where
> "username" is a UNIQUE key.
>
> You might be able to save yourself a lot of trouble.
>
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.7 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHIQru9CaO5/Lv0PARAkV6AJ9eBvJFTb8HCA5lL/6iU17AVF4DyQCgoDWg
> TA5RHoInDsnxkDSqILJiYvI=
> =J3qJ
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Pedro,

Pedro wrote:
> I basically need to implement case insensitive user names, can this be
> done with a servlet filter or do I need to subclass JDBC realm:

Er, before you get too far on this, check to see if your database
already does this without you realizing that it does.

For instance, MySQL does case-insensitive VARCHAR and CHAR lookups
unless the column type is marked BINARY or you cast the type to BINARY
in your SQL query.

For instance, 'chris' = 'CHRIS' in MySQL inder normal circumstances.

Primary and unique keys respect this behavior, too, so I can't have
"chris" and "CHRIS" as two separate usernames in my user table where
"username" is a UNIQUE key.

You might be able to save yourself a lot of trouble.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHIQru9CaO5/Lv0PARAkV6AJ9eBvJFTb8HCA5lL/6iU17AVF4DyQCgoDWg
TA5RHoInDsnxkDSqILJiYvI=
=J3qJ
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Re: JDBC Realm with case insensitive user name

Posted by Pid <p...@pidster.com>.
Pid wrote:
> Peter Stavrinides wrote:
>>> The most common reason...blah blah
>> You know pid, just because people ask questions doesn't mean they are
>> stupid, so why treat them that way? If you can read 'carefully' you can
>> notice that the path was given as well as the relevant config in
>> server.xml. So If the path was incorrect you could see it immediately, I
>> didn't write this because it seemed like a good idea, it was there for a
>> purpose.
>>
>>> That's a lot of attitude for someone who wants help from the list. Or am
>>> I misreading your tone?
>> You are not compelled to answer, in-fact it is preferred that you don't
>> answer questions if you are going to diverge off the actual problem,
>> because it side-tracks serious readers, as is becoming the case with
>> this question, and the likelihood of a solution being found is
>> diminished... can you understand the irritation??
> 
> erm, what?
> 
> did or did not the original question end with a query about packaging
> and class not found exceptions?
> 
> someone had already taken care of the case-sensitivity point, i was
> attempting to address the other one, as had Tim previously (who also got
> a sharpish response from the OP).

(who i'm now guessing is you)

> p
> 
> 
>> Pid wrote:
>>> Pedro wrote:
>>>  
>>>> OK PID then you tell me where the jar goes hey?
>>>>     
>>> That's a lot of attitude for someone who wants help from the list. Or am
>>> I misreading your tone?
>>>
>>> I refer to my previous question:
>>>
>>>  
>>>>> Perhaps you can elaborate on when you're getting this exception if
>>>>> we're
>>>>> to help you.
>>>>>       
>>> (An actual error message would also be useful.)
>>>
>>>
>>> You say you are using Tomcat 6 for development, and Tomcat 5.5 in
>>> production.  Is the error occurring in development or production?
>>>
>>> Which version of Tomcat are you compiling the classes against?  The
>>> internal class structure of Tomcat 6 is not guaranteed to be identical
>>> to Tomcat 5.5, so it's entirely possibly you're using a class that
>>> doesn't exist in 5.5, if you're compiling against 6 and deploying
>>> against 5.5.  (or vice versa).
>>>
>>> p
>>>
>>>
>>> {
>>>
>>> The most common reason that a ClassNotFoundException is encountered
>>> while mixing testing/deployment on different versions of Tomcat is that
>>> jars have been placed in the wrong location.
>>>
>>> List members usually offer up the obvious solutions first, because
>>> they're the most common solutions.  Especially given that one message is
>>> usually insufficient to determine what the users level of knowledge is.
>>>
>>> Fsck knows why I'm bothering to explain that though.
>>>
>>> }
>>>
>>>
>>>  
>>>>> p
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>  
>>>>>      
>>>>>> Tim Funk wrote:
>>>>>>           
>>>>>>> The dir structure changed from 5.5 to 6 so you need to place your
>>>>>>> files in different directories depending on the version. See the
>>>>>>> version specific docs details.
>>>>>>>
>>>>>>>
>>>>>>> -Tim
>>>>>>>
>>>>>>> Pedro wrote:
>>>>>>>               
>>>>>>>> Hi all,
>>>>>>>>
>>>>>>>> I basically need to implement case insensitive user names, can this
>>>>>>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>>>>>>
>>>>>>>> public class CustomJdbcRealm extends JDBCRealm {
>>>>>>>>
>>>>>>>>      public CustomJdbcRealm() {
>>>>>>>>       super();
>>>>>>>>      }
>>>>>>>>          public Principal authenticate(String username, String
>>>>>>>> credentials) {
>>>>>>>>        return super.authenticate(username.toLowerCase(),
>>>>>>>> credentials);
>>>>>>>>        }
>>>>>>>> }
>>>>>>>>
>>>>>>>> And in server.xml:
>>>>>>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>>>>>>
>>>>>>>> I tried this approach but get class not found exceptions, I am using
>>>>>>>> tomcat6 in development and 5.5 in production. I package this
>>>>>>>> class in
>>>>>>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>>>>>  
>>>>>>>>                     
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>                 
>>>>>> ---------------------------------------------------------------------
>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>             
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>         
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>     
>>>
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>   
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Re: JDBC Realm with case insensitive user name

Posted by Peter Stavrinides <ps...@gmail.com>.
David, you are also arrogant!! I know what I wrote, and I know where the 
classloader looks for things so Tims answer is irrelevant and so is 
yours given that I have placed the jar in the correct place already and 
configured server.xml correctly. You also lack basic reading skills if 
you cant see this.


David Smith wrote:
> Peter -- cool it.  As quoted from the OP below:
>
>> I tried this approach but get class not found exceptions, I am using
>> tomcat6 in development and 5.5 in production. I package this
>> class in
>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>
>
> Tim Funk actually (and correctly) asked the OP to read the docs.  I 
> would add that the dev system should be on the same version as the 
> production system.  To cross versions like this between development 
> and production is counter-productive.  $CATALINA_BASE/server/lib works 
> for 5.5, but not for 6.  In tomcat 6, it should be $CATALINA_BASE/lib 
> by default.
>
> --David
>
>
>
> Pid wrote:
>
>> Peter Stavrinides wrote:
>>  
>>
>>>> The most common reason...blah blah
>>>>     
>>> You know pid, just because people ask questions doesn't mean they are
>>> stupid, so why treat them that way? If you can read 'carefully' you can
>>> notice that the path was given as well as the relevant config in
>>> server.xml. So If the path was incorrect you could see it 
>>> immediately, I
>>> didn't write this because it seemed like a good idea, it was there 
>>> for a
>>> purpose.
>>>
>>>   
>>>> That's a lot of attitude for someone who wants help from the list. 
>>>> Or am
>>>> I misreading your tone?
>>>>     
>>> You are not compelled to answer, in-fact it is preferred that you don't
>>> answer questions if you are going to diverge off the actual problem,
>>> because it side-tracks serious readers, as is becoming the case with
>>> this question, and the likelihood of a solution being found is
>>> diminished... can you understand the irritation??
>>>   
>>
>> erm, what?
>>
>> did or did not the original question end with a query about packaging
>> and class not found exceptions?
>>
>> someone had already taken care of the case-sensitivity point, i was
>> attempting to address the other one, as had Tim previously (who also got
>> a sharpish response from the OP).
>>
>> p
>>
>>
>>  
>>
>>> Pid wrote:
>>>   
>>>> Pedro wrote:
>>>>
>>>>     
>>>>> OK PID then you tell me where the jar goes hey?
>>>>>          
>>>> That's a lot of attitude for someone who wants help from the list. 
>>>> Or am
>>>> I misreading your tone?
>>>>
>>>> I refer to my previous question:
>>>>
>>>>
>>>>     
>>>>>> Perhaps you can elaborate on when you're getting this exception if
>>>>>> we're
>>>>>> to help you.
>>>>>>              
>>>> (An actual error message would also be useful.)
>>>>
>>>>
>>>> You say you are using Tomcat 6 for development, and Tomcat 5.5 in
>>>> production.  Is the error occurring in development or production?
>>>>
>>>> Which version of Tomcat are you compiling the classes against?  The
>>>> internal class structure of Tomcat 6 is not guaranteed to be identical
>>>> to Tomcat 5.5, so it's entirely possibly you're using a class that
>>>> doesn't exist in 5.5, if you're compiling against 6 and deploying
>>>> against 5.5.  (or vice versa).
>>>>
>>>> p
>>>>
>>>>
>>>> {
>>>>
>>>> The most common reason that a ClassNotFoundException is encountered
>>>> while mixing testing/deployment on different versions of Tomcat is 
>>>> that
>>>> jars have been placed in the wrong location.
>>>>
>>>> List members usually offer up the obvious solutions first, because
>>>> they're the most common solutions.  Especially given that one 
>>>> message is
>>>> usually insufficient to determine what the users level of knowledge 
>>>> is.
>>>>
>>>> Fsck knows why I'm bothering to explain that though.
>>>>
>>>> }
>>>>
>>>>
>>>>
>>>>     
>>>>>> p
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>>> Tim Funk wrote:
>>>>>>>                    
>>>>>>>> The dir structure changed from 5.5 to 6 so you need to place your
>>>>>>>> files in different directories depending on the version. See the
>>>>>>>> version specific docs details.
>>>>>>>>
>>>>>>>>
>>>>>>>> -Tim
>>>>>>>>
>>>>>>>> Pedro wrote:
>>>>>>>>                          
>>>>>>>>> Hi all,
>>>>>>>>>
>>>>>>>>> I basically need to implement case insensitive user names, can 
>>>>>>>>> this
>>>>>>>>> be done with a servlet filter or do I need to subclass JDBC 
>>>>>>>>> realm:
>>>>>>>>>
>>>>>>>>> public class CustomJdbcRealm extends JDBCRealm {
>>>>>>>>>
>>>>>>>>>     public CustomJdbcRealm() {
>>>>>>>>>      super();
>>>>>>>>>     }
>>>>>>>>>         public Principal authenticate(String username, String
>>>>>>>>> credentials) {
>>>>>>>>>       return super.authenticate(username.toLowerCase(),
>>>>>>>>> credentials);
>>>>>>>>>       }
>>>>>>>>> }
>>>>>>>>>
>>>>>>>>> And in server.xml:
>>>>>>>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>>>>>>>
>>>>>>>>> I tried this approach but get class not found exceptions, I am 
>>>>>>>>> using
>>>>>>>>> tomcat6 in development and 5.5 in production. I package this
>>>>>>>>> class in
>>>>>>>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>>>>>>
>>>>>>>>>                                  
>>>>>>>> --------------------------------------------------------------------- 
>>>>>>>>
>>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>>
>>>>>>>>
>>>>>>>>                            
>>>>>>> --------------------------------------------------------------------- 
>>>>>>>
>>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>                      
>>>>>> --------------------------------------------------------------------- 
>>>>>>
>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>                
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>          
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>  
>>>>     
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>   
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>  
>>
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Re: JDBC Realm with case insensitive user name

Posted by David Smith <dn...@cornell.edu>.
Peter -- cool it.  As quoted from the OP below:

>I tried this approach but get class not found exceptions, I am using
>tomcat6 in development and 5.5 in production. I package this
>class in
>a jar and drop it in the $CATALENA_BASE/server/lib folder.
>

Tim Funk actually (and correctly) asked the OP to read the docs.  I 
would add that the dev system should be on the same version as the 
production system.  To cross versions like this between development and 
production is counter-productive.  $CATALINA_BASE/server/lib works for 
5.5, but not for 6.  In tomcat 6, it should be $CATALINA_BASE/lib by 
default.

--David



Pid wrote:

>Peter Stavrinides wrote:
>  
>
>>>The most common reason...blah blah
>>>      
>>>
>>You know pid, just because people ask questions doesn't mean they are
>>stupid, so why treat them that way? If you can read 'carefully' you can
>>notice that the path was given as well as the relevant config in
>>server.xml. So If the path was incorrect you could see it immediately, I
>>didn't write this because it seemed like a good idea, it was there for a
>>purpose.
>>
>>    
>>
>>>That's a lot of attitude for someone who wants help from the list. Or am
>>>I misreading your tone?
>>>      
>>>
>>You are not compelled to answer, in-fact it is preferred that you don't
>>answer questions if you are going to diverge off the actual problem,
>>because it side-tracks serious readers, as is becoming the case with
>>this question, and the likelihood of a solution being found is
>>diminished... can you understand the irritation??
>>    
>>
>
>erm, what?
>
>did or did not the original question end with a query about packaging
>and class not found exceptions?
>
>someone had already taken care of the case-sensitivity point, i was
>attempting to address the other one, as had Tim previously (who also got
>a sharpish response from the OP).
>
>p
>
>
>  
>
>>Pid wrote:
>>    
>>
>>>Pedro wrote:
>>> 
>>>      
>>>
>>>>OK PID then you tell me where the jar goes hey?
>>>>    
>>>>        
>>>>
>>>That's a lot of attitude for someone who wants help from the list. Or am
>>>I misreading your tone?
>>>
>>>I refer to my previous question:
>>>
>>> 
>>>      
>>>
>>>>>Perhaps you can elaborate on when you're getting this exception if
>>>>>we're
>>>>>to help you.
>>>>>      
>>>>>          
>>>>>
>>>(An actual error message would also be useful.)
>>>
>>>
>>>You say you are using Tomcat 6 for development, and Tomcat 5.5 in
>>>production.  Is the error occurring in development or production?
>>>
>>>Which version of Tomcat are you compiling the classes against?  The
>>>internal class structure of Tomcat 6 is not guaranteed to be identical
>>>to Tomcat 5.5, so it's entirely possibly you're using a class that
>>>doesn't exist in 5.5, if you're compiling against 6 and deploying
>>>against 5.5.  (or vice versa).
>>>
>>>p
>>>
>>>
>>>{
>>>
>>>The most common reason that a ClassNotFoundException is encountered
>>>while mixing testing/deployment on different versions of Tomcat is that
>>>jars have been placed in the wrong location.
>>>
>>>List members usually offer up the obvious solutions first, because
>>>they're the most common solutions.  Especially given that one message is
>>>usually insufficient to determine what the users level of knowledge is.
>>>
>>>Fsck knows why I'm bothering to explain that though.
>>>
>>>}
>>>
>>>
>>> 
>>>      
>>>
>>>>>p
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 
>>>>>     
>>>>>          
>>>>>
>>>>>>Tim Funk wrote:
>>>>>>          
>>>>>>            
>>>>>>
>>>>>>>The dir structure changed from 5.5 to 6 so you need to place your
>>>>>>>files in different directories depending on the version. See the
>>>>>>>version specific docs details.
>>>>>>>
>>>>>>>
>>>>>>>-Tim
>>>>>>>
>>>>>>>Pedro wrote:
>>>>>>>              
>>>>>>>              
>>>>>>>
>>>>>>>>Hi all,
>>>>>>>>
>>>>>>>>I basically need to implement case insensitive user names, can this
>>>>>>>>be done with a servlet filter or do I need to subclass JDBC realm:
>>>>>>>>
>>>>>>>>public class CustomJdbcRealm extends JDBCRealm {
>>>>>>>>
>>>>>>>>     public CustomJdbcRealm() {
>>>>>>>>      super();
>>>>>>>>     }
>>>>>>>>         public Principal authenticate(String username, String
>>>>>>>>credentials) {
>>>>>>>>       return super.authenticate(username.toLowerCase(),
>>>>>>>>credentials);
>>>>>>>>       }
>>>>>>>>}
>>>>>>>>
>>>>>>>>And in server.xml:
>>>>>>>><Realm className="mypackage.CustomJdbcRealm" ...>
>>>>>>>>
>>>>>>>>I tried this approach but get class not found exceptions, I am using
>>>>>>>>tomcat6 in development and 5.5 in production. I package this
>>>>>>>>class in
>>>>>>>>a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>>>>> 
>>>>>>>>                    
>>>>>>>>                
>>>>>>>>
>>>>>>>---------------------------------------------------------------------
>>>>>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>>
>>>>>>>
>>>>>>>                
>>>>>>>              
>>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>            
>>>>>>            
>>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>        
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>    
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To start a new topic, e-mail: users@tomcat.apache.org
>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>  
>>>      
>>>
>>---------------------------------------------------------------------
>>To start a new topic, e-mail: users@tomcat.apache.org
>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


[OT] Re: JDBC Realm with case insensitive user name

Posted by Pid <p...@pidster.com>.
Peter Stavrinides wrote:
>>The most common reason...blah blah
> 
> You know pid, just because people ask questions doesn't mean they are
> stupid, so why treat them that way? If you can read 'carefully' you can
> notice that the path was given as well as the relevant config in
> server.xml. So If the path was incorrect you could see it immediately, I
> didn't write this because it seemed like a good idea, it was there for a
> purpose.
>
>> That's a lot of attitude for someone who wants help from the list. Or am
>> I misreading your tone?
> 
> You are not compelled to answer, in-fact it is preferred that you don't
> answer questions if you are going to diverge off the actual problem,
> because it side-tracks serious readers, as is becoming the case with
> this question, and the likelihood of a solution being found is
> diminished... can you understand the irritation??

erm, what?

did or did not the original question end with a query about packaging
and class not found exceptions?

someone had already taken care of the case-sensitivity point, i was
attempting to address the other one, as had Tim previously (who also got
a sharpish response from the OP).

p


> Pid wrote:
>> Pedro wrote:
>>  
>>> OK PID then you tell me where the jar goes hey?
>>>     
>>
>> That's a lot of attitude for someone who wants help from the list. Or am
>> I misreading your tone?
>>
>> I refer to my previous question:
>>
>>  
>>>> Perhaps you can elaborate on when you're getting this exception if
>>>> we're
>>>> to help you.
>>>>       
>>
>> (An actual error message would also be useful.)
>>
>>
>> You say you are using Tomcat 6 for development, and Tomcat 5.5 in
>> production.  Is the error occurring in development or production?
>>
>> Which version of Tomcat are you compiling the classes against?  The
>> internal class structure of Tomcat 6 is not guaranteed to be identical
>> to Tomcat 5.5, so it's entirely possibly you're using a class that
>> doesn't exist in 5.5, if you're compiling against 6 and deploying
>> against 5.5.  (or vice versa).
>>
>> p
>>
>>
>> {
>>
>> The most common reason that a ClassNotFoundException is encountered
>> while mixing testing/deployment on different versions of Tomcat is that
>> jars have been placed in the wrong location.
>>
>> List members usually offer up the obvious solutions first, because
>> they're the most common solutions.  Especially given that one message is
>> usually insufficient to determine what the users level of knowledge is.
>>
>> Fsck knows why I'm bothering to explain that though.
>>
>> }
>>
>>
>>  
>>>> p
>>>>
>>>>
>>>>
>>>>
>>>>  
>>>>      
>>>>> Tim Funk wrote:
>>>>>           
>>>>>> The dir structure changed from 5.5 to 6 so you need to place your
>>>>>> files in different directories depending on the version. See the
>>>>>> version specific docs details.
>>>>>>
>>>>>>
>>>>>> -Tim
>>>>>>
>>>>>> Pedro wrote:
>>>>>>               
>>>>>>> Hi all,
>>>>>>>
>>>>>>> I basically need to implement case insensitive user names, can this
>>>>>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>>>>>
>>>>>>> public class CustomJdbcRealm extends JDBCRealm {
>>>>>>>
>>>>>>>      public CustomJdbcRealm() {
>>>>>>>       super();
>>>>>>>      }
>>>>>>>          public Principal authenticate(String username, String
>>>>>>> credentials) {
>>>>>>>        return super.authenticate(username.toLowerCase(),
>>>>>>> credentials);
>>>>>>>        }
>>>>>>> }
>>>>>>>
>>>>>>> And in server.xml:
>>>>>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>>>>>
>>>>>>> I tried this approach but get class not found exceptions, I am using
>>>>>>> tomcat6 in development and 5.5 in production. I package this
>>>>>>> class in
>>>>>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>>>>  
>>>>>>>                     
>>>>>> ---------------------------------------------------------------------
>>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>                 
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>             
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>         
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>     
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Peter Stavrinides <ps...@gmail.com>.
 >The most common reason...blah blah
 
You know pid, just because people ask questions doesn't mean they are 
stupid, so why treat them that way? If you can read 'carefully' you can 
notice that the path was given as well as the relevant config in 
server.xml. So If the path was incorrect you could see it immediately, I 
didn't write this because it seemed like a good idea, it was there for a 
purpose.

>That's a lot of attitude for someone who wants help from the list. Or am
>I misreading your tone?

You are not compelled to answer, in-fact it is preferred that you don't 
answer questions if you are going to diverge off the actual problem, 
because it side-tracks serious readers, as is becoming the case with 
this question, and the likelihood of a solution being found is 
diminished... can you understand the irritation??

Pid wrote:
> Pedro wrote:
>   
>> OK PID then you tell me where the jar goes hey?
>>     
>
> That's a lot of attitude for someone who wants help from the list. Or am
> I misreading your tone?
>
> I refer to my previous question:
>
>   
>>> Perhaps you can elaborate on when you're getting this exception if we're
>>> to help you.
>>>       
>
> (An actual error message would also be useful.)
>
>
> You say you are using Tomcat 6 for development, and Tomcat 5.5 in
> production.  Is the error occurring in development or production?
>
> Which version of Tomcat are you compiling the classes against?  The
> internal class structure of Tomcat 6 is not guaranteed to be identical
> to Tomcat 5.5, so it's entirely possibly you're using a class that
> doesn't exist in 5.5, if you're compiling against 6 and deploying
> against 5.5.  (or vice versa).
>
> p
>
>
> {
>
> The most common reason that a ClassNotFoundException is encountered
> while mixing testing/deployment on different versions of Tomcat is that
> jars have been placed in the wrong location.
>
> List members usually offer up the obvious solutions first, because
> they're the most common solutions.  Especially given that one message is
> usually insufficient to determine what the users level of knowledge is.
>
> Fsck knows why I'm bothering to explain that though.
>
> }
>
>
>   
>>> p
>>>
>>>
>>>
>>>
>>>  
>>>       
>>>> Tim Funk wrote:
>>>>    
>>>>         
>>>>> The dir structure changed from 5.5 to 6 so you need to place your
>>>>> files in different directories depending on the version. See the
>>>>> version specific docs details.
>>>>>
>>>>>
>>>>> -Tim
>>>>>
>>>>> Pedro wrote:
>>>>>      
>>>>>           
>>>>>> Hi all,
>>>>>>
>>>>>> I basically need to implement case insensitive user names, can this
>>>>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>>>>
>>>>>> public class CustomJdbcRealm extends JDBCRealm {
>>>>>>
>>>>>>      public CustomJdbcRealm() {
>>>>>>       super();
>>>>>>      }
>>>>>>          public Principal authenticate(String username, String
>>>>>> credentials) {
>>>>>>        return super.authenticate(username.toLowerCase(), credentials);
>>>>>>        }
>>>>>> }
>>>>>>
>>>>>> And in server.xml:
>>>>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>>>>
>>>>>> I tried this approach but get class not found exceptions, I am using
>>>>>> tomcat6 in development and 5.5 in production. I package this class in
>>>>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>>>  
>>>>>>         
>>>>>>             
>>>>> ---------------------------------------------------------------------
>>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>       
>>>>>           
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>     
>>>>         
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>   
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Pid <p...@pidster.com>.
Pedro wrote:
> OK PID then you tell me where the jar goes hey?

That's a lot of attitude for someone who wants help from the list. Or am
I misreading your tone?

I refer to my previous question:

>> Perhaps you can elaborate on when you're getting this exception if we're
>> to help you.

(An actual error message would also be useful.)


You say you are using Tomcat 6 for development, and Tomcat 5.5 in
production.  Is the error occurring in development or production?

Which version of Tomcat are you compiling the classes against?  The
internal class structure of Tomcat 6 is not guaranteed to be identical
to Tomcat 5.5, so it's entirely possibly you're using a class that
doesn't exist in 5.5, if you're compiling against 6 and deploying
against 5.5.  (or vice versa).

p


{

The most common reason that a ClassNotFoundException is encountered
while mixing testing/deployment on different versions of Tomcat is that
jars have been placed in the wrong location.

List members usually offer up the obvious solutions first, because
they're the most common solutions.  Especially given that one message is
usually insufficient to determine what the users level of knowledge is.

Fsck knows why I'm bothering to explain that though.

}


>> p
>>
>>
>>
>>
>>  
>>> Tim Funk wrote:
>>>    
>>>> The dir structure changed from 5.5 to 6 so you need to place your
>>>> files in different directories depending on the version. See the
>>>> version specific docs details.
>>>>
>>>>
>>>> -Tim
>>>>
>>>> Pedro wrote:
>>>>      
>>>>> Hi all,
>>>>>
>>>>> I basically need to implement case insensitive user names, can this
>>>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>>>
>>>>> public class CustomJdbcRealm extends JDBCRealm {
>>>>>
>>>>>      public CustomJdbcRealm() {
>>>>>       super();
>>>>>      }
>>>>>          public Principal authenticate(String username, String
>>>>> credentials) {
>>>>>        return super.authenticate(username.toLowerCase(), credentials);
>>>>>        }
>>>>> }
>>>>>
>>>>> And in server.xml:
>>>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>>>
>>>>> I tried this approach but get class not found exceptions, I am using
>>>>> tomcat6 in development and 5.5 in production. I package this class in
>>>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>>  
>>>>>         
>>>> ---------------------------------------------------------------------
>>>> To start a new topic, e-mail: users@tomcat.apache.org
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>       
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>     
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>   
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Pedro <ps...@gmail.com>.
OK PID then you tell me where the jar goes hey?

Pid wrote:
> Pedro wrote:
>   
>> Thanks for stating the obvious Tim, in 5.5 the 'server' directory is
>> supposed to be the correct place! the question is if the implementation
>> is valid.
>>     
>
> You referred to ClassNotFoundException's - his answer is therefore valid.
>
> Perhaps you can elaborate on when you're getting this exception if we're
> to help you.
>
> p
>
>
>
>
>   
>> Tim Funk wrote:
>>     
>>> The dir structure changed from 5.5 to 6 so you need to place your
>>> files in different directories depending on the version. See the
>>> version specific docs details.
>>>
>>>
>>> -Tim
>>>
>>> Pedro wrote:
>>>       
>>>> Hi all,
>>>>
>>>> I basically need to implement case insensitive user names, can this
>>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>>
>>>> public class CustomJdbcRealm extends JDBCRealm {
>>>>
>>>>      public CustomJdbcRealm() {
>>>>       super();
>>>>      }
>>>>          public Principal authenticate(String username, String
>>>> credentials) {
>>>>        return super.authenticate(username.toLowerCase(), credentials);
>>>>        }
>>>> }
>>>>
>>>> And in server.xml:
>>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>>
>>>> I tried this approach but get class not found exceptions, I am using
>>>> tomcat6 in development and 5.5 in production. I package this class in
>>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>>  
>>>>         
>>> ---------------------------------------------------------------------
>>> To start a new topic, e-mail: users@tomcat.apache.org
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>       
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>     
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>   


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Pid <p...@pidster.com>.
Pedro wrote:
> Thanks for stating the obvious Tim, in 5.5 the 'server' directory is
> supposed to be the correct place! the question is if the implementation
> is valid.

You referred to ClassNotFoundException's - his answer is therefore valid.

Perhaps you can elaborate on when you're getting this exception if we're
to help you.

p




> Tim Funk wrote:
>> The dir structure changed from 5.5 to 6 so you need to place your
>> files in different directories depending on the version. See the
>> version specific docs details.
>>
>>
>> -Tim
>>
>> Pedro wrote:
>>> Hi all,
>>>
>>> I basically need to implement case insensitive user names, can this
>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>
>>> public class CustomJdbcRealm extends JDBCRealm {
>>>
>>>      public CustomJdbcRealm() {
>>>       super();
>>>      }
>>>          public Principal authenticate(String username, String
>>> credentials) {
>>>        return super.authenticate(username.toLowerCase(), credentials);
>>>        }
>>> }
>>>
>>> And in server.xml:
>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>
>>> I tried this approach but get class not found exceptions, I am using
>>> tomcat6 in development and 5.5 in production. I package this class in
>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>  
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
> 
> 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


pretty dumb question, please help

Posted by Demetris Zavorotnichenko <fg...@cytanet.com.cy>.
Hi guys.

I  have a simple question


I have Apache Tomcat 6 runing on Windows Server 2003 IIS


I have a .*WAR application that I run from /webapps


So I would run it like this:  http://localhost/myapp/Myapp


My application has to get Google map Keys from Google.

In order to get the Key I have to specify in Google the URL in which I will
run Google map.


So what do I tell google? http://localhost/myapp/Myapp doesn't work. so any
suggestions would be greate.


Another question.

I want to run Myapp not from /webapps but from another folder.  So I have my
*war application in C:\myapp


How do I setup Tomcat to be able to look in that directory ? Or what should
I do in this case? 

Or I can't run the App from another folder?


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Tim Funk <fu...@joedog.org>.
In that case - (I think) it probably won't work - override instead:
protected PreparedStatement credentials(Connection dbConnection,
                                             String username)
protected synchronized PreparedStatement roles(Connection dbConnection,
             String username)

Where in both instances you call the super() version with a  lower username.

Then in config - make sure your userNameCol="lower(USER_NAME)" - of 
course using your username and lower DB implementation.

-Tim

Pedro wrote:
> Thanks for stating the obvious Tim, in 5.5 the 'server' directory is 
> supposed to be the correct place! the question is if the implementation 
> is valid.
> 
> Tim Funk wrote:
>> The dir structure changed from 5.5 to 6 so you need to place your 
>> files in different directories depending on the version. See the 
>> version specific docs details.
>>
>>
>> -Tim
>>
>> Pedro wrote:
>>> Hi all,
>>>
>>> I basically need to implement case insensitive user names, can this 
>>> be done with a servlet filter or do I need to subclass JDBC realm:
>>>
>>> public class CustomJdbcRealm extends JDBCRealm {
>>>
>>>      public CustomJdbcRealm() {
>>>       super();
>>>      }
>>>          public Principal authenticate(String username, String 
>>> credentials) {
>>>        return super.authenticate(username.toLowerCase(), credentials);
>>>        }
>>> }
>>>
>>> And in server.xml:
>>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>>
>>> I tried this approach but get class not found exceptions, I am using 
>>> tomcat6 in development and 5.5 in production. I package this class in 
>>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>>  
>>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Pedro <ps...@gmail.com>.
Thanks for stating the obvious Tim, in 5.5 the 'server' directory is 
supposed to be the correct place! the question is if the implementation 
is valid.

Tim Funk wrote:
> The dir structure changed from 5.5 to 6 so you need to place your 
> files in different directories depending on the version. See the 
> version specific docs details.
>
>
> -Tim
>
> Pedro wrote:
>> Hi all,
>>
>> I basically need to implement case insensitive user names, can this 
>> be done with a servlet filter or do I need to subclass JDBC realm:
>>
>> public class CustomJdbcRealm extends JDBCRealm {
>>
>>      public CustomJdbcRealm() {
>>       super();
>>      }
>>          public Principal authenticate(String username, String 
>> credentials) {
>>        return super.authenticate(username.toLowerCase(), credentials);
>>        }
>> }
>>
>> And in server.xml:
>> <Realm className="mypackage.CustomJdbcRealm" ...>
>>
>> I tried this approach but get class not found exceptions, I am using 
>> tomcat6 in development and 5.5 in production. I package this class in 
>> a jar and drop it in the $CATALENA_BASE/server/lib folder.
>>  
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: JDBC Realm with case insensitive user name

Posted by Tim Funk <fu...@joedog.org>.
The dir structure changed from 5.5 to 6 so you need to place your files 
in different directories depending on the version. See the version 
specific docs details.


-Tim

Pedro wrote:
> Hi all,
> 
> I basically need to implement case insensitive user names, can this be 
> done with a servlet filter or do I need to subclass JDBC realm:
> 
> public class CustomJdbcRealm extends JDBCRealm {
> 
>      public CustomJdbcRealm() {
>       super();
>      }
>          public Principal authenticate(String username, String 
> credentials) {
>        return super.authenticate(username.toLowerCase(), credentials);
>        }
> }
> 
> And in server.xml:
> <Realm className="mypackage.CustomJdbcRealm" ...>
> 
> I tried this approach but get class not found exceptions, I am using 
> tomcat6 in development and 5.5 in production. I package this class in a 
> jar and drop it in the $CATALENA_BASE/server/lib folder.
>  


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org