Lambda & foEach on dockerized camunda tomcat

We are using Camunda docker :
camunda/camunda-bpm-platform:tomcat-7.7.0
as base and adding our webapp into it.

But as soon as I’m using features like lambdas or streams or forEach ( List) then Camunda does not start giving errors like ArrayIndexOutofBounds. It is in History event listener

to my understanding this images should use java8, so I wonder wether I’m doing something wrong or is there some limitation I do not understand.

Hi Kalev,

the image uses JDK8. Can you check if this problem also occurs in a non dockerized Camunda installation. And can you share the stacktrace?

Cheers,
Sebastian

Hi Sebastian,

I havn’t run full Camunda locally but unit test are running fine. Everything works. Presumable locally ok (?) then.

My latest failed example is:

if (ReadyForFDTaskName.equals(historicTaskInstanceEventEntity.getAssignee())) {
                       Executors.newSingleThreadExecutor().execute(  () -> {

                       //  do my  important stuff here 
 });

but as soon as I replace lambda, it starts working again

if (ReadyForFDTaskName.equals(historicTaskInstanceEventEntity.getAssignee())) {
                       Executors.newSingleThreadExecutor().execute(  new Runnable {
                           public void run (){

                       //  do my  important stuff here 
                            }
 });

Same behaviour if I’m using streams or forEach.

Full stacktrace on error out:

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=256m; support was removed in 8.0
12-Jul-2017 09:33:56.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.24
12-Jul-2017 09:33:56.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jul 1 2015 20:19:55 UTC
12-Jul-2017 09:33:56.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.24.0
12-Jul-2017 09:33:56.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
12-Jul-2017 09:33:56.583 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            3.16.0-4-amd64
12-Jul-2017 09:33:56.590 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
12-Jul-2017 09:33:56.591 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-8-oracle/jre
12-Jul-2017 09:33:56.595 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_131-b11
12-Jul-2017 09:33:56.597 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
12-Jul-2017 09:33:56.597 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /camunda
12-Jul-2017 09:33:56.598 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /camunda
12-Jul-2017 09:33:56.600 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/camunda/conf/logging.properties
12-Jul-2017 09:33:56.601 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
12-Jul-2017 09:33:56.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx512m
12-Jul-2017 09:33:56.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxPermSize=256m
12-Jul-2017 09:33:56.604 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:PermSize=256m
12-Jul-2017 09:33:56.605 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/camunda/endorsed
12-Jul-2017 09:33:56.607 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/camunda
12-Jul-2017 09:33:56.607 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/camunda
12-Jul-2017 09:33:56.607 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/camunda/temp
12-Jul-2017 09:33:56.611 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
12-Jul-2017 09:33:57.104 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
12-Jul-2017 09:33:57.158 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Jul-2017 09:33:57.164 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
12-Jul-2017 09:33:57.167 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
12-Jul-2017 09:33:57.167 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1766 ms
12-Jul-2017 09:33:57.198 WARNING [main] org.apache.tomcat.jdbc.pool.ConnectionPool.init maxIdle is larger than maxActive, setting maxIdle to: 20
12-Jul-2017 09:33:57.523 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-08046 Found camunda bpm platform configuration in CATALINA_BASE/CATALINA_HOME conf directory [/camunda/conf/bpm-platform.xml] at 'file:/camunda/conf/bpm-platform.xml'
12-Jul-2017 09:33:57.812 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-12003 Plugin 'ProcessApplicationEventListenerPlugin' activated on process engine 'default'
12-Jul-2017 09:33:57.824 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-12003 Plugin 'SpinProcessEnginePlugin' activated on process engine 'default'
12-Jul-2017 09:33:57.832 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormatProvider[name = application/json]
12-Jul-2017 09:33:58.048 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo SPIN-01010 Discovered Spin data format provider: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormatProvider[name = application/xml]
12-Jul-2017 09:33:58.065 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.xml.dom.format.DomXmlDataFormat[name = application/xml]
12-Jul-2017 09:33:58.066 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo SPIN-01009 Discovered Spin data format: org.camunda.spin.impl.json.jackson.format.JacksonJsonDataFormat[name = application/json]
12-Jul-2017 09:33:58.066 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-12003 Plugin 'ConnectProcessEnginePlugin' activated on process engine 'default'
12-Jul-2017 09:33:58.551 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo CNCT-01004 Discovered provider for connector id 'http-connector' and class 'org.camunda.connect.httpclient.impl.HttpConnectorImpl': 'org.camunda.connect.httpclient.impl.HttpConnectorProviderImpl'
12-Jul-2017 09:33:58.557 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo CNCT-01004 Discovered provider for connector id 'soap-http-connector' and class 'org.camunda.connect.httpclient.soap.impl.SoapHttpConnectorImpl': 'org.camunda.connect.httpclient.soap.impl.SoapHttpConnectorProviderImpl'
12-Jul-2017 09:34:03.329 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-00001 Process Engine default created.
12-Jul-2017 09:34:03.337 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-14014 Starting up the JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor].
12-Jul-2017 09:34:03.341 INFO [Thread-6] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-14018 JobExecutor[org.camunda.bpm.engine.impl.jobexecutor.RuntimeContainerJobExecutor] starting to acquire jobs
12-Jul-2017 09:34:03.359 INFO [main] org.camunda.commons.logging.BaseLogger.logInfo ENGINE-08048 Camunda BPM platform sucessfully started at 'Apache Tomcat/8.0.24'.
12-Jul-2017 09:34:03.411 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
12-Jul-2017 09:34:03.411 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.24
12-Jul-2017 09:34:03.517 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive /camunda/webapps/bpmn-rest.war
12-Jul-2017 09:34:13.687 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
12-Jul-2017 09:34:13.738 INFO [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Root WebApplicationContext: initialization started
12-Jul-2017 09:34:13.850 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.prepareRefresh Refreshing Root WebApplicationContext: startup date [Wed Jul 12 09:34:13 UTC 2017]; root of context hierarchy
12-Jul-2017 09:34:13.923 INFO [localhost-startStop-1] org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions Loading XML bean definitions from ServletContext resource [/WEB-INF/applicationContext.xml]
12-Jul-2017 09:34:14.214 SEVERE [localhost-startStop-1] org.springframework.web.context.ContextLoader.initWebApplicationContext Context initialization failed
 java.lang.ArrayIndexOutOfBoundsException: 7786
	at org.springframework.asm.ClassReader.readClass(Unknown Source)
	at org.springframework.asm.ClassReader.accept(Unknown Source)
	at org.springframework.asm.ClassReader.accept(Unknown Source)
	at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:59)
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
	at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
	at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
	at org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:70)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:233)
	at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:203)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:622)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
	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:4729)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5167)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

