Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

LazyReference$InitializationException when adding a Maven Dependency Edited

I want to add this dependency to Maven pom.xml:


<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.17</version>
</dependency>

When I restart the application it gives the LazyReference$InitializationException. I guess that is because of existing com.sun.jersey library with different version and with scope of "provided". But I need to use that version. How can I configure pom to use my version without an exception?

This is the stack trace:



2020-12-26 18:31:54,089 http-nio-2990-exec-7 ERROR admin 1111x4891x1 4qsfr0 0:0:0:0:0:0:0:1 /rest/myrestresource/1.0/message/ [c.a.plugin.servlet.DefaultServletModuleManager] Unable to create new reference LazyLoadedFilterReference{descriptor=com.stack.app.stackOverflow:my-rest-resource-filter (The My Rest Resource Plugin), filterConfig=com.atlassian.plugin.servlet.filter.PluginFilterConfig@1c9a5ba0}
com.atlassian.util.concurrent.LazyReference$InitializationException: com.sun.jersey.api.container.ContainerException: The ResourceConfig instance does not contain any root resource classes.
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getInstance(DefaultServletModuleManager.java:447)
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilter(DefaultServletModuleManager.java:440)
at com.atlassian.plugin.servlet.DefaultServletModuleManager.getFilters(DefaultServletModuleManager.java:300)
at com.atlassian.plugins.rest.module.servlet.DefaultRestServletModuleManager.getFilters(DefaultRestServletModuleManager.java:121)
... 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.<init>(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:159)
... 5 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.initServletContainer(RestDelegatingServletFilter.java:88)
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.init(RestDelegatingServletFilter.java:61)
... 1 filtered
at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:516)
at com.atlassian.plugin.servlet.DefaultServletModuleManager$LazyLoadedFilterReference.create(DefaultServletModuleManager.java:503)
at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:325)
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
... 213 more

 

By the way the application is an Atlassian Jira Server plugin, but I hope that I can get some help from Maven users.

This problem is easily reproducible. To reproduce it, one can create a new jira plugin, add a rest plugin module, and then add the dependency above into the pom.xml. After running mvn package this problem occurs.

