Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.6, 2.2.7, 2.2.8, 2.2.9
-
None
-
None
-
Unknown
Description
CXF produces an invalid wsdl when both a <jaxws:schemaLocation> (XSD) is specified and the ASM library is in the classpath.
The error messages is : GRAVE: Schema element [...] references undefined type [...]
The generated wsdl can not be read by SoapUI.
BUT, there is no error messages and the WSDL is fully working if :
- I remove the <jaxws:schemaLocation> configuration element
- OR, the ASM library is completely excluded from the classpath
I think there is an incompatibility between the use of an XSD (jaxws:schemaLocation) and the ASM library.
A sample webapp is attached and it makes easier to reproduce the problem (see below for details).
Versions
Tested with :
- CXF : 2.2.6 to 2.2.9
- ASM 2.2.3, 3.0, 3.1
CXF depends on ASM 2.2.3 but this dependency is optional.
ASM 3.1 is provided by JBoss so it will be available anyway in the classpath.
So I was not able to deploy the sample webapp on JBoss 5.
With ASM 1.5.3, there is no error.
Full log messages
12 juil. 2010 15:25:42 org.apache.cxf.service.factory.ReflectionServiceFactoryBean GRAVE: Schema element{http://creditcard.example.com/}getCreditCardStatusResponse references undefined type {http://creditcard.example.com/}getCreditCardStatusResponse for service {http://creditcard.example.com/} 12 juil. 2010 15:25:42 org.apache.cxf.service.factory.ReflectionServiceFactoryBean GRAVE: Schema element {http://creditcard.example.com/}getCreditCardStatus references undefined type {http://creditcard.example.com/}getCreditCardStatus for service {http://creditcard.example.com/}CreditCardWebServiceImplService.
Full Jax-ws declaration
<jaxws:endpoint id="creditCardWebService" implementor="com.example.creditcard.CreditCardWebServiceImpl" address="/creditCard"> <jaxws:schemaLocations> <jaxws:schemaLocation>schemas/creditCard.xsd</jaxws:schemaLocation> </jaxws:schemaLocations> </jaxws:endpoint>
The sample project
Attached is a very simple webapp which can be run with : mvn jetty:run
This is a maven project which contains a simple XSD.
The XSD is used to generate the sample java beans used in the webService java code.
The XSD is also declared in the jaxws:endpoint in the spring applicationContext file.
The error is shown in the console when the endpoint is created, when CXF is started.
The pom.xml is fully documented and prepared to enable/disable the ASM dependency.
The generated WSDL are also provided (with/without schemaLocation combined with/without ASM).
Thanks for your help and the time you will take to fix this.