[ 
https://issues.apache.org/activemq/browse/SM-1011?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Guillaume Nodet resolved SM-1011.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 3.1.3
         Assignee: Guillaume Nodet

Thx a lot for this patch !

Sending        
servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/SchemaCollection.java
Sending        
servicemix-common/src/test/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattenerTest.java
Adding         servicemix-common/src/test/resources/includes
Adding         servicemix-common/src/test/resources/includes/nested-a1.xsd
Adding         servicemix-common/src/test/resources/includes/nested-b1.xsd
Adding         servicemix-common/src/test/resources/includes/nested-b2.xsd
Adding         servicemix-common/src/test/resources/includes/nested-b3.xsd
Adding         servicemix-common/src/test/resources/includes/nested-c1.xsd
Adding         servicemix-common/src/test/resources/includes/service.wsdl
Transmitting file data ........
Committed revision 580017.

Sending        
servicemix-common/src/main/java/org/apache/servicemix/common/tools/wsdl/SchemaCollection.java
Sending        
servicemix-common/src/test/java/org/apache/servicemix/common/tools/wsdl/WSDLFlattenerTest.java
Adding         servicemix-common/src/test/resources/includes
Adding         servicemix-common/src/test/resources/includes/nested-a1.xsd
Adding         servicemix-common/src/test/resources/includes/nested-b1.xsd
Adding         servicemix-common/src/test/resources/includes/nested-b2.xsd
Adding         servicemix-common/src/test/resources/includes/nested-b3.xsd
Adding         servicemix-common/src/test/resources/includes/nested-c1.xsd
Adding         servicemix-common/src/test/resources/includes/service.wsdl
Transmitting file data ..
Committed revision 580018.

> WSDLFlattenner / SchemaCollection do not handle nested schemas inclusions 
> properly
> ----------------------------------------------------------------------------------
>
>                 Key: SM-1011
>                 URL: https://issues.apache.org/activemq/browse/SM-1011
>             Project: ServiceMix
>          Issue Type: Bug
>          Components: servicemix-common
>    Affects Versions: 3.1.1
>         Environment: Windows XP
>            Reporter: Konrad Argasinski
>            Assignee: Guillaume Nodet
>             Fix For: 3.1.3, 3.2
>
>         Attachments: nested schemas.txt, nested-schemas-reproduced-sm.zip
>
>
> WSDLFlattener fails to analyse JSR-181 SU WSDL which imports multi-level 
> (nested) schemas structure.
> My JSR-181 SU WSDL imports A1.xsd schema. A1.xsd includes B1.xsd, B2.xsd and 
> B3.xsd. B1.xsd includes C1.xsd.
> The schema is used by JAXB during the project build and it works ok, however 
> when the SU gets deployed on ServiceMix I receive following error:
> <loc-message>NOT_FOUND_ERR: An attempt is made to reference a node in a 
> context where it does not exist.</loc-message>
> <stack-trace><![CDATA[org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is 
> made to reference a node in a context where it does not exist.
>       at org.apache.xerces.dom.ParentNode.internalRemoveChild(Unknown Source)
>       at org.apache.xerces.dom.ParentNode.removeChild(Unknown Source)
>       at 
> org.apache.servicemix.common.tools.wsdl.SchemaCollection.handleImports(SchemaCollection.java:150)
> The full stack trace is attached.
> As workaround I compiled my custom SchemaCollection and it works ok now, 
> however I think a better fix is needed.
> My custom changes in org.apache.servicemix.common.tools.wsdl.SchemaCollection 
> are:
> around line 149 I have replaced:
>               String location = ce.getAttribute("schemaLocation");
>                 schema.getRoot().removeChild(ce);
> with:
>               String location = ce.getAttribute("schemaLocation");
>               Node parentNode = ce.getParentNode();
>               Element root = schema.getRoot();
>               if (root == parentNode) {
>                  log.debug("Removing child include node: " + ce);
>                  schema.getRoot().removeChild(ce);
>               } else {
>                    log.warn("Skipping child include node removal: " + ce);
>               }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to