When I am a rest plugin module, some kinds of resource problem

I have the error which is below , when I make a rest plugin…

I have searched for this issue… I have tried many way of which have been given…
but… I could not find out a solution which is suitable for me…

io.atlassian.util.concurrent.LazyReference$InitializationException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156)
at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116)
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:430)
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:423)
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:288)
at com.atlassian.plugins.rest.module.servlet.DefaultRestServletModuleManager.getFilters(DefaultRestServletModuleManager.java:127)
… 39 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
… 24 filtered
at com.atlassian.labs.httpservice.resource.ResourceFilter.doFilter(ResourceFilter.java:59)
… 32 filtered
at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
… 1 filtered
at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
… 16 filtered
at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
… 19 filtered
at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
… 10 filtered
at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
… 4 filtered
at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
… 26 filtered
at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
… 24 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Caused by: 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:99)
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)
… 1 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.initiate(RestDelegatingServletFilter.java:164)
… 5 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.initServletContainer(RestDelegatingServletFilter.java:89)
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.init(RestDelegatingServletFilter.java:62)
… 1 filtered
at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:499)
at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:486)
at io.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:332)
at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:150)
… 213 more

When I tried to find out “The ResourceConfig instance does not contain any root resource classes.”
I could find out “https://clover7-webnote.tistory.com/171”… but I don’t know about how to apply it for jira plugin module…

Here is my atlassian-plugin.xml

<?xml version="1.0" encoding="UTF-8"?>

<atlassian-plugin key="${atlassian.plugin.key}" name="${project.name}" plugins-version="2"> 
  <plugin-info> 
    <description>${project.description}</description>  
    <version>${project.version}</version>  
    <vendor name="${project.organization.name}" url="${project.organization.url}"/>  
    <param name="plugin-icon">images/plugin/plugin-icon.png</param>  
    <param name="plugin-logo">images/plugin/plugin-logo.png</param>  
    <param name="plugin-banner">images/plugin/plugin-banner.png</param>  
    <param name="vendor-icon">images/plugin/vendor-icon.png</param>  
    <param name="vendor-logo">images/plugin/vendor-logo.png</param> 
  </plugin-info>  
  <!-- add our i18n resource -->  
  <resource type="i18n" name="i18n" location="portal-automation-issue-jira"/>  
  <!-- add our web resources -->  
  <web-resource key="portal-automation-issue-jira-resources" name="portal-automation-issue-jira Web Resources"> 
    <dependency>com.atlassian.auiplugin:ajs</dependency>  
    <resource type="download" name="portal-automation-issue-jira.css" location="/css/portal-automation-issue-jira.css"/>  
    <resource type="download" name="portal-automation-issue-jira.js" location="/js/portal-automation-issue-jira.js"/>  
    <resource type="download" name="images/" location="/images"/>  
    <context>portal-automation-issue-jira</context> 
  </web-resource>

  <web-resource key="portal-automation-issue-jira-resources--planning-page" name="portal-automation-issue-jira Web Resources for Planning Page">
    <dependency>com.atlassian.auiplugin:ajs</dependency>
    <dependency>com.atlassian.auiplugin:aui-select2</dependency>
    <dependency>com.atlassian.auiplugin:aui-experimental-soy-templates</dependency>
    <transformation extension="soy">
      <transformer key="soyTransformer">
        <functions>com.atlassian.confluence.plugins.soy:soy-core-functions</functions>
      </transformer>
    </transformation>
    <resource type="download" name="portal-automation-issue-soy.js" location="templates-soy/portal-automation-issue.soy"/>
    <resource type="download" name="portal-automation-issue-page-controller.js" location="/js/portal-automation-issue-page-controller.js"/>
    <context>portal-automation-issue-jira</context>
  </web-resource>

  <resource type="download" name="images/" location="/images"/>

  <webwork1 key="portal-admin-automation-for-jira" name="portal admin of automaion for jira" i18n-name-key="portal-admin-automation-for-jira.name"> 
    <description key="portal-admin-automation-for-jira.description">The portal admin of automaion for jira Plugin</description>  
    <actions> 
      <action name="com.flyingpear.jira.plugin.jira.webwork.PortalAdminWebworkAction" alias="PortalAdminWebworkAction"> 
        <view name="portal-admin-webwork-action">/templates/portal-admin-automation-for-jira-module/portal-admin-automation-for-jira-success.vm</view> 
      </action> 
    </actions> 
  </webwork1>

  <web-section key="portal_admin_automation_for_jira_section" name="portal_admin_automation_for_jira_section" location="admin_plugins_menu" weight="20" i18n-name-key="portal-admin-automation-for-jira-section.name"> 
    <label key="portal-admin-automation-for-jira-section.name"/> 
  </web-section>

  <web-item key="portal_admin_automation_for_jira_webitem" name="portal_admin_automation_for_jira_webitem" section="admin_plugins_menu/portal_admin_automation_for_jira_section" weight="15" i18n-name-key="portal-admin-automation-for-jira-item.name"> 
    <label key="portal-admin-automation-for-jira-item.name"/>  
    <link linkId="portal_admin_automation_for_jira_webitem_link">/secure/PortalAdminWebworkAction.jspa</link> 
  </web-item>

  <rest name="Issue Search Resource"
        i18n-name-key="issue-search-resource.name"
        key="issue-search-resource"
        path="/portal-issue-automation"
        version="1.0">
    <description key="issue-search-resource.description">Portal Admin Automation Rest Resources  </description>
    <package>com.flyingpear.jira.plugin.rest</package>
  </rest>

</atlassian-plugin>

I have found out the answer the fact that there is something wrong in the atlassian-plugin.xml for the test unit…

so… I eliminated the wrong part… then it is ok

1 Like