You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by FM <di...@LEXUM.UMontreal.CA> on 2005/12/12 19:50:04 UTC

tomcat + ldap gssapi

Hello,
I read that jndi cannot use ldap SSL or TLS.
Is-it possible to use GSSAPI ?
I cannot fond anything in the tomcat doc.

Thanks !

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


Re: Tomcat change in PageContextImpl.setAttribute from 4.1.30 to 4.1.31 makes 4.1.31 unusable... please confirm if it`s a bug ?????

Posted by David Gagnon <dg...@siunik.com>.
Sorry I didn't read correctly  the Javadoc :-)


>That's correct. According to the spec that Tim linked to:
>
>    Throws:
>        java.lang.NullPointerException - if the name or object is null
>
>If you want to set it to null, call removeAttribute instead. This is
>different from HttpSession.setAttribute and
>ServletRequest.setAttribute, which explicitly say that setting null is
>the same as calling removeAttribute. It's too bad that the spec is
>inconsistent and a bit inconvenient for us, but that's how it is.
>  
>
Yeah that bad .. in my case I finally use request.setAttribute instead 
and everything works perfectly.

Thanks for your help
/David




>On 12/12/05, David Gagnon <dg...@siunik.com> wrote:
>  
>
>>Hi
>>
>>  As state in the javadoc it should throw NullPointerException  if name
>>is null (wich make sense).  But in the code they also throw an exception
>>if the the value (o) is null!
>>
>>Regards
>>/David
>>
>>
>>      setAttribute
>>
>>public abstract void *setAttribute*(java.lang.String name,
>>                                  java.lang.Object o,
>>                                  int scope)
>>
>>    register the name and object specified with appropriate scope semantics
>>
>>    *Parameters:*
>>        |name| - the name of the attribute to set
>>        |o| - the object to associate with the name
>>        |scope| - the scope with which to associate the name/object
>>    *Throws:*
>>        |java.lang.NullPointerException| - if the name or object is null
>>        |java.lang.IllegalArgumentException| - if the scope is invalid
>>
>>
>>*Throws:*
>>    |java.lang.NullPointerException| - if the name or object is null
>>
>>
>>4.1.31:
>>public void setAttribute(String name, Object o, int scope) {
>>       if (name == null) {
>>           throw new NullPointerException("name may not be null");
>>       }
>>
>>       if (o == null) {
>>           throw new NullPointerException("object may not be null");
>>       }
>>
>>
>>Tim Funk wrote:
>>
>>    
>>
>>>I am guesing it was a fix for spec compliance:
>>>
>>>http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String,%20java.lang.Object,%20int)
>>>
>>>
>>>-Tim
>>>
>>>David Gagnon wrote:
>>>
>>>      
>>>
>>>>Hi all,
>>>>
>>>> I just installed a fresh tomcat 4.1.31 and run into this problem.
>>>>>From 4.1.30 to 4.1.31 the PageContexImpl.setAttribute has change in a
>>>>way that make it  unusable.  I cannot set null attribute in the
>>>>pageContext ?!?!?!
>>>>
>>>>So the following call throw an exception in 4.1.31:
>>>>           pageContext.setAttribute(LOOKUP_GROUP_DATA_KEY +
>>>>enclosingGroup.getGroup(), null, PageContext.REQUEST_SCOPE);
>>>>
>>>>Is that mean I need to check if an attribute is null before putting
>>>>it into the pageContext.... It desn`t make sense to me?
>>>>
>>>>This change make 4.1.31 totally unusable for me... Any idea on what I
>>>>can do? Or where I'm wrong?
>>>>
>>>>Thanks for your help!
>>>>
>>>>/David
>>>>        
>>>>
>
>--
>Len
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>  
>


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


