Skip to content
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

Closed
adalrsjr1 opened this issue Dec 6, 2016 · 10 comments
Closed

Creation of element failed - Groovy Class #240

adalrsjr1 opened this issue Dec 6, 2016 · 10 comments

Comments

@adalrsjr1
Copy link

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.

eclipse.buildId=4.6.1.M20160907-1200
java.version=1.8.0_111
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pt_BR
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.modeling.product
java.lang.reflect.InvocationTargetException
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:398)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:993)
	at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:136)
	at org.codehaus.groovy.eclipse.wizards.NewClassWizard.performFinish(NewClassWizard.java:71)
	at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:790)
	at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:423)
	at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:618)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4228)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3816)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
	at org.eclipse.jface.window.Window.open(Window.java:794)
	at org.eclipse.ui.internal.handlers.WizardHandler$New.executeHandler(WizardHandler.java:269)
	at org.eclipse.ui.internal.handlers.WizardHandler.execute(WizardHandler.java:290)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:353)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:155)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4410)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4228)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3816)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
Caused by: java.lang.NullPointerException
	at org.eclipse.jdt.internal.corext.dom.ASTNodes.getParent(ASTNodes.java:1009)
	at org.eclipse.jdt.internal.corext.dom.ASTNodes.getTypeBinding(ASTNodes.java:1480)
	at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createInheritedMethods(NewTypeWizardPage.java:2666)
	at org.eclipse.jdt.ui.wizards.NewClassWizardPage.createTypeMembers(NewClassWizardPage.java:256)
	at org.codehaus.groovy.eclipse.wizards.NewClassWizardPage.createTypeMembers(NewClassWizardPage.java:83)
	at org.eclipse.jdt.ui.wizards.NewTypeWizardPage.createType(NewTypeWizardPage.java:2218)
	at org.codehaus.groovy.eclipse.wizards.NewClassWizardPage.createType(NewClassWizardPage.java:164)
	at org.codehaus.groovy.eclipse.wizards.NewClassWizard.finishPage(NewClassWizard.java:63)
	at org.eclipse.jdt.internal.ui.wizards.NewElementWizard$2.run(NewElementWizard.java:120)
	at org.eclipse.jdt.internal.core.BatchOperation.executeOperation(BatchOperation.java:39)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:724)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.jdt.core.JavaCore.run(JavaCore.java:5481)
	at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:105)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
@eric-milles
Copy link
Member

Did you select and interfaces or a parent type? Can you say which?

@adalrsjr1
Copy link
Author

adalrsjr1 commented Dec 8, 2016

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.

This is the wizard window:
image

@eric-milles
Copy link
Member

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.

@adalrsjr1
Copy link
Author

adalrsjr1 commented Dec 8, 2016 via email

@eric-milles
Copy link
Member

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.

@adalrsjr1
Copy link
Author

adalrsjr1 commented Dec 19, 2016 via email

@eric-milles
Copy link
Member

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.

@eric-milles
Copy link
Member

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?

@adalrsjr1
Copy link
Author

adalrsjr1 commented Dec 19, 2016 via email

@eric-milles
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants