启动简单的Jersey webapp

时间:2014-04-29 12:27:40

标签: rest nullpointerexception jersey init servletexception

我想启动一个简单的Jersey webapp。这是我在尝试访问资源时从Tomcat获得的错误。

type Exception report

  

消息Servlet.init()用于servlet Jersey REST服务抛出异常

说明服务器遇到internal error,导致服务器无法完成此请求。

例外

  

javax.servlet.ServletException:servlet的REST Servlet.init()   服务引发了异常     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)     org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)     org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)     java.lang.Thread.run(未知来源)

根本原因

  

显示java.lang.NullPointerException     com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:287)     com.sun.xml.bind.v2.model.impl.PropertyInfoImpl.calcXmlName(PropertyInfoImpl.java:262)     com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl.getTypes(ElementPropertyInfoImpl.java:96)     com.sun.xml.bind.v2.model.impl.RuntimeElementPropertyInfoImpl.getTypes(RuntimeElementPropertyInfoImpl.java:50)     com.sun.xml.bind.v2.model.impl.ElementPropertyInfoImpl $ 1.尺寸(ElementPropertyInfoImpl.java:42)     java.util.AbstractList $ Itr.hasNext(未知来源)     com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:139)     com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:49)     com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:41)     com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:189)     com.sun.xml.bind.v2.model.impl.RegistryInfoImpl。(RegistryInfoImpl.java:63)     com.sun.xml.bind.v2.model.impl.ModelBuilder.addRegistry(ModelBuilder.java:232)     com.sun.xml.bind.v2.model.impl.ModelBuilder.getTypeInfo(ModelBuilder.java:201)     com.sun.xml.bind.v2.runtime.JAXBContextImpl $ 3.run(JAXBContextImpl.java:352)     com.sun.xml.bind.v2.runtime.JAXBContextImpl $ 3.run(JAXBContextImpl.java:350)     java.security.AccessController.doPrivileged(本机方法)     com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:349)     com.sun.xml.bind.v2.runtime.JAXBContextImpl。(JAXBContextImpl.java:215)     com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:76)     com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:55)     com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:124)     sun.reflect.NativeMethodAccessorImpl.invoke0(原生方法)     sun.reflect.NativeMethodAccessorImpl.invoke(未知来源)     sun.reflect.DelegatingMethodAccessorImpl.invoke(未知来源)     java.lang.reflect.Method.invoke(未知来源)     javax.xml.bind.ContextFinder.newInstance(未知来源)     javax.xml.bind.ContextFinder.find(未知来源)     javax.xml.bind.JAXBContext.newInstance(未知来源)     javax.xml.bind.JAXBContext.newInstance(未知来源)     com.sun.jersey.server.impl.wadl.WadlApplicationContextImpl。(WadlApplicationContextImpl.java:95)     com.sun.jersey.server.impl.wadl.WadlFactory.init(WadlFactory.java:96)     com.sun.jersey.server.impl.application.RootResourceUriRules.initWadl(RootResourceUriRules.java:169)     com.sun.jersey.server.impl.application.RootResourceUriRules。(RootResourceUriRules.java:106)     com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1300)     com.sun.jersey.server.impl.application.WebApplicationImpl.access $ 700(WebApplicationImpl.java:163)     com.sun.jersey.server.impl.application.WebApplicationImpl $ 13.f(WebApplicationImpl.java:769)     com.sun.jersey.server.impl.application.WebApplicationImpl $ 13.f(WebApplicationImpl.java:765)     com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:193)     com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:765)     com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:760)     com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:489)     com.sun.jersey.spi.container.servlet.ServletContainer $ InternalWebComponent.initiate(ServletContainer.java:319)     com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:609)     com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:210)     com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:374)     com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:557)     javax.servlet.GenericServlet.init(GenericServlet.java:212)     org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)     org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)     org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)     org.apache.coyote.http11.Http11Protocol $ Http11ConnectionHandler.process(Http11Protocol.java:606)     org.apache.tomcat.util.net.JIoEndpoint $ Worker.run(JIoEndpoint.java:489)     java.lang.Thread.run(未知来源)

0 个答案:

没有答案