cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti and Grails

sweeneymj
Champ in-the-making
Champ in-the-making
Hi,

I am currently working on a project integrating grails and activiti. I am using the following versions:

grails 2.0.3
activiti 5.8.3

during startup the application terminates with the stacktrace below. I have tried everything I can think of - clearing my .grails folder, the ivy cache, building from a fresh checkout of code but I nothing works. Any assistance or pointers would be appreciated.

2012-10-03 07:09:47,318 ERROR pool-6-thread-1 [grails.web.context.GrailsContextLoader] Error executing bootstraps: Error creating bean with name 'org.grails.activiti.springsecurity.SetAuthenticatedUserIdFilters': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: org.codehaus.groovy.jsr223.GroovyScriptEngineFactory cannot be cast to javax.script.ScriptEngineFactory
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.grails.activiti.springsecurity.SetAuthenticatedUserIdFilters': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: org.codehaus.groovy.jsr223.GroovyScriptEngineFactory cannot be cast to javax.script.ScriptEngineFactory
   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
   at java.lang.Thread.run(Thread.java:680)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine': FactoryBean threw exception on object creation; nested exception is java.lang.ClassCastException: org.codehaus.groovy.jsr223.GroovyScriptEngineFactory cannot be cast to javax.script.ScriptEngineFactory
   … 5 more
Caused by: java.lang.ClassCastException: org.codehaus.groovy.jsr223.GroovyScriptEngineFactory cannot be cast to javax.script.ScriptEngineFactory
   at javax.script.ScriptEngineManager.initEngines(ScriptEngineManager.java:109)
   at javax.script.ScriptEngineManager.access$000(ScriptEngineManager.java:37)
   at javax.script.ScriptEngineManager$1.run(ScriptEngineManager.java:80)
   at javax.script.ScriptEngineManager.init(ScriptEngineManager.java:78)
   at javax.script.ScriptEngineManager.<init>(ScriptEngineManager.java:51)
   at org.activiti.engine.impl.scripting.ScriptingEngines.<init>(ScriptingEngines.java:41)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.initScriptingEngines(ProcessEngineConfigurationImpl.java:784)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.init(ProcessEngineConfigurationImpl.java:283)
   at org.activiti.engine.impl.cfg.ProcessEngineConfigurationImpl.buildProcessEngine(ProcessEngineConfigurationImpl.java:270)
   at org.activiti.spring.SpringProcessEngineConfiguration.buildProcessEngine(SpringProcessEngineConfiguration.java:60)
   at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:56)
   at org.activiti.spring.ProcessEngineFactoryBean.getObject(ProcessEngineFactoryBean.java:32)
   … 5 more
9 REPLIES 9

frederikherema1
Star Contributor
Star Contributor
Looks like the JSR223-provider in your class path is jot what activiti expects. Are you running Java 6?

sweeneymj
Champ in-the-making
Champ in-the-making
Hi,

yes I am.

Regards

jbarrez
Star Contributor
Star Contributor
Did you check/use http://grails.org/plugin/activiti ?

sweeneymj
Champ in-the-making
Champ in-the-making
Hi,

yes. Below is the plugin info (I see that I put the wrong version in my original post):

grails plugin-info activiti
| Configuring classpath
Resolving [test] dependencies…
Resolving [runtime] dependencies…
| Environment set to development…..
found org.grails.plugins#activiti;5.9 in cache
[5.9] org.grails.plugins#activiti;latest.integration

————————————————————————–
Information about Grails plugin
————————————————————————–
Name: activiti | Latest release: 5.9
————————————————————————–
Grails Activiti Plugin - Enabled Activiti BPM Suite support for Grails
————————————————————————–
Author: Lim Chee Kin
————————————————————————–
Author's e-mail: limcheekin@vobject.com
————————————————————————–
Find more info here: http://grails.org/plugin/activiti
————————————————————————–


