cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Igor Naumov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (COCOON-1861) Check for Null URI in LDAPTransformer
Date Fri, 16 Jun 2006 05:26:30 GMT
    [ http://issues.apache.org/jira/browse/COCOON-1861?page=comments#action_12416452 ] 

Igor Naumov commented on COCOON-1861:
-------------------------------------

I actually did test the patch exactly as I described.
The problem occurs when the source for LDAP transformer has elements without a namespace.
For some reason my J2EE server (SAP NetWeaver) passes the uri as null and uri.equal obviously
returns a NullPointer exception. 
Apparently super.StartElement is more tolerant to a null URI, so the element is just copied
to the output without any action in the transformer.
I can run some more checks to see what exactly happens.

I agree that logically there should be a similar fix in the endElement. I overlooked it (probably
because just the fix in the endElement worked).
I think the whole problem is caused by some faulty behaviour of the J2EE server. But I am
not good at Java, so I would rely on your judgement. 
In general, is is safe to assume that the parameter declared as String would not be null?


> Check for Null URI in LDAPTransformer
> -------------------------------------
>
>          Key: COCOON-1861
>          URL: http://issues.apache.org/jira/browse/COCOON-1861
>      Project: Cocoon
>         Type: Bug

>   Components: Blocks: Naming
>     Versions: 2.1.8, 2.1.9
>     Reporter: Igor Naumov
>     Priority: Minor

>
> In the LDAPTransformer.java (src\blocks\naming\java\org\apache\cocoon\transformation\LDAPTransformer.java)
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:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message