com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.

JFrog JIRA | Brennan Spies | 8 years ago
  1. 0

    The ArtifactoryRestServlet does not start due to the following exception in the Jersey lib: SRVE0100E: Did not realize init() exception thrown by servlet Jersey Web Application: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:713) at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:609) at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:472) at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:541) at com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContainer.java:465) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:147) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:190) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:317) at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1142) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:150) at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99) at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:787) at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:467) at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:304) at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:285) at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88) at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157) at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:655) at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:608) at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335) at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1312) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:814) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:965) at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2131) at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:341) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469) I tracked the issue down to the following configuration in the web.xml: <init-param> <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> <param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value> </init-param> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>org.artifactory.rest.system</param-value> </init-param> Turns out, if you look at the Jersey source, the PackagesResourceConfig class only looks for class files on the classpath using ClassLoader.getResources(String). This breaks in the current Maven build because the JAX-RS annotated classes are packaged in the artifactory-rest.jar in the WEB-INF/lib folder. This causes the resources not to be found on startup. The solution is one of the following: 1. Unpack the artifactory-rest.jar into the WEB-INF/classes folder, OR 2. Change the web.xml configuration to the following for the servlet <init-param> <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> <param-value>com.sun.jersey.api.core.ClasspathResourceConfig</param-value> </init-param> <init-param> <param-name>com.sun.jersey.config.property.classpath</param-name> <param-value>WEB-INF/lib/${artifactory-rest}.jar</param-value> </init-param>

    JFrog JIRA | 8 years ago | Brennan Spies
    com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
  2. 0

    The ArtifactoryRestServlet does not start due to the following exception in the Jersey lib: SRVE0100E: Did not realize init() exception thrown by servlet Jersey Web Application: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:713) at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:609) at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:472) at com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:541) at com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContainer.java:465) at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:147) at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:190) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:317) at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1142) at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:150) at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99) at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:787) at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:467) at com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:304) at com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:285) at com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88) at com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157) at com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:655) at com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:608) at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335) at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551) at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1312) at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129) at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569) at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:814) at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:965) at com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2131) at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:341) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469) I tracked the issue down to the following configuration in the web.xml: <init-param> <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> <param-value>com.sun.jersey.api.core.PackagesResourceConfig</param-value> </init-param> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>org.artifactory.rest.system</param-value> </init-param> Turns out, if you look at the Jersey source, the PackagesResourceConfig class only looks for class files on the classpath using ClassLoader.getResources(String). This breaks in the current Maven build because the JAX-RS annotated classes are packaged in the artifactory-rest.jar in the WEB-INF/lib folder. This causes the resources not to be found on startup. The solution is one of the following: 1. Unpack the artifactory-rest.jar into the WEB-INF/classes folder, OR 2. Change the web.xml configuration to the following for the servlet <init-param> <param-name>com.sun.jersey.config.property.resourceConfigClass</param-name> <param-value>com.sun.jersey.api.core.ClasspathResourceConfig</param-value> </init-param> <init-param> <param-name>com.sun.jersey.config.property.classpath</param-name> <param-value>WEB-INF/lib/${artifactory-rest}.jar</param-value> </init-param>

    JFrog JIRA | 8 years ago | Brennan Spies
    com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
  3. 0

    [CRUC-931] Getting "The ResourceConfig instance does not contain any root resource classes" when trying to configure Jira Fisheye Plugin - Atlassian JIRA

    atlassian.com | 1 year ago
    com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [CRUC-931] Getting "The ResourceConfig instance does not contain any root resource classes" when trying to configure Jira Fisheye Plugin - Atlassian JIRA

    atlassian.com | 11 months ago
    com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
  6. 0

    h3. Symptoms This is mostly seen when trying to configure Jira Fisheye Plugin, but can also occur if you are trying to login using the Rest API. The error throw in your Jira logs will look like: {code} 2009-05-19 14:02:29,838 http-8080-Processor25 ERROR [fisheye.rest.fisheye.FishEyeRestAuthenticationManagerImpl] Failed to authenticate user 'username': http://FISHEYE_HOST:8060/rest-service/auth-v1/login?password=********&userName=username returned 500 Internal Server Error 2009-05-19 14:02:29,838 http-8080-Processor25 ERROR [jira.ext.fisheye.FishEyeManagerImpl] Failed to retrieve FishEye repositories from http://FISHEYE_HOST:8060/ java.io.IOException: Failed to authenticate with FishEye. See logs for more details. at com.atlassian.jira.ext.fisheye.rest.fisheye.FishEyeRestAuthenticationManagerImpl.authenticate(FishEyeRestAuthenticationManagerImpl.java:43) at com.atlassian.jira.ext.fisheye.rest.fisheye.FishEyeRestAuthenticationManagerImpl.authenticateWithCrucible(FishEyeRestAuthenticationManagerImpl.java:58) {code} In your fisheye-error.log.* logs you see: {code} 2009-05-19 16:07:14,311 ERROR [btpool0-3] org.mortbay.log sun.reflect.NativeMethodAccessorImpl-invoke0 - /rest-service/auth-v1/login com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes. at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:774) at com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:671) at com.sun.jersey.spi.spring.container.servlet.SpringServlet.initiate(SpringServlet.java:66) {code} Your Fishye server is installed on a windows machine under a folder which contains a space, for example "C:\Program Files\crucible-1.6.6". To check where your Fisheye is installed go to Fisheye Administration > Sys Info/Support > System Info, and check your FISHEYE_HOME variable which represents where your Fisheye or Crucible is installed. h3. Workaround Move your Fisheye or Crucible Installation to somewhere without a space, for example C:\crucible-1.6.6

    Atlassian JIRA | 8 years ago | Mads Nissen
    com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.sun.jersey.api.container.ContainerException

      The ResourceConfig instance does not contain any root resource classes.

      at com.sun.jersey.impl.application.WebApplicationImpl.processRootResources()
    2. com.sun.jersey
      WebApplicationImpl.initiate
      1. com.sun.jersey.impl.application.WebApplicationImpl.processRootResources(WebApplicationImpl.java:713)
      2. com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:609)
      3. com.sun.jersey.impl.application.WebApplicationImpl.initiate(WebApplicationImpl.java:472)
      3 frames
    3. Jersey
      ServletContainer.init
      1. com.sun.jersey.spi.container.servlet.ServletContainer.initiate(ServletContainer.java:541)
      2. com.sun.jersey.spi.container.servlet.ServletContainer.load(ServletContainer.java:465)
      3. com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:147)
      3 frames
    4. WebSphere
      ServletWrapper.init
      1. com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:190)
      1 frame
    5. com.ibm.ws
      ServletWrapper.init
      1. com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:317)
      1 frame
    6. WebSphere
      ServletWrapper.initialize
      1. com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1142)
      1 frame
    7. com.ibm.ws
      ServletWrapper.initialize
      1. com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:150)
      1 frame
    8. com.ibm.wsspi
      WebExtensionProcessor.createServletWrapper
      1. com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:99)
      1 frame
    9. WebSphere
      WebApp.commonInitializationFinish
      1. com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:787)
      2. com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:467)
      3. com.ibm.ws.webcontainer.webapp.WebApp.commonInitializationFinish(WebApp.java:304)
      3 frames
    10. com.ibm.ws
      WebContainer.addWebApplication
      1. com.ibm.ws.wswebcontainer.webapp.WebApp.initialize(WebApp.java:285)
      2. com.ibm.ws.wswebcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:88)
      3. com.ibm.ws.wswebcontainer.VirtualHost.addWebApplication(VirtualHost.java:157)
      4. com.ibm.ws.wswebcontainer.WebContainer.addWebApp(WebContainer.java:655)
      5. com.ibm.ws.wswebcontainer.WebContainer.addWebApplication(WebContainer.java:608)
      5 frames
    11. WebSphere
      ApplicationMgrImpl$AppInitializer.run
      1. com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:335)
      2. com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:551)
      3. com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1312)
      4. com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1129)
      5. com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:569)
      6. com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:814)
      7. com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:965)
      8. com.ibm.ws.runtime.component.ApplicationMgrImpl$AppInitializer.run(ApplicationMgrImpl.java:2131)
      8 frames
    12. com.ibm.wsspi
      WsComponentImpl$_AsynchInitializer.run
      1. com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:341)
      1 frame
    13. com.ibm.ws
      ThreadPool$Worker.run
      1. com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)
      1 frame