Grails Activiti Plugin is created to integrate Activiti BPM Suite and workflow system to Grails Framework.
With the Grails Activiti Plugin, workflow application can be created at your fingertips!

Project Site and Documentation: http://code.google.com/p/grails-activiti-plugin/
Source Code: https://github.com/limcheekin/activiti
Support: https://github.com/limcheekin/activiti/issues
Discussion Forum: http://groups.google.com/group/grails-activiti-plugin



Dependency Definition
————————————————————————–
    :activiti:5.9


Required Repositories
————————————————————————–
     http://grails.org/plugins
     http://repo.grails.org/grails/core/
     https://maven.alfresco.com/nexus/content/groups/public/
     http://repo1.maven.org/maven2/

Transitive Dependencies
————————————————————————–
     org.subethamail:subethasmtp-wiser:1.2 (test)
     org.subethamail:subethasmtp-smtp:1.2 (test)
     org.activiti:activiti-engine:5.9 (compile)
     org.activiti:activiti-spring:5.9 (runtime)
     javax.mail:mail:1.4.1 (runtime)

Transitive Plugins
————————————————————————–

To get info about specific release of plugin 'grails plugin-info [NAME] [VERSION]'

To get list of all plugins type 'grails list-plugins'

To install latest version of plugin type 'grails install-plugin [NAME]'

To install specific version of plugin type 'grails install-plugin [NAME] [VERSION]'

For further info visit http://grails.org/Plugins

Regards

jbarrez
Star Contributor
Star Contributor
I haven't really got a clue, since I don't know the grails plugin code.
It seems from the stacktrace, another version for the groovy scripting is used … has something changed there recently in Grails?

mehmetyaman
Champ in-the-making
Champ in-the-making
Hi, may be a bit late for this discussion but i want to add a comment on this issue, i'm using grails-activiti plugin with these versions:
grails version: 2.1.1
compile 'org.activiti:activiti-engine:5.10'
compile 'org.activiti:activiti-spring:5.10'
and i get the same error –> java.lang.ClassCastException: org.codehaus.groovy.jsr223.GroovyScriptEngineFactory cannot be cast to javax.script.ScriptEngineFactory
I think there is a conflict between jdk1.7 and groovy, livetribe-jssr223 has the same implementation and it makes the conflict

so i want to ask is there any one who solved this conflict ? may be some exclutions can be solved or version changes

regards
Mehmet

jbarrez
Star Contributor
Star Contributor
Did you try without livetribe? In recent versions of Activiti, the livertribe dependency has been removed.

Also (not from Grails), we now need to use groovy-all instead of groovy.jar.

Hope that helps.

mehmetyaman
Champ in-the-making
Champ in-the-making
when i made your sugessted exclusion, result is above



:: problems summary ::
:::: WARNINGS
  ::::::::::::::::::::::::::::::::::::::::::::::

  ::          UNRESOLVED DEPENDENCIES         ::

  ::::::::::::::::::::::::::::::::::::::::::::::

  :: org.springframework#spring-test;3.1.2.RELEASE: configuration not found in org.springframework#spring-test;3.1.2.RELEASE: 'master'. It was required from org.activiti#activiti-spring;5.10 compile

  ::::::::::::::::::::::::::::::::::::::::::::::


:: problems summary ::
:::: WARNINGS
  ::::::::::::::::::::::::::::::::::::::::::::::

  ::          UNRESOLVED DEPENDENCIES         ::

  ::::::::::::::::::::::::::::::::::::::::::::::

  :: org.springframework#spring-test;3.1.2.RELEASE: configuration not found in org.springframework#spring-test;3.1.2.RELEASE: 'master'. It was required from org.activiti#activiti-spring;5.10 compile

  ::::::::::::::::::::::::::::::::::::::::::::::


| Error Failed to resolve dependencies (Set log level to 'warn' in BuildConfig.groovy for more information):

jbarrez
Star Contributor
Star Contributor
I don't get that 'unresolved' thing, why would it influence spring-test?

What exactly did you change?