Here is also the dependency tree after I add my dependency and error occurs:

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ stackOverflow ---
[INFO] com.stack.app:stackOverflow:atlassian-plugin:1.0.0-SNAPSHOT
[INFO] +- com.atlassian.jira:jira-api:jar:7.13.0:provided
[INFO] | +- com.atlassian.annotations:atlassian-annotations:jar:1.1.0:provided
[INFO] | | \- com.google.code.findbugs:jsr305:jar:3.0.0:provided
[INFO] | +- com.atlassian.ofbiz:entityengine-share:jar:1.3.10:provided
[INFO] | | \- xerces:xercesImpl:jar:2.4.0:provided
[INFO] | +- com.atlassian.ofbiz:entityengine:jar:1.3.10:provided
[INFO] | | \- jta:jta:jar:1.0.1:provided
[INFO] | +- com.atlassian.collectors:atlassian-collectors-util:jar:1.1:provided
[INFO] | +- opensymphony:webwork:jar:1.4-atlassian-30:provided
[INFO] | | \- com.atlassian.html:atlassian-html-encoder:jar:1.4:provided
[INFO] | +- webwork:pell-multipart-request:jar:1.31.0:provided
[INFO] | +- com.atlassian.core:atlassian-core:jar:5.0.9:provided
[INFO] | | +- commons-collections:commons-collections:jar:3.1:provided
[INFO] | | +- dom4j:dom4j:jar:1.4:provided
[INFO] | | | +- xml-apis:xml-apis:jar:1.0.b2:provided
[INFO] | | | +- jaxen:jaxen:jar:1.0-FCS:provided
[INFO] | | | +- saxpath:saxpath:jar:1.0-FCS:provided
[INFO] | | | +- msv:msv:jar:20020414:provided
[INFO] | | | +- relaxngDatatype:relaxngDatatype:jar:20020414:provided
[INFO] | | | \- isorelax:isorelax:jar:20020414:provided
[INFO] | | \- com.atlassian.image:atlassian-image-consumer:jar:1.0.1:provided
[INFO] | +- com.atlassian.core:atlassian-core-user:jar:5.0.9:provided
[INFO] | +- com.atlassian.core:atlassian-core-thumbnail:jar:5.0.9:provided
[INFO] | | +- com.twelvemonkeys.imageio:imageio-jpeg:jar:3.2:provided
[INFO] | | | +- com.twelvemonkeys.imageio:imageio-core:jar:3.2:provided
[INFO] | | | +- com.twelvemonkeys.imageio:imageio-metadata:jar:3.2:provided
[INFO] | | | +- com.twelvemonkeys.common:common-lang:jar:3.2:provided
[INFO] | | | +- com.twelvemonkeys.common:common-io:jar:3.2:provided
[INFO] | | | \- com.twelvemonkeys.common:common-image:jar:3.2:provided
[INFO] | | \- com.twelvemonkeys.imageio:imageio-tiff:jar:3.2:provided
[INFO] | +- com.atlassian.extras:atlassian-extras:jar:3.2:provided
[INFO] | | \- commons-codec:commons-codec:jar:1.3:provided
[INFO] | +- com.atlassian.velocity:atlassian-velocity:jar:1.3:provided
[INFO] | | +- opensymphony:oscore:jar:2.2.7:provided
[INFO] | | \- org.apache.velocity:velocity:jar:1.6.4:provided
[INFO] | +- osworkflow:osworkflow:jar:2.9.0-atlassian-1:provided
[INFO] | +- opensymphony:propertyset:jar:1.5:provided
[INFO] | +- com.atlassian.cache:atlassian-cache-api:jar:3.2.0:provided
[INFO] | | +- com.atlassian.util.concurrent:atlassian-util-concurrent:jar:0.0.12:provided
[INFO] | | \- com.atlassian.instrumentation:atlassian-instrumentation-core:jar:2.2.2:provided
[INFO] | +- com.atlassian.beehive:beehive-api:jar:1.3.0:provided
[INFO] | +- com.atlassian.tenancy:atlassian-tenancy-api:jar:1.4.0:provided
[INFO] | | \- com.atlassian.event:atlassian-event:jar:2.3.2:provided
[INFO] | +- com.atlassian.upgrade:upgrade-task-framework-api:jar:2.0.2:provided
[INFO] | +- com.atlassian.crowd:embedded-crowd-api:jar:2.10.4:provided
[INFO] | +- com.google.guava:guava:jar:18.0:provided
[INFO] | +- com.atlassian.fugue:fugue:jar:2.6.0:provided
[INFO] | +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13-atlassian-1:provided
[INFO] | +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13-atlassian-1:provided
[INFO] | +- javax.mail:javax.mail-api:jar:1.6.0:provided
[INFO] | +- com.sun.mail:javax.mail:jar:1.6.0:provided
[INFO] | +- com.atlassian.mail:atlassian-mail:jar:2.8.6:provided
[INFO] | | +- commons-beanutils:commons-beanutils:jar:1.6.1:provided
[INFO] | | \- commons-digester:commons-digester:jar:1.4.1:provided
[INFO] | +- oro:oro:jar:2.0.7:provided
[INFO] | +- com.atlassian.threadlocal:atlassian-threadlocal:jar:1.3:provided
[INFO] | +- com.atlassian.applinks:applinks-api:jar:5.4.5:provided
[INFO] | +- com.google.javascript&colon;closure-compiler:jar:v20151216:provided
[INFO] | +- com.atlassian.velocity.htmlsafe:velocity-htmlsafe:jar:1.4:provided
[INFO] | | \- commons-pool:commons-pool:jar:1.5.4:provided
[INFO] | +- com.atlassian.plugins:atlassian-plugins-api:jar:4.5.1:provided
[INFO] | +- com.atlassian.plugins:atlassian-plugins-webfragment:jar:4.1.0:provided
[INFO] | +- com.atlassian.plugins:atlassian-plugins-webfragment-api:jar:4.1.0:provided
[INFO] | +- com.atlassian.ozymandias:atlassian-plugin-point-safety:jar:0.10:provided
[INFO] | +- jfree:jfreechart:jar:1.0.13:provided
[INFO] | +- com.atlassian.plugins:atlassian-plugins-webresource:jar:3.5.41:provided
[INFO] | | +- com.atlassian.plugins:atlassian-plugins-webresource-spi:jar:3.5.41:provided
[INFO] | | +- com.atlassian.plugins:atlassian-plugins-webresource-api:jar:3.5.41:provided
[INFO] | | +- org.tuckey:urlrewritefilter:jar:4.0.4:provided
[INFO] | | \- com.atlassian.sourcemap:sourcemap:jar:1.7.6:provided
[INFO] | +- com.atlassian.plugins:atlassian-plugins-webresource-compiler-gcc:jar:3.5.41:provided
[INFO] | +- jfree:jcommon:jar:1.0.8:provided
[INFO] | +- com.atlassian.gadgets:atlassian-gadgets-api:jar:4.2.32:provided
[INFO] | +- com.atlassian.johnson:atlassian-johnson-core:jar:3.4.0:provided
[INFO] | | \- com.atlassian.plugins:atlassian-plugins-servlet:jar:3.2.8:provided
[INFO] | +- joda-time:joda-time:jar:2.8.2:provided
[INFO] | +- commons-lang:commons-lang:jar:2.6:provided
[INFO] | +- org.apache.commons:commons-lang3:jar:3.3.2:provided
[INFO] | +- commons-io:commons-io:jar:2.1:provided
[INFO] | +- commons-httpclient:commons-httpclient:jar:3.1-atlassian-2:provided
[INFO] | +- log4j:log4j:jar:1.2.16:provided
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.9:provided
[INFO] | +- com.atlassian.profiling:atlassian-profiling:jar:1.9:provided
[INFO] | +- com.atlassian.scheduler:atlassian-scheduler-api:jar:1.7.0:provided
[INFO] | +- com.atlassian.analytics:analytics-api:jar:5.6.2:provided
[INFO] | +- javax.servlet:javax.servlet-api:jar:3.0.1:provided
[INFO] | +- com.atlassian.application:atlassian-application-api:jar:1.2:provided
[INFO] | \- javax.validation:validation-api:jar:1.1.0.Final:provided
[INFO] +- junit:junit:jar:4.10:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.1:test
[INFO] +- com.atlassian.plugin:atlassian-spring-scanner-annotation:jar:1.2.13:provided
[INFO] +- javax.inject:javax.inject:jar:1:provided
[INFO] +- com.atlassian.plugins:atlassian-plugins-osgi-testrunner:jar:2.0.1:test
[INFO] | \- com.atlassian.upm:upm-api:jar:2.15:test
[INFO] +- javax.ws.rs:jsr311-api:jar:1.1.1:provided
[INFO] +- com.google.code.gson:gson:jar:2.2.2-atlassian-1:compile
[INFO] +- javax.servlet:servlet-api:jar:2.4:provided
[INFO] +- javax.xml.bind:jaxb-api:jar:2.3.1:provided
[INFO] | \- javax.activation:javax.activation-api:jar:1.2.0:provided
[INFO] +- com.atlassian.plugins.rest:atlassian-rest-common:jar:1.0.2:provided
[INFO] | +- com.atlassian.plugins.rest:com.atlassian.jersey-library:pom:1.0.2:provided
[INFO] | | +- com.sun.jersey:jersey-server:jar:1.0.3:provided
[INFO] | | | \- asm:asm:jar:3.1:provided
[INFO] | | +- com.sun.jersey:jersey-json:jar:1.0.3:provided
[INFO] | | | +- org.codehaus.jettison:jettison:jar:1.0.1:provided
[INFO] | | | \- org.codehaus.jackson:jackson-asl:jar:0.9.4:provided
[INFO] | | \- commons-fileupload:commons-fileupload:jar:1.2.1:provided
[INFO] | \- net.sourceforge.findbugs:jsr305:jar:1.3.2:provided
[INFO] +- com.atlassian.sal:sal-api:jar:2.6.0:provided
[INFO] +- org.apache.wink:wink-client:jar:1.4:test
[INFO] | +- org.apache.wink:wink-common:jar:1.4:test
[INFO] | | +- org.apache.geronimo.specs:geronimo-jaxrs_1.1_spec:jar:1.0:test
[INFO] | | \- org.apache.geronimo.specs:geronimo-annotation_1.1_spec:jar:1.0:test
[INFO] | +- com.sun.xml.bind:jaxb-impl:jar:2.2.1.1:provided
[INFO] | \- javax.activation:activation:jar:1.1:provided
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] \- com.sun.jersey:jersey-client:jar:1.17:compile
[INFO] \- com.sun.jersey:jersey-core:jar:1.17:compile

Any help appreciated, thank you

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
Community showcase
Published in Trello

📹 Favorite Trello templates

Hello Community!  My name is Brittany Joiner and I am a Trello enthusiast and Atlassian Community Leader. In this video, I'll share my favorite Trello templates. Templates mentioned in ...

75 views 4 5
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you