limcheekin / activiti

Grails Activiti Plugin - Enabled Activiti BPM Suite support for Grails

Home Page:http://code.google.com/p/grails-activiti-plugin/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

activiti plugin is not work with grails2.3

zhaosd opened this issue · comments

When add activiti plugin in grails2.3 app and execute grails run-app, it will cause follow error:

Configuring Activiti Process Engine ...
... finished configuring Activiti Process Engine.
Error initializing the application: null
java.lang.NullPointerException
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:662)
| Error Forked Grails VM exited with error

Please help me to solve this issue, thank you very much!

I cann't to capture any log with follow config in Config.groovy

debug 'org.grails.activiti'

has anyone can help me?

Thanks for trying the plugin.

I hope I find time over the weekend to try it out and make it run on Grails 2.3

Thank you very much for reply me and help me to resolve this problem!

Hi,
I have the same situation. "Run-app" with plugin version 5.12.1, Grails 2.3.0 and Hibernate4 or Hibernate3 results in:

| Server running. Browse to http://localhost:8080/grailsActiviti
Configuring Activiti Process Engine ...
... finished configuring Activiti Process Engine.
Error initializing the application: null
java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
| Error Forked Grails VM exited with error

The error message does not give much valuable information, so I don't know where to start with debugging.

Yours Johannes

Thanks for provide addition information. I did aware about this issue but couldn't find time to look into it at this busy moment.

I spent the weekend trying to make the plugin work with Grails 2.3.0, but I am out of luck. Please see the details at http://forums.activiti.org/content/running-activiti-engine-springframework-324

commented

You might want to post your problem on the grails mailing list. I am not sure that the activity-forum users know enough about grails' internals.

Edit: I just posted the question with a link to this page.

Grails 2.3 has serviceBeanAliasPostProcessor, it will auto create alias for all Service artifacts, but all activiti service, such as runtimeService and repositoryService, is not real grails service artifacts. So define these name is end with 'Service' will cause error. So we can change runtimeService to runtimeServ or other name, then activiti can work normal in grails 2.3.

I open a defect for grails, link: http://jira.grails.org/browse/GRAILS-10690

Thanks for sharing your finding, workaround and created a Grails JIRA issue.

You are welcome! I am very glad to do this.

Hello zhaosd..I'm wondering can you elaborate on your workaround. I've struggling with this the last day or two.
I'm not sure where I should change the name from runtimeService to runtimeServ. Is it in the ActivitiService class itself or what other locations do I need to modify it in?

If you use grails-activiti plugin source code directly, you can change the file 'ActivitiGrailsPlugin.groovy' in source code. You can find these services reference is defined in 'doWithSpring' closures. If you use plugin dependency mode to use this plugin. You can open eclipse 'Navigator' view, then '.link_to_grails_plugins/activiti5.12.1. You can find the file 'ActivitiGrailsPlugin.groovy'.
This problem is already fixed in grails 2.3.2, if you are not ugent to use it, you can wait grails 2.3.2 release.

If you use plugin dependency mode to use this plugin. You can open eclipse 'Navigator' view, then find folder '.link_to_grails_plugins/activiti5.12.1'. You can find the file 'ActivitiGrailsPlugin.groovy' in this folder. Change the services reference is defined in 'doWithSpring' closures

Thanks a lot. I'm using the plugin dependency mode. So as an example for the runtimeService

def doWithSpring = {
//ommitted code
runtimeService(processEngine:"getRuntimeService")
activitiService(org.grails.activiti.ActivitiService) {
runtimeService = ref("runtimeService")
}

to

def doWithSpring = {
//ommitted code
runtimeServ(processEngine:"getRuntimeService")
activitiService(org.grails.activiti.ActivitiService) {
runtimeServ = ref("runtimeServ")
}
?
Apologies, my knowledge on this topic is pretty basic.

From:

            runtimeService(processEngine:"getRuntimeService") 
            repositoryService(processEngine:"getRepositoryService")
            taskService(processEngine:"getTaskService") 
            managementService(processEngine:"getManagementService") 
            identityService(processEngine:"getIdentityService")
            historyService(processEngine:"getHistoryService")
            formService(processEngine:"getFormService")

            activitiService(org.grails.activiti.ActivitiService) {
                runtimeService = ref("runtimeService")
                taskService = ref("taskService")
                identityService = ref("identityService")
                formService = ref("formService")
            }

change to :

            runtimeServ(processEngine:"getRuntimeService") 
            repositoryServ(processEngine:"getRepositoryService")
            taskServ(processEngine:"getTaskService") 
            managementServ(processEngine:"getManagementService") 
            identityServ(processEngine:"getIdentityService")
            historyServ(processEngine:"getHistoryService")
            formServ(processEngine:"getFormService")

            activitiService(org.grails.activiti.ActivitiService) {
                runtimeService = ref("runtimeServ")
                taskService = ref("taskServ")
                identityService = ref("identityServ")
                formService = ref("formServ")
            }

I am not recommend you do this, I recommend you to wait grails 2.3.2 release.

I can confirm that the Activiti plugin works with Grails 2.3.2.

Yes, our product dev environment is change to use Grails 2.3.2, it include activiti plugin and work well.
We just wanna the activiti plugin can upgrade to use activiti 5.14(now use activiti 5.12.1)