-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ClassNotFoundException: org.codehaus.groovy.runtime.DefaultGroovyMethods when opening a Groovy editor in a project without Groovy on the classpath #587
Comments
Duplicate of #582 |
It can't be a duplicate of that issue, I'm not using Java 9/10 at all, as you can see from the original message (javaRuntimeVersion property). |
Is this error intermittent or consistently recreateable with a sequence to steps? DefaultGroovyMethods should be loaded from your project's classpath now (recent change) instead of Eclipse runtime bundles supplemented by project classpath. |
I don't have exact steps to repro, it was occurring consistently on a workspace of mine. Could the problem be that Groovy is not on the project classpath? If so, I think Greclipse should fail gracefully and just disable features related to DefaultGroovyMethods (like code assist, I think) |
There are 2 likely possibilities I can think of:
|
You can view the classpath used by closing all open editors, cleaning the project, opening the Groovy Event Console and then opening one Groovy source within the project, There will be a line item in the Groovy Event Console like: |
Both cases 1 and 2 may happen. For case 1, I can think of any Gradle project not applying the Java plugin (the master project of a multiproject, for instance). Case 2 is likely to be just a temporary situation (maybe while adjusting your project setup), but anyway having Eclipse complaining repeatedly with an exception is not nice. I can't find right now what was the workspace that was exhibiting this problem consistently, but I think that the scenario is quite clear now. |
This goes to error log so that user may continue using eclipse without interruption but will have record of problem encountered. |
Yes, but if you have automatic error reporting enabled it pops up repeatedly. |
Today I encountered this problem. It happens when opening build.gradle in a plain Java project (which I think is a perfectly common scenario). The Groovy Event Console confirms that Groovy is not on the classpath (and it should not). As I said, this problem is very annoying when you have the automated error reporting enabled. And, if one has the option to automatically send reports to it, you'll flood the Eclipse AERI servers. IMHO Greclipse should just fail gracefully: when Groovy is not on the classpath, assume there's no DGM methods available. |
I also get this: eclipse.buildId=4.8.0.I20180611-0500 org.eclipse.jdt.core
|
Same problem here. Eclipse regularly pops up notification windows caused by this error - very annoying. |
@veita Can you describe your use case a bit? What type of Groovy source are you editing in a project without the Groovy Runtime on the classpath? |
I get the error with groovy on the classpath. |
I get this error under various circumstances, usually with Groovy in the project classpath. The projects usually do have Java but not Groovy nature. One way to produce the error is to create an empty Gradle project with
Play around (opening |
This keeps happening on Eclipse 4.9 with Groovy-eclipse 3.5.0 Groovy-eclipse-compiler eclipse.buildId=4.9.0.I20180906-0745 |
I often get errors like this:
They seem to be related to some background activity bound to project refresh or such, not to a specific action I start.
The text was updated successfully, but these errors were encountered: