The ResourceConfig instance does not contain any root resource classes

当在 myEclipse2017 下部署 web 项目的时候,会报如下错误:

严重: StandardWrapper.Throwable
com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
	at com.sun.jersey.server.impl.application.RootResourceUriRules.(RootResourceUriRules.java:103)
	at com.sun.jersey.server.impl.application.WebApplicationImpl._initiate(WebApplicationImpl.java:1182)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.access$600(WebApplicationImpl.java:161)
	at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:698)
	at com.sun.jersey.server.impl.application.WebApplicationImpl$12.f(WebApplicationImpl.java:695)
	at com.sun.jersey.spi.inject.Errors.processWithErrors(Errors.java:197)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:695)
	at com.sun.jersey.server.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:690)
	at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:438)
	at com.sun.jersey.spi.container.servlet.ServletContainer$InternalWebComponent.initiate(ServletContainer.java:287)
	at com.sun.jersey.spi.container.servlet.WebComponent.load(WebComponent.java:587)

The ResourceConfig instance does not contain any root resource classes_第1张图片

 

解决方式

因为我们在新建 web项目的时候,在 web.xml 文件里面会默认生成

  
    JAX-RS Tools Generated - Do not modify
    JAX-RS Servlet
    com.sun.jersey.spi.container.servlet.ServletContainer
    1
  
  
    JAX-RS Servlet
    /jaxrs/*
  

把它注释掉或删除掉,重新部署即可

The ResourceConfig instance does not contain any root resource classes_第2张图片

 

 

 

你可能感兴趣的:(错误累积(错题本))