Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

marshalling issues

$
0
0
I have written an example service to implement standards I am trying to
stand up where I work.

I want to do contract first development and so derive all artifacts from a
predefined xml schema and wadl for rest services.

The project generates the artifacts and I import those artifacts into an
implementation project to write the sample code. I then overrode the media
types that the JAXBElementProvider and JSONProvider operate on in my
context file (bean.xml).

When I attempt to access the implemented service using a curl statement the
following error occurs:

curl -X GET -H "Accept:
application/vnd.com.healthmedia.user-data+json;version=1.0"
http://localhost:8080/user-data-service/user-data/11
JAXBException occurred : unable to marshal type
"com.healthmedia.ws.entity.userdata.v1.UserDataType" as an element because
it is missing an @XmlRootElement annotation. unable to marshal type
"com.healthmedia.ws.entity.userdata.v1.UserDataType" as an element because
it is missing an @XmlRootElement annotation.

I am really stuck can someone help?

The sample code is on my github account:

https://github.com/MacFlecknoe/service-repository-sample

The schemas and wadl are in the schema project (
https://github.com/MacFlecknoe/service-repository-sample/tree/master/schema),
the java artifacts are generated in the artifact project (
https://github.com/MacFlecknoe/service-repository-sample/tree/master/user-data/artifacts)
and the implementation is in the user-data-service project (
https://github.com/MacFlecknoe/service-repository-sample/tree/master/user-data/service

Thank you in advance!

Michael Lambert

Viewing all articles
Browse latest Browse all 5648

Trending Articles