REST « jaxb « Java Enterprise Q&A

1. Using JAXB to unmarshal/marshal a List

I'm trying to create a very simple REST server. I just have a test method that will return a List of Strings. Here's the code:

public List test2(){

2. Create Hello World with RESTful web service and Jersey

I follow tutorial here on how to create web service using RESTful web service and Jersey and I get kind of stuck. The code is from HelloWorld3 ...

3. Problem implementing GET REST service due to JAXBException: IllegalAnnotationExceptions

I am having a really strange problem implementing Java REST service. I am trying receive the following model:

@Data @EqualsAndHashCode(callSuper=false, of={"primaryKey"}) 
@Entity @Table(name = "T_UNIQUE_IDENT_TYPE")
@XmlRootElement(name="UniqueIdentifierType") @XmlAccessorType(XmlAccessType.FIELD)
public class UniqueIdentifierType extends AbstractEntityWithTime implements Serializable ...

4. jersey webservice returns a 415 when executing a PUT from Ext.Ajax.request

So, I've got a pretty simple RESTful jersey webservice, and I'm wanting to call it from my javascript code. I have no problem executing a GET request, but for some ...

5. Problem with POST method in RESTful Java Web Service

I'm trying to make a RESTful Web Service which implements all four CRUD operations. I got stuck in "Create" because somehow I'm not able to obtain the posted data. Here is ...

6. JsonTypeInfo does not serialize when using Jackson with Jersey

I annotated a JAXB class with JsonTypeInfo so that I could serialize polymorphic classes easily. However, the annotation does not show up when serialized by Jersey. To be more ...

7. Hypermedia with Jersey using Atom

Every book on REST uses <atom:link href="..." rel="..."> to define Hypermedia in RESTful apps; but Jersey (with the use of JAXB) do not seems to have this support. I've tried @XmlSchema in ...

8. Automatically populate HATEAOS links using JAXB or something similar?

Let's say I'm following HATEOAS and using hypertext in my XML. Something like this: /customer/32

  <Address href="/address/4324">
  <Street>123 Fake St</Street>
Is there a library akin ...

9. Method collision between JAXB and rest of the Application

I am converting an existing POJO to be an JAXB compliant. Everything works fine except for one of the getter method of the pojo where I need an additional logic specific ...

10. JAXB REST PUT'ting referenced association

Consider the following entity classes:

  • Manufacturer: represents a car manufacturer (Ford, Volvo, ...) and has a name.
  • Model: represents a model (Fiesta, S80), has a name, and is manufactured by a single manufacturer.
The ...

11. Creating an absolute URI using the UriBuilder from an XmlAdapter

I have an XmlAdapter to marshal associated objects in a class to their respective REST URI's:

public class AirportAdapter extends XmlAdapter<URI, Airport> {

public URI marshal(Airport airport) throws Exception {