Loader constraint violation error

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2010 01:13 AM
Hi,
I managed to port all examples from JUnit3 to JUnit4 style. But there are still 4 tests failed with error in Grails environment for the following two Test classes:
org.activiti.examples.bpmn.scripttask.ScriptTaskTest
org.activiti.examples.taskforms.TaskFormsTest
Attached here source codes of activiti examples in JUnit4 style.
[attachment=0]activiti-examples-junit4.zip[/attachment]
Any idea how to fix the error? Please advice.
Regards,
Chee Kin
I managed to port all examples from JUnit3 to JUnit4 style. But there are still 4 tests failed with error in Grails environment for the following two Test classes:
org.activiti.examples.bpmn.scripttask.ScriptTaskTest
loader constraint violation: when resolving overridden method "org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getFactory()Ljavax/script/ScriptEngineFactory;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/codehaus/groovy/jsr223/GroovyScriptEngineImpl, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/script/ScriptEngineFactory used in the signaturejava.lang.LinkageError: loader constraint violation: when resolving overridden method "org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getFactory()Ljavax/script/ScriptEngineFactory;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/codehaus/groovy/jsr223/GroovyScriptEngineImpl, and its superclass loader (instance of ), have different Class objects for the type javax/script/ScriptEngineFactory used in the signatureat org.codehaus.groovy.jsr223.GroovyScriptEngineFactory.getScriptEngine(GroovyScriptEngineFactory.java:104)at javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:133)at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:60)at org.activiti.engine.impl.bpmn.ScriptTaskActivity.execute(ScriptTaskActivity.java:45)at org.activiti.pvm.impl.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)at org.activiti.pvm.impl.runtime.ExecutionImpl.performOperation(ExecutionImpl.java:523)at org.activiti.pvm.impl.runtime.ExecutionImpl.start(ExecutionImpl.java:362)at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:64)at org.activiti.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:29)at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:36)at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:46)at org.activiti.examples.bpmn.scripttask.ScriptTaskTest.testScriptExecution(ScriptTaskTest.java:38)
org.activiti.examples.taskforms.TaskFormsTest
loader constraint violation: when resolving overridden method "org.activiti.engine.impl.scripting.JuelScriptEngine.getFactory()Ljavax/script/ScriptEngineFactory;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/activiti/engine/impl/scripting/JuelScriptEngine, and its superclass loader (instance of <bootloader>), have different Class objects for the type javax/script/ScriptEngineFactory used in the signaturejava.lang.LinkageError: loader constraint violation: when resolving overridden method "org.activiti.engine.impl.scripting.JuelScriptEngine.getFactory()Ljavax/script/ScriptEngineFactory;" the class loader (instance of org/codehaus/groovy/grails/cli/support/GrailsRootLoader) of the current class, org/activiti/engine/impl/scripting/JuelScriptEngine, and its superclass loader (instance of ), have different Class objects for the type javax/script/ScriptEngineFactory used in the signatureat org.activiti.engine.impl.scripting.JuelScriptEngineFactory.getScriptEngine(JuelScriptEngineFactory.java:129)at javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:133)at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:60)at org.activiti.engine.impl.cmd.GetRenderedFormCmd.execute(GetRenderedFormCmd.java:92)at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:22)at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:36)at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)at org.activiti.engine.impl.TaskServiceImpl.getRenderedStartFormByKey(TaskServiceImpl.java:115)at org.activiti.examples.taskforms.TaskFormsTest.testTaskFormsWithVacationRequestProcess(TaskFormsTest.java:59)
Attached here source codes of activiti examples in JUnit4 style.
[attachment=0]activiti-examples-junit4.zip[/attachment]
Any idea how to fix the error? Please advice.
Regards,
Chee Kin
Labels:
- Labels:
-
Archive
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 04:44 AM
Hi,
Can you try to run the tests without the livetribe-jsr223-2.0.6.jar on the classpath? This jar contains the javax.script classes, which are missing when running on Java 5 environment. I'm guessing that these classes are colliding with the ones on your JDK.
regards,
Frederik Heremans
Can you try to run the tests without the livetribe-jsr223-2.0.6.jar on the classpath? This jar contains the javax.script classes, which are missing when running on Java 5 environment. I'm guessing that these classes are colliding with the ones on your JDK.
regards,
Frederik Heremans

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 06:34 AM
Hi Frederik Heremans,
Yes, it works! All tests PASSED now. Is that means the library is needed in JDK5 environment only, but not JDK6 and onward?
Thank you very much!
Regards,
Chee Kin
Yes, it works! All tests PASSED now. Is that means the library is needed in JDK5 environment only, but not JDK6 and onward?
Thank you very much!
Regards,
Chee Kin
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 08:11 AM
@Chee: thats indeed the case. The livetribe jar is an implementation of the javax.script classes which are part of JDK6, but not of JDK5.
Congrats with the green tests 🙂
Congrats with the green tests 🙂
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 08:37 AM
Chee,
Apparently some classloaders are more forgiving than others when it comes to duplicate class entries
Apparently some classloaders are more forgiving than others when it comes to duplicate class entries


Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2010 10:12 AM
Hi,
Yeah! Thanks for confirmation.
Regards,
Chee Kin
Yeah! Thanks for confirmation.
Regards,
Chee Kin
