无法在Eclipse中创建新的GWT项目

时间:2018-01-11 21:28:29

标签: java eclipse gwt

我到处寻找解决方案,但找不到任何对我有用的东西。

我有Eclipse Oxygen并安装了GWT插件(取自Eclipse Marketplace)。 当我正在尝试创建新的GWT项目时,给出项目名称和包名称以及unticking(这很重要,因为选中此选项,项目正在创建但仍然无法工作)“生成项目示例代码”并单击完成我已经收到错误消息“创建元素失败。请参阅错误日志以获取更多详细信息”

出错我有以下错误:

插件:org.eclipse.jdt.ui

消息:内部错误

错误消息:

java.lang.reflect.InvocationTargetException
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:398)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:980)
    at org.eclipse.jdt.internal.ui.wizards.NewElementWizard.performFinish(NewElementWizard.java:136)
    at com.google.gdt.eclipse.suite.wizards.NewWebAppProjectWizard.performFinish(NewWebAppProjectWizard.java:115)
    at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:778)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:417)
    at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
    at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:81)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
    at org.eclipse.jface.window.Window.open(Window.java:794)
    at com.google.gdt.eclipse.core.actions.AbstractOpenWizardAction.run(AbstractOpenWizardAction.java:103)
    at com.google.gdt.eclipse.suite.actions.NewWebAppToolbarHandler.execute(NewWebAppToolbarHandler.java:26)
    at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
    at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
    at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
    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:487)
    at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
    at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:431)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:446)
    at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:472)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
    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(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.lang.NullPointerException
    at com.google.gwt.eclipse.core.launch.LegacyGWTLaunchShortcutStrategy.getShell(LegacyGWTLaunchShortcutStrategy.java:110)
    at com.google.gwt.eclipse.core.launch.LegacyGWTLaunchShortcutStrategy.generateUrl(LegacyGWTLaunchShortcutStrategy.java:130)
    at com.google.gdt.eclipse.suite.launch.WebAppLaunchUtil.determineStartupURL(WebAppLaunchUtil.java:139)
    at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.createLaunchConfig(WebAppProjectCreator.java:558)
    at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.create(WebAppProjectCreator.java:372)
    at com.google.gdt.eclipse.suite.wizards.NewWebAppProjectWizard.finishPage(NewWebAppProjectWizard.java:139)
    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:5660)
    at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:105)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Root exception:
java.lang.NullPointerException
    at com.google.gwt.eclipse.core.launch.LegacyGWTLaunchShortcutStrategy.getShell(LegacyGWTLaunchShortcutStrategy.java:110)
    at com.google.gwt.eclipse.core.launch.LegacyGWTLaunchShortcutStrategy.generateUrl(LegacyGWTLaunchShortcutStrategy.java:130)
    at com.google.gdt.eclipse.suite.launch.WebAppLaunchUtil.determineStartupURL(WebAppLaunchUtil.java:139)
    at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.createLaunchConfig(WebAppProjectCreator.java:558)
    at com.google.gdt.eclipse.suite.wizards.WebAppProjectCreator.create(WebAppProjectCreator.java:372)
    at com.google.gdt.eclipse.suite.wizards.NewWebAppProjectWizard.finishPage(NewWebAppProjectWizard.java:139)
    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:5660)
    at org.eclipse.jdt.internal.ui.actions.WorkbenchRunnableAdapter.run(WorkbenchRunnableAdapter.java:105)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

会话数据:

eclipse.buildId=4.7.2.M20171130-0510
java.version=1.8.0_151
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL
Framework arguments:  -product org.eclipse.epp.package.jee.product -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product -data file:/E:/eclipse-workspace/ -product org.eclipse.epp.package.jee.product

任何想法我的日食有什么问题?我试图重新安装但到目前为止没有运气

感谢

2 个答案:

答案 0 :(得分:2)

这是GWT Eclipse插件的已知问题Issue #351 - Unable to create new project

不幸的是,它仍然开放。作为一种变通方法,您可以尝试修复生成的样本的问题(至少,删除除了具有空入口点的模块之外的所有代码)。或者使用Maven / Gradle作为项目的起点。

答案 1 :(得分:0)

使用http://www.gwtproject.org/gettingstarted.html中所述的命令行实用程序webAppCreator创建项目。它生成文件以启动GWT项目。为此,应下载GWT SDK。还需要Apache Ant来运行命令行参数。请设置ANT_HOME环境变量,然后将指向路径附加到bin目录。将项目导入Eclipse。