Я пытаюсь создать новый сервлет в моем приложении. Я работаю над RAD на Websphere. Вот этот класс:
import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import framework.Log;
@Path("/checks")
public class Checks{
private static final long serialVersionUID = -6790501052160536787L;
private static final String NCC = Checks.class.getCanonicalName();
@GET
@Path("list")
@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
public Response doGetListe() {
Response.ResponseBuilder rb = Response.status(Response.Status.OK);
rb.entity("[{ 'test' : ' test ' }]");
return rb.build();
}
}
У меня не так много подробностей, так что я хотел бы знать, откуда эта ошибка? Или как я могу отладить его? Если я ставлю контрольные точки на моем классе, они никогда не срабатывают. Ошибка должна быть перед выполнением класса. Поскольку я действительно не знаю, как все это работает, я хотел бы получить несколько советов по устранению этой ошибки.
РЕДАКТИРОВАТЬ:
Вот журналы:
[24/02/20 13:29:32:172 CET] 000000c8 PackagesResou I Scanning for root resource and provider classes in the packages:
cnaf.oma.checkenv.rest.checks
[24/02/20 13:29:32:181 CET] 000000c8 ScanningResou I Root resource classes found:
class cnaf.oma.checkenv.rest.checks.Checks
[24/02/20 13:29:32:186 CET] 000000c8 ScanningResou I No provider classes found.
[24/02/20 13:29:32:219 CET] 000000c8 WebApplicatio I Initiating Jersey application, version 'Jersey: 1.19.3 10/24/2016 03:43 PM'
[24/02/20 13:29:32:539 CET] 000000c8 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper init Uncaught.init.exception.thrown.by.servlet
[24/02/20 13:29:32:542 CET] 000000c8 PackagesResou I Scanning for root resource and provider classes in the packages:
cnaf.oma.checkenv.rest.checks
[24/02/20 13:29:32:549 CET] 000000c8 ScanningResou I Root resource classes found:
class cnaf.oma.checkenv.rest.checks.Checks
[24/02/20 13:29:32:550 CET] 000000c8 ScanningResou I No provider classes found.
[24/02/20 13:29:32:567 CET] 000000c8 WebApplicatio I Initiating Jersey application, version 'Jersey: 1.19.3 10/24/2016 03:43 PM'
[24/02/20 13:29:32:975 CET] 000000c8 ServletWrappe E com.ibm.ws.webcontainer.servlet.ServletWrapper init Uncaught.init.exception.thrown.by.servlet
[24/02/20 13:29:32:977 CET] 000000c8 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Erreur de servlet]-[OmegaEnvCheckAPI]: java.lang.VerifyError: JVMVRFY013 violation de contrainte de chargement de classe; classe=com/sun/xml/bind/DatatypeConverterImpl, méthode=parseQName(Ljava/lang/String;Ljavax/xml/namespace/NamespaceContext;)Ljavax/xml/namespace/QName;, pc=0
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:304)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$3.run(JAXBContextImpl.java:303)
at java.security.AccessController.doPrivileged(AccessController.java:594)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:302)
at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:145)
at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:236)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:95)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:507)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:186)
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:146)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:350)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:446)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:409)
at com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl.<init>(WadlApplicationContextImpl.java:103)
at com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:100)
at com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)
at com.sun.jersey.server.impl.application.RootResourceUriRules.<init>(RootResourceUriRules.java:106)
at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1359)
at com.sun.jersey.server.impl.application.WebApplicationImpl.access$700(WebApplicationImpl.java:180)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:799)
at com.sun.jersey.server.impl.application.WebApplicationImpl$13.f(WebApplicationImpl.java:795)
at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:795)
at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:790)
at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:509)
at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:339)
at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:605)
at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:207)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:394)
at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:577)
at javax.servlet.GenericServlet.init(GenericServlet.java:161)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:344)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:636)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:480)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1114)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:940)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1817)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:463)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:530)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:316)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:287)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1881)
А вот зависимости, если вам нужно больше, скажите мне:
<dependencies>
<!-- jersey rest -->
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
</dependency>
<!-- LOG4J -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>cnaf.ddd.omega.ome</groupId>
<artifactId>ome-service</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>