Home > Net >  NoSuchMethodError in Camunda when refreshing the page or when loging and out of the application
NoSuchMethodError in Camunda when refreshing the page or when loging and out of the application

Time:11-21

I use Camunda aw Workflow engine in my microservice and build with Gradle. Whne I try to access the Cmaunda portal pages, the followng exception is thrown.

enter image description here

java.lang.NoSuchMethodError: 'java.util.Map javax.ws.rs.core.Application.getProperties()'
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig.mergeApplications(ResourceConfig.java:1149)
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig._setApplication(ResourceConfig.java:1086)
    at org.glassfish.jersey.server.ResourceConfig.setApplication(ResourceConfig.java:1038)
    at org.glassfish.jersey.server.ApplicationConfigurator.init(ApplicationConfigurator.java:72)
    at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:294)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:294)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:788)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:128)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.springframework.cloud.sleuth.instrument.web.tomcat.TraceValve.invoke(TraceValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:833)
2022-11-19 15:47:03,931 Shosseini ERROR o.a.c.c.C.[Tomcat].[localhost].[/]:175 - Servlet.init() for servlet [Engine Api] threw exception
java.lang.NoSuchMethodError: 'java.util.Map javax.ws.rs.core.Application.getProperties()'
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig.mergeApplications(ResourceConfig.java:1149)
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig._setApplication(ResourceConfig.java:1086)
    at org.glassfish.jersey.server.ResourceConfig.setApplication(ResourceConfig.java:1038)
    at org.glassfish.jersey.server.ApplicationConfigurator.init(ApplicationConfigurator.java:72)
    at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:294)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:294)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:788)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:128)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.springframework.cloud.sleuth.instrument.web.tomcat.TraceValve.invoke(TraceValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:833)
2022-11-19 15:47:03,932 Shosseini ERROR o.a.c.c.C.[.[.[/].[Admin Api]:175 - Allocate exception for servlet [Admin Api]
java.lang.NoSuchMethodError: 'java.util.Map javax.ws.rs.core.Application.getProperties()'
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig.mergeApplications(ResourceConfig.java:1149)
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig._setApplication(ResourceConfig.java:1086)
    at org.glassfish.jersey.server.ResourceConfig.setApplication(ResourceConfig.java:1038)
    at org.glassfish.jersey.server.ApplicationConfigurator.init(ApplicationConfigurator.java:72)
    at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:294)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:294)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:788)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:128)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.springframework.cloud.sleuth.instrument.web.tomcat.TraceValve.invoke(TraceValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:833)
2022-11-19 15:47:03,932 Shosseini ERROR o.a.c.c.C.[.[.[/].[Engine Api]:175 - Allocate exception for servlet [Engine Api]
java.lang.NoSuchMethodError: 'java.util.Map javax.ws.rs.core.Application.getProperties()'
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig.mergeApplications(ResourceConfig.java:1149)
    at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig._setApplication(ResourceConfig.java:1086)
    at org.glassfish.jersey.server.ResourceConfig.setApplication(ResourceConfig.java:1038)
    at org.glassfish.jersey.server.ApplicationConfigurator.init(ApplicationConfigurator.java:72)
    at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:294)
    at java.base/java.util.Arrays$ArrayList.forEach(Arrays.java:4204)
    at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:294)
    at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:261)
    at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:311)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:154)
    at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:347)
    at javax.servlet.GenericServlet.init(GenericServlet.java:158)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1164)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1117)
    at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:788)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:128)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
    at org.springframework.cloud.sleuth.instrument.web.tomcat.TraceValve.invoke(TraceValve.java:74)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
    at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
    at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
    at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
    at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
    at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.base/java.lang.Thread.run(Thread.java:833)
2022-11-19 15:51:28,593 Shosseini INFO  c.n.d.s.r.aws.ConfigClusterResolver:43 - Resolving eureka endpoints via configuration

enter image description here

enter image description here

CodePudding user response:

NoSuchMethodErrors typically indicated version conflicts in the libraries used. If you search for the error, you find this explanation, which looks like it applies: java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;

CodePudding user response:

thank you, I solved this problem by adding this dependency:

implementation 'javax.ws.rs:javax.ws.rs-api:2.0.1'

or add this code to gradle:

configurations.all { resolutionStrategy.dependencySubstitution { substitute module('javax.ws.rs:jsr311-api') with module('javax.ws.rs:javax.ws.rs-api:2.0.1') } }

  • Related