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



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to