Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-9560

Standalone Webapp 7.9 on Tomcat jackson error when packaged in a docker container (7.10 is OK)

    Details

    • Type: Bug Report
    • Status: Open
    • Priority: L3 - Default
    • Resolution: Unresolved
    • Affects Version/s: 7.9.0
    • Fix Version/s: None
    • Component/s: webapp
    • Labels:
      None
    • Title Keywords:
      Standalone Webapp 7.9 docker

      Description

      Hi,
      I'm packaging the standalone webapp in a docker container and I believe I found a problem related to jackson (probably a dependency pb when creating the war). It is strange because it works on my dev. machine (macOS) but fails when deployed in a docker container based on openjdk:8u181-jre-alpine3.8.
      Here is what I did (takes less than 10 mins to do it all & reproduce the pb).
      Please note that it works fine with camunda standalone webapp 7.10

      I'm developing on a mac & using Tomcat 9.0.5.

      • Java version on my mac

      fbs-MacBook-Pro:7.9 fb$ java -version
      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

      • Java version in container (see provided Dockerfile below)
      • On 7.9
      1. Download war webapp: https://camunda.org/release/camunda-bpm/tomcat/7.9/
      2. Download tomcat 9.0.5 & untar it
      3. Add mgt user in TOMCAT_DIR/conf/tomcat-users.xml (see below)
      4. Start Tomcat
      5. Deploy camunda-webapp-tomcat-standalone-7.9.0.war previously downloaded
      6. Everything Works fine !
      7. Update TOMCAT_DIR/webapps/manager/META-INF/context.xml to comment Valve statement for accessing the manager when tomcat runs in the container (see below)
      8. Create docker with simple Dockerfile (see below) and using docker build -t cockpit710 .
      9. Run docker with: docker run --name mycockpit710 -p 8080:8080 -d cockpit710:latest
      10. Tomcat works fine, can access to the manager webapp and see that camunda standalone app is not running due to a jackson exception: "exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.empty()" (See below error log file from the container)
      • On 7.10
        Following the exact same steps actually works fine !

      Here is the Dockerfile
      FROM openjdk:8u181-jre-alpine3.8
      ENV CATALINA_HOME /usr/local/camunda/apache-tomcat-9.0.5
      ENV PATH $CATALINA_HOME/bin:$PATH
      ENV CAMUNDA_HOME /usr/local/camunda
      RUN mkdir -p "$CATALINA_HOME"
      WORKDIR $CAMUNDA_HOME
      EXPOSE 8080
      COPY apache-tomcat-9.0.5 apache-tomcat-9.0.5
      CMD ["catalina.sh", "run"]

      Here are the lines to add a mgt user for tomcat (see above step 3)
      <role rolename="tomcat"/>
      <role rolename="manager-gui"/>
      <user username="tomcat" password="f0llet" roles="tomcat,manager-gui"/>

      Here is the line commented in manager/context.xml (see above step 7)
      <Context antiResourceLocking="false" privileged="true" >
      <!--
      <Valve className="org.apache.catalina.valves.RemoteAddrValve"
      allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
      -->

      <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
      </Context>

      Here is the error
      /usr/local/camunda/apache-tomcat-9.0.5/logs # cat localhost.2018-11-27.log

      27-Nov-2018 23:32:27.484 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
      27-Nov-2018 23:32:27.484 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
      27-Nov-2018 23:32:27.485 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@3bf7ca37')
      27-Nov-2018 23:34:59.014 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
      27-Nov-2018 23:34:59.014 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
      27-Nov-2018 23:35:01.858 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
      27-Nov-2018 23:35:01.858 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
      27-Nov-2018 23:35:01.859 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@302552ec')
      27-Nov-2018 23:36:54.016 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
      27-Nov-2018 23:36:54.080 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
      27-Nov-2018 23:37:36.903 INFO [main] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
      27-Nov-2018 23:37:36.924 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
      27-Nov-2018 23:37:36.925 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
      27-Nov-2018 23:38:27.245 INFO [main] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
      27-Nov-2018 23:38:27.279 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
      27-Nov-2018 23:38:31.838 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
      27-Nov-2018 23:38:31.838 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
      27-Nov-2018 23:38:31.839 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@60fc87e8')
      27-Nov-2018 23:40:27.304 INFO [main] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
      27-Nov-2018 23:40:27.322 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextDestroyed()
      27-Nov-2018 23:40:27.322 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextDestroyed()
      27-Nov-2018 18:43:59.022 INFO [main] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
      27-Nov-2018 18:43:59.071 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
      27-Nov-2018 18:44:00.203 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.empty()Lcom/fasterxml/jackson/annotation/JsonFormat$Value;
      at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:149)
      at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1442)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:248)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:353)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1015)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4637)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5099)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:740)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:716)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:703)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1847)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:761)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:431)
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1575)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:308)
      at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
      at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:424)
      at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:367)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:964)
      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1425)
      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1415)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
      at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:941)
      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:258)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
      Caused by: java.lang.NoSuchMethodError: com.fasterxml.jackson.annotation.JsonFormat$Value.empty()Lcom/fasterxml/jackson/annotation/JsonFormat$Value;
      at com.fasterxml.jackson.databind.cfg.MapperConfig.<clinit>(MapperConfig.java:50)
      at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:565)
      at com.fasterxml.jackson.databind.ObjectMapper.<init>(ObjectMapper.java:480)
      at org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat.<init>(JacksonJsonDataFormat.java:71)
      at org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatProvider.createInstance(JacksonJsonDataFormatProvider.java:37)
      at org.camunda.spin.DataFormats.registerProvider(DataFormats.java:152)
      at org.camunda.spin.DataFormats.registerCustomDataFormats(DataFormats.java:140)
      at org.camunda.spin.DataFormats.registerDataFormats(DataFormats.java:124)
      at org.camunda.spin.DataFormats.loadDataFormats(DataFormats.java:181)
      at org.camunda.spin.plugin.impl.SpinProcessEnginePlugin.preInit(SpinProcessEnginePlugin.java:39)
      at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.invokePreInit(ProcessEngineConfigurationImpl.java:943)
      at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:770)
      at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:761)
      at org.camunda.bpm.engine.spring.SpringTransactionsProcessEngineConfiguration.buildProcessEngine(SpringTransactionsProcessEngineConfiguration.java:60)
      at org.camunda.bpm.engine.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:52)
      at org.camunda.bpm.engine.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:31)
      at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:142)
      ... 60 more

      27-Nov-2018 18:44:00.262 INFO [main] org.apache.catalina.core.ApplicationContext.log Closing Spring root WebApplicationContext
      27-Nov-2018 18:44:00.476 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
      27-Nov-2018 18:44:00.476 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
      27-Nov-2018 18:44:00.478 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@533053b4')

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            fckbo bo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development