ws-muse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Shiell (JIRA)" <>
Subject [jira] Created: (MUSE-140) Muse 2 breaks on WLS with BEA StAX parser
Date Fri, 03 Nov 2006 12:15:16 GMT
Muse 2 breaks on WLS with BEA StAX parser

                 Key: MUSE-140
             Project: Muse
          Issue Type: Bug
          Components: Deployment - Axis2
    Affects Versions: 2.0.0
         Environment: WLS 9.2
            Reporter: James Shiell
         Assigned To: Dan Jemiolo
            Priority: Critical

When WLS 9.2 is used and the BEA StAX parser (as opposed to Woodstox) is being used the AxisEnvironment
class fails in the convertToDOM(OMElement) method. This appears to be due to a WLS bug, where
the serialised XML ommits namespace declarations.

Given that it is not always possible to structure the classpath to use Woodstox I have included
a potential fix that does not rely on serialisation, instead converting objects directly.
This is compatible with both implementations and hopefully slightly faster as well.

     * Convert Axiom to DOM. Muse uses the DOM API in the JDK, Axis2 uses
     * the Axiom API, which is similar but... different.
     * @param axiom the OM element.
     * @return the converted element.
    public static Element convertToDOM(final OMElement axiom)
            final DocumentBuilder domBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            final Document doc = domBuilder.newDocument();
            return convertToDom(axiom, doc);

        catch (Throwable error)
            throw new RuntimeException(error.getMessage(), error);

     * Convert an OM element into a DOM element.
     * @param element the OM element.
     * @param doc the DOM document to which DOM elements should belong.
     * @return the DOM representation of the OM element.
    private static Element convertToDom(final OMElement element, final Document doc)
        final Element domElement = doc.createElementNS(element.getNamespace().getNamespaceURI(),


        for (Iterator i = element.getAllAttributes(); i.hasNext();)
            final OMAttribute attr = (OMAttribute);
            domElement.setAttributeNS(attr.getNamespace().getNamespaceURI(), attr.getLocalName(),

        for (Iterator i = element.getChildElements(); i. hasNext();)
            final Element child = convertToDom((OMElement), doc);

        return domElement;

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:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message