cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Naumov (JIRA)" <>
Subject [jira] Commented: (COCOON-1861) Check for Null URI in LDAPTransformer
Date Fri, 16 Jun 2006 07:12:30 GMT
    [ ] 

Igor Naumov commented on COCOON-1861:

I attached the stacktrace (from Cocoon 2.1.9 running on Tomcat 5 - so it's not just SAP NetWeaver)
and a sample XML that I apply the LDAP transformer to. 
Let me explain a little bit what I am doing with LDAP. In the authentication pipeline I first
collect some parameters with aggregate, then apply an XSL to it to produce an ldap:execute-query
element (while still leaving some elements outside of the ldap query), and then apply the
LDAP transformer.
With the unpatched code it fails on LDAP transformation with NullPointer.
However with a patch (only to startElement method) everything works just fine. Seems like
standalone Cocoon does not have that problem, so it depends on a J2EE server. If I remember
correctly, we did not have that issue with WebSphere.

I think the reason nobody complained about it is that there are several factors that needs
to be present:
- Using LDAP to begin with - not everyone, I guess
- Using additional elements without a namespace in LDAP query - not the best practice as well
(not having a namespace).
- Using particular J2EE server
- Potentially the fact that I apply XSLT before applying LDAP transformation - the URI may
be affected by that as well.

> Check for Null URI in LDAPTransformer
> -------------------------------------
>          Key: COCOON-1861
>          URL:
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Naming
>     Versions: 2.1.8, 2.1.9
>     Reporter: Igor Naumov
>     Priority: Minor
>  Attachments: LDAP stacktrace.htm, authenticateLDAP.xml
> In the (src\blocks\naming\java\org\apache\cocoon\transformation\
the URI is not checked for NULL.
> On some J2EE servers (SAP NetWeaver) the URI passed may be NULL and it causes a NullPointerException.
> A simple fix is to add a check for NULL URI and just pass through that element:
>      public void startElement(String uri, String name, String raw, Attributes attributes)
throws SAXException {
> +        if (uri == null) {
> +            super.startElement(uri, name, raw, attributes);
> +            return;
> +        }
>          if (!uri.equals(my_uri)) {
>              super.startElement(uri, name, raw, attributes);
>              return;

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message