Context: -- Given the following code I am getting exception. Please tell me why is it happening with clear explanation:
@GET
@Produces("application/xml")
public List getEmployee()
{
List<Employee> emp=new ArrayList<Employee>();
return emp;
}
@XmlRootElement
public class Employee{
}
When I am calling getEmployee service I am getting following exception:
Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class java.util.ArrayList, and Java type interface java.util.List, and MIME media type application/xml was not found ... 30 more
Thanks