-
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
Creation of element failed - Groovy Class #240
Comments
Did you select and interfaces or a parent type? Can you say which? |
I didn't select anything. I just put a class name and click in Finish. An empty file is created and the exception above is thrown. I'm using a maven project following the steps of this link, however the issue also happen when I'm using a Groovy project. |
I don't know what to tell you, the stack trace indicates it is looking for inherited methods (createInheritedMethods) and the dialog is tested and I have run it myself today with no issues. |
I have already tested with a clean eclipse (extracted a eclipse into
different directory and created a project in a clean workspace) however the
problem persist. I'll try to discover what is the cause of this problem, if
a found something I will update this thread.
Thanks anyway.
|
Can you say what version of eclipse you are using? The compiler version is not really as impactful in this situation as the version of Eclipse and the JDT UI stuff. |
I'm using Eclipse Neon.1a Release (4.6.1). However, I've tested with other
versions (Oxygen and Luna), with a clean install and workspace, and both
have the same problem.
Just in case, my JDK/JRE version is:
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
|
Do you have any Java Runtime Environments installed (not JDKs)? On Windows (I'm just guessing if that is what you have), the public JREs can get registered in the Registry and can step in front of JDKs. |
Also, do you have any code templates besides the defaults? I have a pretty plain new class template. Could you create a new Java type using the same settings and reply with the resulting stub class? |
Thank you Eric, you help me found the problem! :-D
I had change two eclipse templates, one for new Java files and another for
class body. In the Java file template, I've added two imports "import
org.slf4j.Logger;" and "import org.slf4j.LoggerFactory;", and because them,
when I attempted to create a new Groovy Class the exception was thrown.
Now, I removed the changes from the templates and now all is working fine.
I didn't realize that eclipse was syncing my configs from cloud and because
that even the fresh eclipses downloads was with the same problem. But I
still not understand why these exceptions arise when I put these imports in
the template.
|
Could you share the template you had? There is a strange syntax for adding new imports. Also, for a new Groovy type, you would probably want to use the @slf4j transform instead. |
I've been a issue to create a new groovy class in eclipse.
When I finish the wizard occurs an error "Creation of element failed" and the file *.groovy is created empty.
Groovy Compiler 2.4 Version 2.9.2.xx-201612060002-e46
My eclipse also have installed the JDT Core patch and M2E configurator for Groovy.
The text was updated successfully, but these errors were encountered: