WSDL2Java tool does not handle 'key' and 'keyref' constraints(in 
included/imported schemas) properly
----------------------------------------------------------------------------------------------------

                 Key: AXIS2-1962
                 URL: https://issues.apache.org/jira/browse/AXIS2-1962
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: codegen
    Affects Versions: 1.1
         Environment: JDK 1.5 on Fedora Core 3
            Reporter: Srinath


I have a wsdl which imports many schemas. The schemas have some identity 
constraints.
The WSDL2Java tool fails to generate the stubs in some cases. I have listed the 
scenario below:

Lets say I have a schema file - mySchema.xsd, which defines an Element 
"MyRootElement". Lets say there are some keys and keyrefs under this element.

<element name="MyRootElement" type="tns:myRootElementType" >
        <key name="UniqueConstraint1">
            <selector xpath="ChildElement1" />
            <field xpath="@name" />
        </key>
        <key name="UniqueConstraint2">
            <selector xpath="ChildElement2" />
            <field xpath="@name" />
        </key>
        <keyref name="ValidChildElement2Reference" 
refer="tns:UniqueConstraint2">
            <selector xpath="ChildElement1/Child1" />
            <field xpath="@ref" />
        </keyref>
</element>

Code Generation fails with the following error message:

     [java] Exception in thread "main" 
org.apache.axis2.wsdl.codegen.CodeGenerationException: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
     [java]     at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
     [java]     at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
     [java]     at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
     [java] Caused by: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
     [java]     at 
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:92)
     [java]     at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:177)
     [java]     ... 2 more
     [java] Caused by: java.lang.reflect.InvocationTargetException
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:585)
     [java]     at 
org.apache.axis2.wsdl.codegen.extension.XMLBeansExtension.engage(XMLBeansExtension.java:82)
     [java]     ... 3 more
     [java] Caused by: java.lang.RuntimeException: 
org.apache.xmlbeans.XmlException: project://local/../mySchema.xsd:28:1: error: 
src-resolve: identity constraint '[EMAIL PROTECTED]://www.xyz.com/schemas/' not 
found.
     [java]     at 
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:250)
     [java]     ... 8 more
     [java] Caused by: org.apache.xmlbeans.XmlException: 
project://local/../mySchema.xsd:28:1: error: src-resolve: identity constraint 
'[EMAIL PROTECTED]://www.xyz.com/schemas/' not found.
     [java]     at 
org.apache.xmlbeans.impl.schema.SchemaTypeSystemCompiler.compile(SchemaTypeSystemCompiler.java:225)
     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java]     at java.lang.reflect.Method.invoke(Method.java:585)
     [java]     at 
org.apache.xmlbeans.XmlBeans.compileXmlBeans(XmlBeans.java:667)
     [java]     at 
org.apache.axis2.xmlbeans.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:168)
     [java]     ... 8 more



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to