Problem1: There is no grammar information generated in wadl
Cause:
Org. Apache. cxf. jaxrs. model. wadl. wadlgeneratorrelies on org. Apache. cxf. jaxrs. utils. resourceutils
To create a jaxbcontext, without a jaxbcontext, no grammar section will be generated
Jaxb is not printing stack trace for any problem
Log. Fine ("No jaxb context can becreated ");
Error pattern |
Cause |
Example |
Solution |
Two classes have the same XML type name "XXX". Use @ xmltype. Name and @ xmltype. namespace to assign different names to them. |
Two properties are with the same class name, but the classes are of different type |
In class customercontactsrequest @ Xmlelement (name = "name ") Private contactname name; The contactname is an inner static class of mermercontactsrequest In class customercontactsv2request @ Xmlelement (name = "name ") Private contactname name; The contactname is an inner static class of mermercontactsv2request |
Use @ xmltype. Name and @ xmltype. namespace to differentiate the 2 inner classes |
XXX is a non-static inner class, And jaxb can't handle those. |
Use an inner class that is non-static |
In class updatecustomerpaymentinstrumentdetails There is an inner class Public class updatecreditcarddetails that is non-static |
Make the Class A static inner class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Problem2: generated grammar is not associated with resource method's request andresponse
Cause:
We need a namespace, without namespace, it cannot associate request response with XSD types declared in the grammar Section
See org. Apache. cxf. jaxrs. model. wadl. wadlgenerator. generateqname
There are two ways of declare a namespace:
Xmlrootelement (namespace = xxx) at class level
XMLSCHEMA (namespace = xxx) at packagelevel