Re: Tomcat change in PageContextImpl.setAttribute from 4.1.30 to 4.1.31 makes 4.1.31 unusable... please confirm if it`s a bug ?????

Posted by Len Popp <le...@gmail.com>.
That's correct. According to the spec that Tim linked to:

    Throws:
        java.lang.NullPointerException - if the name or object is null

If you want to set it to null, call removeAttribute instead. This is
different from HttpSession.setAttribute and
ServletRequest.setAttribute, which explicitly say that setting null is
the same as calling removeAttribute. It's too bad that the spec is
inconsistent and a bit inconvenient for us, but that's how it is.

On 12/12/05, David Gagnon <dg...@siunik.com> wrote:
> Hi
>
>   As state in the javadoc it should throw NullPointerException  if name
> is null (wich make sense).  But in the code they also throw an exception
> if the the value (o) is null!
>
> Regards
> /David
>
>
>       setAttribute
>
> public abstract void *setAttribute*(java.lang.String name,
>                                   java.lang.Object o,
>                                   int scope)
>
>     register the name and object specified with appropriate scope semantics
>
>     *Parameters:*
>         |name| - the name of the attribute to set
>         |o| - the object to associate with the name
>         |scope| - the scope with which to associate the name/object
>     *Throws:*
>         |java.lang.NullPointerException| - if the name or object is null
>         |java.lang.IllegalArgumentException| - if the scope is invalid
>
>
> *Throws:*
>     |java.lang.NullPointerException| - if the name or object is null
>
>
> 4.1.31:
> public void setAttribute(String name, Object o, int scope) {
>        if (name == null) {
>            throw new NullPointerException("name may not be null");
>        }
>
>        if (o == null) {
>            throw new NullPointerException("object may not be null");
>        }
>
>
> Tim Funk wrote:
>
> > I am guesing it was a fix for spec compliance:
> >
> > http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String,%20java.lang.Object,%20int)
> >
> >
> > -Tim
> >
> > David Gagnon wrote:
> >
> >> Hi all,
> >>
> >>  I just installed a fresh tomcat 4.1.31 and run into this problem.
> >> From 4.1.30 to 4.1.31 the PageContexImpl.setAttribute has change in a
> >> way that make it  unusable.  I cannot set null attribute in the
> >> pageContext ?!?!?!
> >>
> >> So the following call throw an exception in 4.1.31:
> >>            pageContext.setAttribute(LOOKUP_GROUP_DATA_KEY +
> >> enclosingGroup.getGroup(), null, PageContext.REQUEST_SCOPE);
> >>
> >> Is that mean I need to check if an attribute is null before putting
> >> it into the pageContext.... It desn`t make sense to me?
> >>
> >> This change make 4.1.31 totally unusable for me... Any idea on what I
> >> can do? Or where I'm wrong?
> >>
> >> Thanks for your help!
> >>
> >> /David

--
Len

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


Re: Tomcat change in PageContextImpl.setAttribute from 4.1.30 to 4.1.31 makes 4.1.31 unusable... please confirm if it`s a bug ?????

Posted by David Gagnon <dg...@siunik.com>.
Hi

  As state in the javadoc it should throw NullPointerException  if name 
is null (wich make sense).  But in the code they also throw an exception 
if the the value (o) is null!

Regards
/David


      setAttribute

public abstract void *setAttribute*(java.lang.String name,
                                  java.lang.Object o,
                                  int scope)

    register the name and object specified with appropriate scope semantics

    *Parameters:*
        |name| - the name of the attribute to set
        |o| - the object to associate with the name
        |scope| - the scope with which to associate the name/object 
    *Throws:*
        |java.lang.NullPointerException| - if the name or object is null 
        |java.lang.IllegalArgumentException| - if the scope is invalid


*Throws:*
    |java.lang.NullPointerException| - if the name or object is null


4.1.31:
public void setAttribute(String name, Object o, int scope) {
       if (name == null) {
           throw new NullPointerException("name may not be null");
       }

       if (o == null) {
           throw new NullPointerException("object may not be null");
       }


Tim Funk wrote:

> I am guesing it was a fix for spec compliance:
>
> http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String,%20java.lang.Object,%20int) 
>
>
> -Tim
>
> David Gagnon wrote:
>
>> Hi all,
>>
>>  I just installed a fresh tomcat 4.1.31 and run into this problem.  
>> From 4.1.30 to 4.1.31 the PageContexImpl.setAttribute has change in a 
>> way that make it  unusable.  I cannot set null attribute in the 
>> pageContext ?!?!?!
>>
>> So the following call throw an exception in 4.1.31:
>>            pageContext.setAttribute(LOOKUP_GROUP_DATA_KEY + 
>> enclosingGroup.getGroup(), null, PageContext.REQUEST_SCOPE);
>>
>> Is that mean I need to check if an attribute is null before putting 
>> it into the pageContext.... It desn`t make sense to me?
>>
>> This change make 4.1.31 totally unusable for me... Any idea on what I 
>> can do? Or where I'm wrong?
>>
>> Thanks for your help!
>>
>> /David
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


