Javascript Engine Not Found, while running camunda as a microservice

Hi everyone,
When i am trying to run my workflow, there are couple of script tasks present in it.
I am running camunda as a microservice, and I have used all necessary dependencies,
When i execute my workflow, the following error is thrown:
StartEvent_16128yl (activity-start, ProcessInstance[99409])
StartEvent_16128yl, name=

2020-10-10 00:16:40.132 ERROR 7788 --- [ kafka-consumer] org.camunda.bpm.engine.context           : ENGINE-16004 Exception while closing command context: Can't find scripting engine for 'javascript': scriptEngine is null

org.camunda.bpm.engine.exception.NullValueException: Can't find scripting engine for 'javascript': scriptEngine is null
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_151]
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_151]
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_151]
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_151]

Here are my dependencies:

dependencies {
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'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-csv'
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'

}

Can you upload your bpmn file?

Hi @pradeep.poojari

childKafka.bpmn (2.7 KB)

In my message start task, inside listeners i have script code.

Hi, I took your bpmn and exected the process. There is nothing wrong in it.

I don’t see any spin dependencies in the list you mentioned. Please add spin dependency it should solve your problem.

Pls find maven spin dependency below ,

<dependency>
		<groupId>org.camunda.bpm</groupId>
		<artifactId>camunda-engine-plugin-spin</artifactId>
	</dependency>

	<dependency>
		<groupId>org.camunda.spin</groupId>
		<artifactId>camunda-spin-dataformat-all</artifactId>
	</dependency>

Hi @pradeep.poojari,

I have added the two spin dependencies you mentioned, but still the problem exists, I am using microservice architecture here.

I also added groovy dependeny, which also didnt help

What version of Java are you using?

Hey @Niall,
java version “1.8.0_151”
Java™ SE Runtime Environment (build 1.8.0_151-b12)
Java HotSpot™ 64-Bit Server VM (build 25.151-b12, mixed mode)

Hey Everyone,
I was able to resolve this, by changing my Project SDK in Intellij to 1.8, thanks @Niall and @pradeep.poojari, for your efforts.

1 Like