Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0RC1
-
Fix Version/s: 2.0.1Release
-
Component/s: None
-
Labels:None
-
Environment:Eclipse 3.5.1 Linux 64 bit groovy plugin rc1
-
Number of attachments :1
Description
when I run a Groovy script in Eclipse I just started to get this error: Caught: java.lang.LinkageError: loader constraint violation: when resolving overridden method
"com.instantiations.css.build.CssEditorBuild.super$2$inContext(Ljava/lang/String;Lgroovy/lang/Closure;)V" the class loader (instance of groovy/lang/GroovyClassLoader$InnerLoader) of the current class, com/instantiations/css/build/CssEditorBuild, and its superclass loader (instance of sun/misc/Launcher$AppClassLoader), have different Class objects for the type groovy/lang/Closure used in the signature
-
Hide
- test.zip
- 04/Jan/10 2:07 PM
- 9 kB
- Mark Russell
-
- test_build/.classpath 0.5 kB
- test_build/.project 0.4 kB
- test_build/.../org.eclipse.jdt.core.prefs 0.6 kB
- test_build/bin/com/.../test/TestMe.class 6 kB
- test_build/.../markr.properties 0.0 kB
- test_build/.../product.properties 0.0 kB
- test_build/src/com/.../test/TestMe.groovy 0.4 kB
- test_common/.classpath 0.5 kB
- test_common/.project 0.4 kB
- test_common/.../org.eclipse.jdt.core.prefs 0.6 kB
- test_common/bin/com/.../util/BuildUtil.class 6 kB
- test_common/src/.../util/BuildUtil.groovy 0.3 kB
Activity
This issue is currently blocking me I can't run any groovy scripts in my eclipse.
I am able to run this as a Java App, but I must also include ant-launcher.jar on the classpath.
As for comment 1, please make sure that a resource in the test_build project is selected before launching. This is another, unrelated bug. The project launch variable used in the script launcher resolves to the project of the currently selected resource. And so, this returns the wrong project when a resource from outside the desired project is selected.
OK, I now know what the problem is and I can run the script as you describe. Here is a temporary fix:
- In your Java build Path in project properties of test_build, remove the entry for test_common. This will cause compilation errors, but that's ok since the script does not rely on compiled code.
- Open the launch configuration for your script.
- On the arguments tab, in the Program Arguments box, replace the text with this:
--classpath "$ {workspace_loc:/test_build}/src:$
{workspace_loc:/test_common}/src:bin" --main groovy.ui.GroovyMain "$
{workspace_loc:/test_build}/src/com/instantiations/test/TestMe.groovy"
I followed these steps and was able to get the script to run. Please let me know if it works for you. If so, I can convert this into a workable solution.
Also, remember you can run this as a Java app as is, but no matter what, you will need to include ant-launcher.jar.
OK...approaching a good solution. In step 3 of comment 6, use this string instead:
--classpath "$
{workspace_loc:/test_build}/src:$
{workspace_loc:/test_build}/bin:$
{workspace_loc:/test_common}/src:$
{workspace_loc:/test_common}/bin" --main groovy.ui.GroovyMain "$
{workspace_loc:/test_build}/src/com/instantiations/test/TestMe.groovy"
And you will not need to do step 1 (ie- you will not have to forcibly break the build classpath and your code will still compile).
I did what you said in comment http://jira.codehaus.org/browse/GRECLIPSE-593?focusedCommentId=205081&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_205081 and it worked. I had to add ant-launcher.jar to the classpath via the IDE but that is expected because you need that jar on the classpath to use the AntBuilder
This fix will not make it into 2.0. I do have a fix for this locally, though. I can perhaps put out a special release for you that contains the fix.
Here is a snapshot I just released that includes a fix for your problem:
http://codehaus.org/~werdna/groovy-update-site-2.0.0.xx-20100107-1300-e35-special.zip
To install, download and point your p2 update manager to the zip. Please let me know if this solves your problem. It is working locally for me, so I expect that it should.
This is now available in trunk and it is in the latest snapshot. This is now fixed. Please raise a new bug if you see any more problems with launching groovy scripts.
this file contains two eclipse projects run the groovy script in project test_build and you will get this error:
Caught: java.io.FileNotFoundException: /home/markr/workspaces/testMe-35/test_common/src/com/instantiations/test/TestMe.groovy (/home/markr/workspaces/testMe-35/test_common/src/com/instantiations/test/TestMe.groovy)