Re: Tomcat change in PageContextImpl.setAttribute from 4.1.30 to 4.1.31 makes 4.1.31 unusable... please confirm if it`s a bug ?????

Posted by Tim Funk <fu...@joedog.org>.
I am guesing it was a fix for spec compliance:

http://tomcat.apache.org/tomcat-4.1-doc/servletapi/javax/servlet/jsp/PageContext.html#setAttribute(java.lang.String,%20java.lang.Object,%20int)

-Tim

David Gagnon wrote:

> Hi all,
> 
>  I just installed a fresh tomcat 4.1.31 and run into this problem.  From 
> 4.1.30 to 4.1.31 the PageContexImpl.setAttribute has change in a way 
> that make it  unusable.  I cannot set null attribute in the pageContext 
> ?!?!?!
> 
> So the following call throw an exception in 4.1.31:
>            pageContext.setAttribute(LOOKUP_GROUP_DATA_KEY + 
> enclosingGroup.getGroup(), null, PageContext.REQUEST_SCOPE);
> 
> Is that mean I need to check if an attribute is null before putting it 
> into the pageContext.... It desn`t make sense to me?
> 
> This change make 4.1.31 totally unusable for me... Any idea on what I 
> can do? Or where I'm wrong?
> 
> Thanks for your help!
> 
> /David


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


Tomcat change in PageContextImpl.setAttribute from 4.1.30 to 4.1.31 makes 4.1.31 unusable... please confirm if it`s a bug ?????

Posted by David Gagnon <dg...@siunik.com>.
Hi all,

  I just installed a fresh tomcat 4.1.31 and run into this problem.  
 From 4.1.30 to 4.1.31 the PageContexImpl.setAttribute has change in a 
way that make it  unusable.  I cannot set null attribute in the 
pageContext ?!?!?!

So the following call throw an exception in 4.1.31:
            pageContext.setAttribute(LOOKUP_GROUP_DATA_KEY + 
enclosingGroup.getGroup(), null, PageContext.REQUEST_SCOPE);

Is that mean I need to check if an attribute is null before putting it 
into the pageContext.... It desn`t make sense to me?

This change make 4.1.31 totally unusable for me... Any idea on what I 
can do? Or where I'm wrong?

Thanks for your help!

/David


4.1.31:
public void setAttribute(String name, Object o, int scope) {
        if (name == null) {
            throw new NullPointerException("name may not be null");
        }

        if (o == null) {
            throw new NullPointerException("object may not be null");
        }

        switch (scope) {
            case PAGE_SCOPE:
                attributes.put(name, o);
                break;

            case REQUEST_SCOPE:
                request.setAttribute(name, o);
                break;

            case SESSION_SCOPE:
                if (session == null)
                    throw new IllegalArgumentException
                        ("can't access SESSION_SCOPE without an 
HttpSession");
                else
                    session.setAttribute(name, o);
                break;

            case APPLICATION_SCOPE:
                context.setAttribute(name, o);
                break;

            default:
        }
    }




4.1.30
 public void setAttribute(String name, Object o, int scope) {
    switch (scope) {
        case PAGE_SCOPE:
        attributes.put(name, o);
        break;

        case REQUEST_SCOPE:
        request.setAttribute(name, o);
        break;

        case SESSION_SCOPE:
        if (session == null)
            throw new IllegalArgumentException("can't access 
SESSION_SCOPE without an HttpSession");
        else
            session.setAttribute(name, o);
        break;

        case APPLICATION_SCOPE:
        context.setAttribute(name, o);
        break;

        default:
    }
    }



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