Camunda Cockpit and rest engine on tomee

503 views
Skip to first unread message

kanschik...@googlemail.com

unread,
Jan 10, 2014, 11:19:10 AM1/10/14
to camunda-...@googlegroups.com
Hi all,

We try to use camunda cockpit and rest engine on tomee and can't get it up and running.

Versions:
tomee-jaxrs: 1.6.0
camunda: 7.0.0

When I call the rest engine first, it works, but a subsequent call of the camunda webapp fails with:
Jan 10, 2014 5:11:20 PM org.camunda.bpm.engine.rest.exception.ExceptionHandler toResponse
Warnung: javax.ws.rs.WebApplicationException
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:162)
at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:91)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:237)
at org.apache.openejb.server.cxf.rs.CxfRsHttpListener.onMessage(CxfRsHttpListener.java:170)
at org.apache.openejb.server.rest.RsServlet.service(RsServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
...

If I call the cockpit first, it works (including the embedded est engine on path /camunda/api/engine), but a subsequent call of the rest api causes an exception:
java.lang.ClassCastException: org.jboss.resteasy.core.ThreadLocalResteasyProviderFactory cannot be cast to org.jboss.resteasy.spi.ResteasyProviderFactory
org.jboss.resteasy.spi.ResteasyProviderFactory.getInstance(ResteasyProviderFactory.java:353)
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:222)
org.jboss.resteasy.plugins.server.servlet.FilterDispatcher.doFilter(FilterDispatcher.java:59)
org.camunda.bpm.engine.rest.filter.CacheControlFilter.doFilter(CacheControlFilter.java:47)

Does anybody have experience with tomee and camunda?

Any ideas how this could be resolved?

Many thanks and regards,

Jens.


Christian Lipphardt

unread,
Jan 12, 2014, 6:44:12 AM1/12/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com
Hi Jens,

how do you setup camunda bpm on TomEE?
To get engine-rest running, I had to remove all libs in WEB-INF except the Jackson ones

jackson-core-asl-1.9.11.jar
jackson-jaxrs-1.9.11.jar
jackson-mapper-asl-1.9.11.jar

Further, I removed the filter defined for RestEasy in web.xml

  <filter>
      <filter-name>Resteasy</filter-name>
      <filter-class>
          org.jboss.resteasy.plugins.server.servlet.FilterDispatcher
      </filter-class>
      <init-param>
          <param-name>javax.ws.rs.Application</param-name>
          <param-value>org.camunda.bpm.engine.rest.impl.application.DefaultApplication</param-value>
      </init-param>
  </filter>

  <filter-mapping>
      <filter-name>Resteasy</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>

Then it worked like expected.


Regarding camunda-webapp, i saw when starting up TomEE, the application is initialized by CXF instead of RestEasy, so there may be another culprit.
I'll investigate it this week.

Cheers
Christian

Christian Lipphardt

unread,
Jan 12, 2014, 6:49:52 AM1/12/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com
I had a quick look, looks like when I'm following the engine-rest approach I described above, CXF is only initializing one of three jax-rs applications included in camunda-webapp.

kanschik...@googlemail.com

unread,
Jan 13, 2014, 4:49:53 AM1/13/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com
Hi Christian,

I tried the following:

First try: I followed the vanilla tomcat guide (which by the way worked perfectly on a vanilla tomcat). Rest engine works without the cockpit, but when both are deployed and used, I get the error messages of my original post.

Second try: As you mentioned, I removed the three jackson jars and changed the web.xml.
Result: There is (at least in 7.0.0-final) a hard dependency on jackson (see https://github.com/camunda/camunda-bpm-platform/blob/7.0.0-Final/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/application/DefaultApplication.java#L37-L39).

Therefore I got the following exception:
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jackson/jaxrs/JacksonJsonProvider
at org.camunda.bpm.engine.rest.impl.application.DefaultApplication.getClasses(DefaultApplication.java:74)
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2021)
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1824)
at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:355)
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:396)
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:938)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1171)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1051)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:127)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5322)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 10 more
Caused by: java.lang.ClassNotFoundException: org.codehaus.jackson.jaxrs.JacksonJsonProvider
at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:141)
at org.apache.openejb.core.TempClassLoader.loadClass(TempClassLoader.java:74)


But since starting only the engine without webapp works, I also assume that the problem is somehow linked to the webapp / cxf / jax-rs.

Regards,

Jens.

Christian Lipphardt

unread,
Jan 13, 2014, 10:36:40 AM1/13/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com
Hi Jens,

like I wrote you have to keep only the Jackson jars and delete all other (engine-rest).

Cheers
Christian

kanschik...@googlemail.com

unread,
Jan 17, 2014, 5:07:14 AM1/17/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com

Just a quick update: the problem is resolved. According to a colleague, the problem was the webapp was not 100% conforming to JEE standards, but I currently don't know the details. The details will follow ;-)

Christian Lipphardt

unread,
Jan 17, 2014, 11:35:41 AM1/17/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com
Thanks! Would be nice if you can provide us with your solution.

Cheers
Christian

thomasl...@gmail.com

unread,
Jan 19, 2014, 2:44:29 PM1/19/14
to camunda-...@googlegroups.com, kanschik...@googlemail.com

Hi Christian,

as mentioned by my colleague Jens i will provide a solution for this problem.
I've opened an issue in Jira for this. (https://app.camunda.com/jira/browse/CAM-1734)
I will provide the solution via github branch at the end of next week.

Regards,
Thomas

Reply all
Reply to author
Forward
0 new messages