Jersey JAXB can't handle interfaces

Ich habe ein Web-Service mit JAX-RS erstellt. Nun möchte ich im WebService ein Interface an den Client rüberschicken mit jaxb. Leider bekomme ich auf der Client Seite eine Exception, dass JAXB keine Interfaces behandeln kann…

WebService Resource Klasse:

import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.xml.bind.JAXBElement;
import javax.xml.namespace.QName;

import xx.xxxx.xxx.xxx.xxx.MessdatenShow;

@Stateless
@Path("/helloworld")
public class Resource {

	private MessdatenShow messdaten;

	**@GET
	@Path("/getMessdatenShow")
	@Produces(MediaType.APPLICATION_XML)
	public JAXBElement<MessdatenShow> getMessdaten() throws NamingException {
		messdaten = (MessdatenShow) new InitialContext().lookup(MessdatenShow.lookUpName);

		return new JAXBElement<MessdatenShow>(new QName("messdaten"), MessdatenShow.class, messdaten);
	}**

	@GET
	@Produces("text/html")
	@Path("/html")
	public String getHTMLMessage() {

		return "<html> " + "<title>" + "TEST CONNECTION JAX-RS" + "</title>" + "<body><center><h1>" + "TEST CONNECTION JAX-RS" + "</body></h1></center>" + "</html>";

	}
}

Interface

{
  public static final String lookUpName = "xx.xxxx.xxx.xxx.xxx.MessdatenShowBean#xx.xxxx.xxx.xxx.xxx.MessdatenShow"; //$NON-NLS-1$

....
}

Client Klasse:


import java.net.URI;

import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.UriBuilder;
import javax.xml.bind.JAXBElement;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.GenericType;
import com.sun.jersey.api.client.WebResource;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;

import xx.xxxx.xxx.xxx.xxx.MessdatenShow;

public class TestClient
{
  public static void main(String[] args)
  {
    ClientConfig config = new DefaultClientConfig();
    Client client = Client.create(config);
    WebResource service = client.resource(getBaseURI());

    GenericType<JAXBElement<MessdatenShow>> messdatenType = new GenericType<JAXBElement<MessdatenShow>>() {};

    System.out.println(service.path("test").path("helloworld/html").accept(MediaType.TEXT_HTML).get(String.class)); //$NON-NLS-1$ //$NON-NLS-2$

    MessdatenShow messdaten = service
            .path("test").path("helloworld/getMessdatenShow").accept(MediaType.APPLICATION_XML).get(messdatenType).getValue(); //$NON-NLS-1$ //$NON-NLS-2$


    System.out.println(messdaten.toString());
  }


  private static URI getBaseURI()
  {
    return UriBuilder.fromUri("http://localhost:7001/test-app").build(); //$NON-NLS-1$
  }
}```

Exception auf der Client-Seite:

```Exception in thread "main" javax.ws.rs.WebApplicationException: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
xx.xxxx.xxx.xxx.xxx.MessdatenShow is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at xx.xxxx.xxx.xxx.xxx.MessdatenShow
xx.xxxx.xxx.xxx.xxx.MessdatenShow does not have a no-arg default constructor.
	this problem is related to the following location:
		at xx.xxxx.xxx.xxx.xxx.MessdatenShow

	at com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider.readFrom(AbstractJAXBElementProvider.java:114)
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider.readFrom(AbstractJAXBElementProvider.java:79)
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:553)
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:523)
	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:686)
	at com.sun.jersey.api.client.WebResource.access$300(WebResource.java:74)
	at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:508)
	at appclient.TestClient.main(TestClient.java:32)
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 2 counts of IllegalAnnotationExceptions
xx.xxxx.xxx.xxx.xxx.MessdatenShow is an interface, and JAXB can't handle interfaces.
	this problem is related to the following location:
		at xx.xxxx.xxx.xxx.xxx.MessdatenShow
xx.xxxx.xxx.xxx.xxx.MessdatenShow does not have a no-arg default constructor.
	this problem is related to the following location:
		at xx.xxxx.xxx.xxx.xxx.MessdatenShow

	at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Builder.check(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(Unknown Source)
	at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(Unknown Source)
	at com.sun.xml.internal.bind.v2.ContextFactory.createContext(Unknown Source)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
	at javax.xml.bind.ContextFinder.newInstance(Unknown Source)
	at javax.xml.bind.ContextFinder.find(Unknown Source)
	at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
	at javax.xml.bind.JAXBContext.newInstance(Unknown Source)
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getStoredJAXBContext(AbstractJAXBProvider.java:189)
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getJAXBContext(AbstractJAXBProvider.java:182)
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getUnmarshaller(AbstractJAXBProvider.java:134)
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBProvider.getUnmarshaller(AbstractJAXBProvider.java:117)
	at com.sun.jersey.core.provider.jaxb.AbstractJAXBElementProvider.readFrom(AbstractJAXBElementProvider.java:110)
	... 7 more

Eine Idee wie ich das Problem lösen kann?

Hab ich ebenfalls bei einem Projekt. Aktuell noch keine Lösung gefunden -.-