Hi all. Another question:       
The context
        
                I have some WSDL/XSD-files defining messages/payload            
        (let's say
something like "Person").
 I must not change said files;                  instead I extend the messages 
in an
additional XSD-file (to have something like "Person with                        
dog").
 Extension is done via *XSD-redefinitions*, e. g.:              
...<xs:redefine schemaLocation="./WSPayloadMessages.xsd"> 
<xs:complexType name="PersonType">    <xs:complexContent>     
<xs:extension base="tns:PersonType">        <xs:sequence>         
<xs:element name="Dog" type="animals:DogType"/>       
</xs:sequence>      </xs:extension>   
</xs:complexContent>  </xs:complexType></xs:redefine>...
                
Then I hand the redefinitions over to a XJC (executed by Maven) to obtain
Java                    classes.
        
        
The error
        
                Once I call CXF's "java2WS" via Maven to *generate* my own      
                *Web
Services* using the extended messages, it *fails*:              
Error: java.lang.RuntimeException: java.lang.IllegalArgumentException:
*argument contains null*java.lang.RuntimeException:
java.lang.IllegalArgumentException: argument contains null      at
org.apache.cxf.frontend.AbstractServiceFactory.createService(AbstractServiceFactory.java:80)
at
org.apache.cxf.tools.java2wsdl.processor.JavaToWSDLProcessor.process(JavaToWSDLProcessor.java:101)
at
org.apache.cxf.tools.java2ws.JavaToWSContainer.processWSDL(JavaToWSContainer.java:110)
at
org.apache.cxf.tools.java2ws.JavaToWSContainer.execute(JavaToWSContainer.java:75)
...
        
        
My guess
        
                Doing some research, I concluded that CXF/JAXB has issues with  
                the
aforementioned extension mechanism. It leads to superclasses                    
prefixed with
"Original". However their "@XmlType"-annotations always                 have an 
empty
"name"-attribute (i. e. "*@XmlType(name = ""*, ...)").                  This 
apparently
cause the "argument contains null"-error.               
To illustrate, let's stay with the "person with dog" example:
                
@XmlType(name = "", propOrder = {    "statusCode"})@XmlSeeAlso({   
my.package.PersonType.class})@Generated(value = "com.sun.tools.xjc.Driver",
date = "2014-07-25T11:15:09+02:00", comments = "JAXB RI v2.2.7")public class
OriginalPersonType{     ... }
                
For testing, I manually removed the empty "name"-attribute ->                   
the error is
gone. However I cannot do that all the time, for my                     
projects uses Maven
and builds automatically.
                
How can I fix that? Or is it a bug (for it seems to work                        
without the
"name"-attribute)? If it is a bug, I could file a                       
bug-report.
        
My current configuration
                
I'm using:
                
                
CXF 3.0.0               
Maven (from within      Eclipse)
with the plugins: 
maven-jaxb2-plugin : 0.9.0
jaxb2-basics : 0.6.5
cxf-java2ws-plugin : 3.0.0
                
Tomcat 7.0.54           
Any hints are welcome. I could also provide further details (like my POM for
Maven).




--
View this message in context: 
http://cxf.547215.n5.nabble.com/Question-CXF-generate-Web-Service-issue-when-using-xsd-redefine-tp5746898.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to