Camunda REST uses which version of jax-rs?

I was using camunda rest version 7.9.0 as springboot application. It was working fine before i integrate with springcloud module.

I was getting below error:

> i was getitng below err when i acces camunda ui:
> java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map;
> 	at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig.mergeApplications(ResourceConfig.java:1134)
> 	at org.glassfish.jersey.server.ResourceConfig$WrappingResourceConfig._setApplication(ResourceConfig.java:1071)
> 	at org.glassfish.jersey.server.ResourceConfig.setApplication(ResourceConfig.java:1023)
> 	at org.glassfish.jersey.server.ApplicationConfigurator.init(ApplicationConfigurator.java:96)
> 	at org.glassfish.jersey.server.ApplicationHandler.lambda$initialize$0(ApplicationHandler.java:313)

It seems JAX-RS versions where clashing. Just wanted to know what version of JAX-RS used in camunda?

And if camunda 7.9.0 uses JAX-RS uses version of 1.X and if i update to 2.X will cause any problems?

it depends about which camunda application you are talking about. the camunda 7.9 ui uses resteasy-jaxrs-2.3.5 Final (and jaxrs-api.2.3.5Final)

I have solved this issue longback. We are using microservices, so camunda dependencies added along with netflix components. So one of the class wa soverlapped. I found that class using Jhades utility and excluded that dependency from gradle.

Faced exactly the same issue. How I solved it?

  1. Looked into the file ResourceConfig.java and when found getProperties() function was not getting resolved.
  2. When looked into the Application.java it wasn’t there, hence (1) was happening.
  3. Got the maven dependency and found out below culprit jar file
    javax.ws.rs:jsr311-api:jar:1.1.1:compile

It was getting pulled from some other jar.

Final step was to add exclusion from culprit dependency.

                    <exclusions>
                        <exclusion>
                            <groupId>javax.ws.rs</groupId>
                            <artifactId>jsr311-api</artifactId>
                        </exclusion>
                    </exclusions>

Thanks

2 Likes

@rawat, One of the most common source of classpath problems is overlapping jar files, that contain different versions of the same class. So you can identify and remove the overlapping jars from classpath by adding jhades dependency.

<dependency>
    <groupId>org.jhades</groupId>
    <artifactId>jhades</artifactId>
    <version>1.0.4</version>
</dependency>

then from the main class, you can add the below code to find the overlapping classes in jars.

new JHades()
.printClassLoaders()
.printClasspath()
.overlappingJarsReport()
.multipleClassVersionsReport()
.findClassByName("org.jhades.SomeServiceImpl");

This prints to the screen the class loader chain, jars, duplicate classes, etc. Then you can exclude the overlapping dependency from the classpath.

@aravindhrs

Yeah I saw you previous comment and immediately tried that but unfortunately I was facing exception in using it.

java.lang.IllegalArgumentException: Missing scheme

Below is the jar to which conflict was happening

jakarta.ws.rs:jakarta.ws.rs-api:jar:2.1.6:compile

Hey @arvindhrs,

We have made our services microservice, and trying to use camunda web starter, for rest api calls, when i am trying to make any engine-rest api call, I am getting the following error.

2020-10-05 10:52:05.830 ERROR 31812 --- [nio-8084-exec-4] c.b.s.b.s.r.CamundaJerseyResourceConfig] : Servlet.service() for servlet [org.camunda.bpm.spring.boot.starter.rest.CamundaJerseyResourceConfig] in context with path [] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.AbstractMethodError: javax.ws.rs.core.Response$ResponseBuilder.status(ILjava/lang/String;)Ljavax/ws/rs/core/Response$ResponseBuilder;] with root cause

