Cxf wadl generation

Source: Internet
Author: User
Tags stack trace

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

 


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.