– Code –
import java.util.ArrayList;
import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import com.sun.jersey.spi.resource.Singleton;
@Produces(“application/xml”)
@Path(“processDefinitions”)
@Singleton
public class ProcessDefinitionResource {
@GET
public List<ProcessDefinition> getProcessDefinitions() {
List<ProcessDefinition> ProcessDefinitions = new ArrayList<ProcessDefinition>();
ProcessDefinition definition = new ProcessDefinition();
definition.setId(“01”);
definition.setName(“Test Definition”);
ProcessDefinitions.add(definition);
return ProcessDefinitions;
}
}
Exception
SEVERE: A message body writer for Java type, class java.util.ArrayList, and MIME media type, application/xml, was not found
javax.ws.rs.WebApplicationException
at com.sun.jersey.spi.container.ContainerResponse.write(ContainerResponse.java:239)
at com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:752)
at com.sun.jersey.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:692)
at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:344)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
Any Idea Anything Missing – workbench 7.0 issue