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

Fuhwei Lwo updated TUSCANY-1645:
--------------------------------

    Attachment: 1645.patch

The NPE was caused by trying to codegen on null XSD namesapce. The SDO codegen 
tool needs the XSD target namespace to generate the static SDO APIs. In this 
case, since there is no targetNamespace specified in the <xsd:schema>, 
getSchemaNamespace() method in the XSD2JavaGenerator returns null and causes 
NPE.

My patch is to further check whether there is any XSD import I can use. If 
there is one, return its namespace for the codegen starting point.

I don't think this solution is sufficient because I think it's possible to have 
multiple imports as codegen starting points. By looking at the current 
implementation we have, it only allows single codegen starting point then 
codegen on its dependencies. This means if I have 2 imports and they are not 
related, the second import won't be gened.

Let me know if I am on the right track. Thanks.

> XSD2JavaGenerator failed to gen on the wsdl files with only <xsd:import> 
> element in <xsd:schema>
> ------------------------------------------------------------------------------------------------
>
>                 Key: TUSCANY-1645
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1645
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SDO Tools
>    Affects Versions: Java-SDO-1.0
>         Environment: WinXP
>            Reporter: Fuhwei Lwo
>             Fix For: Java-SDO-Next
>
>         Attachments: 1645.patch, EchoService_schema1.xsd, TUSCANY-544.wsdl
>
>
> NullPointerException was thrown when a WSDL with XSD definition like below 
> was used by the XSD2JavaGenerator. In this case, there is no targetNamespace 
> was specified in the <xsd:schema>
> <types>
>     <xsd:schema>
>       <xsd:import namespace="http://test/"; 
> schemaLocation="EchoService_schema1.xsd"/>
>     </xsd:schema>
>   </types>
> This problem was derived from SCA JIRA TUSCANY-544 and related to SDO JIRA 
> TUSCANY-1327.

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


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

Reply via email to