Sergey,
Correct, removed the jettison from the classpath and everything works
without excluding...!
Best regards,
Johannes
Am 18.08.2016 um 00:27 schrieb Sergey Beryozkin:
Looks like you have CXF JSONProvider loaded...
Sergey
On 17/08/16 17:53, J. Fiala wrote:
I'm using wadl2java to generate api and model classes from a WADL (CXF
3.1.6).
I'm using the JacksonProvider in the client call:
JacksonJsonProvider provider = new JacksonJsonProvider();
List<Object> providers = new ArrayList<Object>();
providers.add(provider);
api = JAXRSClientFactory.create(serverApp, MyApiResource.class,
providers);
However, the generated ObjectFactory.java seems to overrule the Json
provider and throws the following exception:
WARNING: javax.xml.bind.MarshalException
- with linked exception:
[com.sun.istack.internal.SAXException2: unable to marshal type
"at.myapp.MyCustomType" as an element because it is missing an
@XmlRootElement annotation]
If I remove the ObjectFactory.java from the buildpath
(<exclude>**/at/myapp/ObjectFactory.java</exclude> in pom.xml), then
everything is working like a charm (Json gets assembled/parsed
correctly).
This problem doesn't exist if I use CXF 2, there everything is working
out of the box.
Is there another way to get the CXF 3 client working with wadl2java
without removing ObjectFactory.java from the buildpath?
Best regards,
J. Fiala