XFire

XFire Client connect failure caused by a NPE in W3CNamespaceContext

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1.1, 1.2-RC
  • Fix Version/s: 1.2
  • Component/s: Core
  • Labels:
    None
  • Environment:
    OC4J; Sun jdk1.4.2_10
  • Number of attachments :
    1

Description

In some cases XFire client calls to other servers failed with a NPE.
Surprisingly that occured only in some configurations when calls where made from code that was deployed in an OC4J container.

Reason for the NPE:
W3CNamespaceContext.getPrefix(Element e, String uri) does not check if the result 'org.w3c.dom.Element.getAttributes()' is a null.
The next line uses the returned object and fails if it was null.

I added the null-check and the code works fine - even in OC4J
The patched class is attached to this report.

Activity

Hide
Olaf Boede added a comment -

I forgot to report the following:

oc4j version number: oc4j10.1.3

oc4j uses an own jaxp implementation that returns 'null' on getAttributes() when there is no attribute.
That is ok, since the Element interface specification allows that behavior.

Xerces returns an empty nodemap in that situation, which is also allowed.

I have not scanned the rest of the xfire code for unchecked getAttributes() results.

Show
Olaf Boede added a comment - I forgot to report the following: oc4j version number: oc4j10.1.3 oc4j uses an own jaxp implementation that returns 'null' on getAttributes() when there is no attribute. That is ok, since the Element interface specification allows that behavior. Xerces returns an empty nodemap in that situation, which is also allowed. I have not scanned the rest of the xfire code for unchecked getAttributes() results.
Hide
Dan Diephouse added a comment -

Well this is a simple enough fix. Thanks for the bug report!

Show
Dan Diephouse added a comment - Well this is a simple enough fix. Thanks for the bug report!
Hide
Dan Diephouse added a comment -

Alright, fixed this in SVN (actually found another place too). Thanks!

Show
Dan Diephouse added a comment - Alright, fixed this in SVN (actually found another place too). Thanks!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: