I have a web service in Netbeans that takes the mysql data I have in a remote glassfish server. When I test the service in local, it generates both the xml and the json. The problem I have when I upload the service to the server that does not generate the json, the xml if.
The code of the get method of a table in the database is:
@GET
@Override
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public List<Estats> findAll() {
return super.findAll();
}
In the Postman I get the XML and if I change to JSON I get Unexpected '<'
. When I open the url in the browser, it only shows me the xml.
I have tried to remove the MediaType.APPLICATION_XML
so that it does not show me the xml and I get the following error:
That is:
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it
from fulfilling this request.
exception
javax.servlet.ServletException:
org.glassfish.jersey.server.ContainerException:
java.lang.NoClassDefFoundError: Could not initialize class
org.eclipse.persistence.jaxb.BeanValidationHelper
root cause
org.glassfish.jersey.server.ContainerException:
java.lang.NoClassDefFoundError: Could not initialize class
org.eclipse.persistence.jaxb.BeanValidationHelper
root cause
java.lang.NoClassDefFoundError: Could not initialize class
org.eclipse.persistence.jaxb.BeanValidationHelper
note The full stack traces of the exception and its root causes are
available in the GlassFish Server Open Source Edition 4.1.1 logs.
How can I solve this? Thank you very much.