java.lang.AbstractMethodError: javax.ws.rs.core.Response$ResponseBuilder.status(ILjava/lang/String;)Ljavax/ws/rs/core/Response$ResponseBuilder;
	at javax.ws.rs.core.Response$ResponseBuilder.status(Response.java:896) ~[jakarta.ws.rs-api-2.1.6.jar:2.1.6]
	at javax.ws.rs.core.Response.status(Response.java:567) ~[jakarta.ws.rs-api-2.1.6.jar:2.1.6]
	at javax.ws.rs.core.Response.status(Response.java:578) ~[jakarta.ws.rs-api-2.1.6.jar:2.1.6]
	at javax.ws.rs.core.Response.ok(Response.java:613) ~[jakarta.ws.rs-api-2.1.6.jar:2.1.6]
	at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:224) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) ~[jersey-common-2.29.1.jar:na]
	at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) ~[jersey-common-2.29.1.jar:na]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:292) ~[jersey-common-2.29.1.jar:na]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:274) ~[jersey-common-2.29.1.jar:na]
	at org.glassfish.jersey.internal.Errors.process(Errors.java:244) ~[jersey-common-2.29.1.jar:na]
	at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) ~[jersey-common-2.29.1.jar:na]
	at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680) ~[jersey-server-2.29.1.jar:na]
	at org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:392) ~[jersey-container-servlet-core-2.29.1.jar:na]
	at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:346) ~[jersey-container-servlet-core-2.29.1.jar:na]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:365) ~[jersey-container-servlet-core-2.29.1.jar:na]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:318) ~[jersey-container-servlet-core-2.29.1.jar:na]
	at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:205) ~[jersey-container-servlet-core-2.29.1.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilterSecure(SecurityFilter.java:70) ~[camunda-webapp-7.10.0-classes.jar:7.10.0]
	at org.camunda.bpm.webapp.impl.security.filter.SecurityFilter.doFilter(SecurityFilter.java:54) ~[camunda-webapp-7.10.0-classes.jar:7.10.0]
	at org.camunda.bpm.spring.boot.starter.webapp.filter.LazyDelegateFilter.doFilter(LazyDelegateFilter.java:59) ~[camunda-bpm-spring-boot-starter-webapp-core-3.2.0.jar:3.2.0]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:61) ~[camunda-webapp-7.10.0-classes.jar:7.10.0]
	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter$1.execute(AuthenticationFilter.java:59) ~[camunda-webapp-7.10.0-classes.jar:7.10.0]
	at org.camunda.bpm.webapp.impl.security.SecurityActions.runWithAuthentications(SecurityActions.java:43) ~[camunda-webapp-7.10.0-classes.jar:7.10.0]
	at org.camunda.bpm.webapp.impl.security.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:59) ~[camunda-webapp-7.10.0-classes.jar:7.10.0]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_151]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_151]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_151]

Tried using jhades as you suggested but didnt wor, facing same issue.
Note: I have completely removed eureka-client dependency from my gradle.build.

 compile 'com.squareup.okhttp3:okhttp:3.10.0'
compile 'com.squareup.okio:okio:1.14.0'
compile 'org.jhades:jhades:1.0.4'
implementation 'com.google.code.gson:gson:2.8.5'


implementation 'com.fasterxml.jackson.core:jackson-databind'
implementation 'org.apache.commons:commons-lang3'
implementation 'org.springframework:spring-tx:5.2.1.RELEASE'
implementation 'org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter:3.2.0'
implementation 'org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-webapp:3.2.0'
implementation 'org.camunda.bpm.springboot:camunda-bpm-spring-boot-starter-rest:3.2.0'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-data-mongodb'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
implementation 'org.postgresql:postgresql'
implementation 'com.jayway.jsonpath:json-path'
implementation 'org.hibernate:hibernate-entitymanager'
implementation 'org.json:json:20090211'
implementation 'io.springfox:springfox-swagger2:2.9.2'
implementation 'io.springfox:springfox-swagger-ui:2.9.2'
implementation 'org.keycloak:keycloak-admin-client:6.0.0'
implementation 'org.keycloak:keycloak-authz-client:7.0.0'
compile 'org.jboss.resteasy:resteasy-undertow:3.0.14.Final'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv'
implementation 'org.jboss.resteasy:resteasy-jackson-provider:3.0.10.Final'
//    implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
implementation 'org.codehaus.groovy:groovy-all:3.0.5'
implementation 'org.camunda.bpm.extension.springboot:camunda-bpm-spring-boot-starter:2.1.2'

implementation project(':core.mt')
implementation project(':core')
implementation project(':core.cf')
implementation project(':core.tb')

implementation 'org.camunda.bpm:camunda-engine'
implementation 'org.camunda.bpm.model:camunda-bpmn-model'

testImplementation 'junit:junit:4.12'
testImplementation 'org.keycloak:keycloak-authz-client:7.0.0'
testImplementation 'javax.servlet:javax.servlet-api'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.4'
testImplementation 'org.powermock:powermock-api-easymock:2.0.4'
testImplementation 'org.powermock:powermock-module-junit4:2.0.4'

testImplementation 'com.h2database:h2'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testCompileOnly 'org.camunda.bpm:camunda-engine'