Re: How to configure my Realm class from context.xml?

2006-02-23 Thread Jon Wingfield
Erm. Ok. My Realm extends RealmBase so I don't need to worry about such 
things.
But, I guess in the Filter you could cast the request to an 
o.a.catalina.HttpRequest and then call getContext() on it.


http://tomcat.apache.org/tomcat-5.0-doc/catalina/docs/api/index.html

Jon

PS I've never done the above, nor needed to. Good luck.

Zsolt wrote:

Thank you Jon,

That's what I'm also trying but I always get a NPE because
JNDIRealm.containerLog is null.

Do you know how I can figure out the Container from for example a Filter?

In the case I could call realm.setContainer(container) no NPE would happen.

Zsolt



-Original Message-
From: Jon Wingfield [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 23, 2006 5:05 PM
To: Tomcat Users List
Subject: Re: How to configure my Realm class from context.xml?

Your Realm implementation needs to sit in the server classloader as the
Realm interface is only defined there (in catalina.jar).

This is a PITA so when we did this we made the Realm implementation just
lookup the real implementation via JNDI. That way all the authentication
logic stayed in the webapp and only a couple of simple wrapper classes
and interfaces went into the server and common classloaders.

HTH,

Jon

Zsolt wrote:

Does anybody know how to configure 

I always get a ClassNotFoundException but the class does exist (under
../WEB-INF.





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





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



RE: How to configure my Realm class from context.xml?

2006-02-23 Thread Zsolt
Thank you Jon,

That's what I'm also trying but I always get a NPE because
JNDIRealm.containerLog is null.

Do you know how I can figure out the Container from for example a Filter?

In the case I could call realm.setContainer(container) no NPE would happen.

Zsolt


>-Original Message-
>From: Jon Wingfield [mailto:[EMAIL PROTECTED]
>Sent: Thursday, February 23, 2006 5:05 PM
>To: Tomcat Users List
>Subject: Re: How to configure my Realm class from context.xml?
>
>Your Realm implementation needs to sit in the server classloader as the
>Realm interface is only defined there (in catalina.jar).
>
>This is a PITA so when we did this we made the Realm implementation just
>lookup the real implementation via JNDI. That way all the authentication
>logic stayed in the webapp and only a couple of simple wrapper classes
>and interfaces went into the server and common classloaders.
>
>HTH,
>
>Jon
>
>Zsolt wrote:
>> Does anybody know how to configure >
>> >   resourceName="my/RealmFactory"/>
>>
>> I always get a ClassNotFoundException but the class does exist (under
>> ../WEB-INF.
>>
>>
>>
>>
>>
>> -
>> 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: How to configure my Realm class from context.xml?

2006-02-23 Thread Jon Wingfield
Your Realm implementation needs to sit in the server classloader as the 
Realm interface is only defined there (in catalina.jar).


This is a PITA so when we did this we made the Realm implementation just 
lookup the real implementation via JNDI. That way all the authentication 
logic stayed in the webapp and only a couple of simple wrapper classes 
and interfaces went into the server and common classloaders.


HTH,

Jon

Zsolt wrote:

Does anybody know how to configure   resourceName="my/RealmFactory"/>


I always get a ClassNotFoundException but the class does exist (under
../WEB-INF.





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