12-Jul-2017 09:34:14.217 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
12-Jul-2017 09:34:14.223 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/bpmn-rest] startup failed due to previous errors
12-Jul-2017 09:34:14.231 INFO [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.doClose Closing Root WebApplicationContext: startup date [Wed Jul 12 09:34:13 UTC 2017]; root of context hierarchy
12-Jul-2017 09:34:14.232 WARNING [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.doClose Exception thrown from ApplicationListener handling ContextClosedEvent
 java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: Root WebApplicationContext: startup date [Wed Jul 12 09:34:13 UTC 2017]; root of context hierarchy
	at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:337)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:324)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1030)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993)
	at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

12-Jul-2017 09:34:14.233 WARNING [localhost-startStop-1] org.springframework.web.context.support.XmlWebApplicationContext.doClose Exception thrown from LifecycleProcessor on context close
 java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Wed Jul 12 09:34:13 UTC 2017]; root of context hierarchy
	at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:350)
	at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1038)
	at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:993)
	at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:548)
	at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:142)
	at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4776)
	at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5390)
	at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945)
	at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1768)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)

12-Jul-2017 09:34:14.234 INFO [localhost-startStop-1] org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@25bdb3c3: defining beans [processEngineService,processEngine,repositoryService,runtimeService,taskService,historyService,managementService,processApplication,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.unctad.eregistrations.camunda.SpringApplicationContext#0,userTaskHistoryEventHandler,processEventHandler,elasticHEH,compositeHistoryEventHandler,processEngineConfiguration,org.springframework.context.annotation.ConfigurationClassPostProcessor$ImportAwareBeanPostProcessor#0]; root of factory hierarchy
12-Jul-2017 09:34:14.258 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive /camunda/webapps/bpmn-rest.war has finished in 10,739 ms
12-Jul-2017 09:34:14.260 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/camunda
12-Jul-2017 09:34:17.008 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/camunda has finished in 2,748 ms
12-Jul-2017 09:34:17.009 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/docs
12-Jul-2017 09:34:18.699 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/docs has finished in 1,690 ms
12-Jul-2017 09:34:18.700 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/camunda-welcome
12-Jul-2017 09:34:20.668 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/camunda-welcome has finished in 1,967 ms
12-Jul-2017 09:34:20.670 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/host-manager
12-Jul-2017 09:34:22.255 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/host-manager has finished in 1,586 ms
12-Jul-2017 09:34:22.256 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/manager
12-Jul-2017 09:34:23.854 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/manager has finished in 1,598 ms
12-Jul-2017 09:34:23.855 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/ROOT
12-Jul-2017 09:34:25.386 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/ROOT has finished in 1,531 ms
12-Jul-2017 09:34:25.387 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /camunda/webapps/engine-rest
12-Jul-2017 09:34:27.532 INFO [localhost-startStop-1] org.jboss.resteasy.logging.impl.Slf4jLogger.info Deploying javax.ws.rs.core.Application: class org.camunda.bpm.engine.rest.impl.application.DefaultApplication
12-Jul-2017 09:34:27.696 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /camunda/webapps/engine-rest has finished in 2,308 ms
12-Jul-2017 09:34:27.708 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
12-Jul-2017 09:34:27.716 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
12-Jul-2017 09:34:27.719 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 30551 ms

Hi @Kalev,

I guess this sounds more like a bug in an underlying library used by spring.
For reference, I found this stack overflow question, which describes almost the same problem.
Do you deploy a process application which uses spring and asm?

Cheers,
Christian