eclipse:添加 JSF 2 方面会导致 NullpointerException

发布于 2024-10-12 07:46:48 字数 9112 浏览 9 评论 0原文

我有一个 Maven 项目,然后,我想在项目中启用 JSF 2 Facet,因为我意识到在编辑 jsf 时无法使用 jsf / primefaces 标签以及带有 ctrl 空格的标签属性进行自动完成页。

在我的 Helios eclipse 中启用 JSF 2 方面会导致 NullPointerException,并带有完整的异常跟踪:

!ENTRY org.eclipse.wst.common.project.facet.core 4 0 2011-01-18 22:45:17.073
!MESSAGE null
!STACK 0
java.lang.NullPointerException
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.validateConfigLocation(JSFFacetInstallDataModelProvider.java:232)
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.validate(JSFFacetInstallDataModelProvider.java:161)
        at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.validate(DataModelImpl.java:377)
        at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.validate(DataModelImpl.java:358)
        at org.eclipse.wst.common.componentcore.datamodel.FacetDataModelConfigAdapter.validate(FacetDataModelConfigAdapter.java:63)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.updateFurtherConfigHyperlink(FacetsPropertyPage.java:422)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.access$4(FacetsPropertyPage.java:337)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$6.run(FacetsPropertyPage.java:330)                                                                               
        at org.eclipse.wst.common.project.facet.ui.internal.util.SwtUtil.runOnDisplayThread(SwtUtil.java:34)                                                                                    
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.handleProjectModifiedEvent(FacetsPropertyPage.java:334)                                                          
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.access$2(FacetsPropertyPage.java:324)                                                                            
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$3.handleEvent(FacetsPropertyPage.java:189)                                                                       
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.notifyListeners(FacetedProjectWorkingCopy.java:1752)                                                    
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.resumeEventNotification(FacetedProjectWorkingCopy.java:1797)                                            
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.addProjectFacet(FacetedProjectWorkingCopy.java:822)                                                     
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel.handleCheckStateChanged(FacetsSelectionPanel.java:758)                                                         
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel.access$10(FacetsSelectionPanel.java:729)                                                                       
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel$6.checkStateChanged(FacetsSelectionPanel.java:309)                                                             
        at org.eclipse.jface.viewers.CheckboxTreeViewer$1.run(CheckboxTreeViewer.java:166)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
        at org.eclipse.jface.viewers.CheckboxTreeViewer.fireCheckStateChanged(CheckboxTreeViewer.java:164)
        at org.eclipse.jface.viewers.CheckboxTreeViewer.handleSelect(CheckboxTreeViewer.java:300)
        at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1220)
        at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:228)
        at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:222)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:389)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
        at org.eclipse.jface.window.Window.open(Window.java:801)
        at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY org.eclipse.wst.common.project.facet.core 4 0 2011-01-18 22:45:18.622
!MESSAGE Failed while installing JavaServer Faces 2.0.
!STACK 0
java.lang.NullPointerException
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate.resolveConfigPath(JSFFacetInstallDelegate.java:296)
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate.createConfigFile(JSFFacetInstallDelegate.java:313)
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate.execute(JSFFacetInstallDelegate.java:124)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1478)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:442)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1182)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1118)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$5.run(FacetedProject.java:1100)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges(FacetedProject.java:1110)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.commitChanges(FacetedProjectWorkingCopy.java:2020)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$4.run(FacetsPropertyPage.java:232)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$5.run(FacetsPropertyPage.java:246)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

这里可能出了什么问题 .. 或 ..

也许还有其他一些方法可以在不添加动态 Web 模块和 jsf 2 方面的情况下启用自动完成在日食赫利俄斯?

I have a maven project, and then, i would like to enable JSF 2 facet into the project, because i realized that i cant do the auto completion with the jsf / primefaces tags and with the tag attributes with the ctrl space when editing my jsf page.

Enabling the JSF 2 facet in my Helios eclipse results in NullPointerException, with this complete exception trace :

!ENTRY org.eclipse.wst.common.project.facet.core 4 0 2011-01-18 22:45:17.073
!MESSAGE null
!STACK 0
java.lang.NullPointerException
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.validateConfigLocation(JSFFacetInstallDataModelProvider.java:232)
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDataModelProvider.validate(JSFFacetInstallDataModelProvider.java:161)
        at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.validate(DataModelImpl.java:377)
        at org.eclipse.wst.common.frameworks.internal.datamodel.DataModelImpl.validate(DataModelImpl.java:358)
        at org.eclipse.wst.common.componentcore.datamodel.FacetDataModelConfigAdapter.validate(FacetDataModelConfigAdapter.java:63)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.updateFurtherConfigHyperlink(FacetsPropertyPage.java:422)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.access$4(FacetsPropertyPage.java:337)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$6.run(FacetsPropertyPage.java:330)                                                                               
        at org.eclipse.wst.common.project.facet.ui.internal.util.SwtUtil.runOnDisplayThread(SwtUtil.java:34)                                                                                    
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.handleProjectModifiedEvent(FacetsPropertyPage.java:334)                                                          
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage.access$2(FacetsPropertyPage.java:324)                                                                            
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$3.handleEvent(FacetsPropertyPage.java:189)                                                                       
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.notifyListeners(FacetedProjectWorkingCopy.java:1752)                                                    
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.resumeEventNotification(FacetedProjectWorkingCopy.java:1797)                                            
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.addProjectFacet(FacetedProjectWorkingCopy.java:822)                                                     
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel.handleCheckStateChanged(FacetsSelectionPanel.java:758)                                                         
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel.access$10(FacetsSelectionPanel.java:729)                                                                       
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsSelectionPanel$6.checkStateChanged(FacetsSelectionPanel.java:309)                                                             
        at org.eclipse.jface.viewers.CheckboxTreeViewer$1.run(CheckboxTreeViewer.java:166)
        at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
        at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
        at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
        at org.eclipse.jface.viewers.CheckboxTreeViewer.fireCheckStateChanged(CheckboxTreeViewer.java:164)
        at org.eclipse.jface.viewers.CheckboxTreeViewer.handleSelect(CheckboxTreeViewer.java:300)
        at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:1220)
        at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:228)
        at org.eclipse.jface.util.OpenStrategy.access$4(OpenStrategy.java:222)
        at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:389)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
        at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
        at org.eclipse.jface.window.Window.open(Window.java:801)
        at org.eclipse.ui.dialogs.PropertyDialogAction.run(PropertyDialogAction.java:157)
        at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
        at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
        at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
        at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
        at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
        at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
        at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
        at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
        at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
        at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
        at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
        at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
        at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
        at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
        at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
        at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
        at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
        at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
        at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
        at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
        at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

!ENTRY org.eclipse.wst.common.project.facet.core 4 0 2011-01-18 22:45:18.622
!MESSAGE Failed while installing JavaServer Faces 2.0.
!STACK 0
java.lang.NullPointerException
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate.resolveConfigPath(JSFFacetInstallDelegate.java:296)
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate.createConfigFile(JSFFacetInstallDelegate.java:313)
        at org.eclipse.jst.jsf.core.internal.project.facet.JSFFacetInstallDelegate.execute(JSFFacetInstallDelegate.java:124)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.callDelegate(FacetedProject.java:1478)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.modifyInternal(FacetedProject.java:442)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChangesInternal(FacetedProject.java:1182)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.access$2(FacetedProject.java:1118)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject$5.run(FacetedProject.java:1100)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProject.mergeChanges(FacetedProject.java:1110)
        at org.eclipse.wst.common.project.facet.core.internal.FacetedProjectWorkingCopy.commitChanges(FacetedProjectWorkingCopy.java:2020)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$4.run(FacetsPropertyPage.java:232)
        at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
        at org.eclipse.wst.common.project.facet.ui.internal.FacetsPropertyPage$5.run(FacetsPropertyPage.java:246)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

What could be wrong here .. or ..

Perhaps there is some other ways to enable the auto completion without adding the dynamic web module and jsf 2 facets in the Eclipse Helios ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

只为守护你 2024-10-19 07:46:48

我自己找到了解决方案/解决方法。我只是删除该项目,将其重新导入为 Maven 项目,添加方面,最后现在一切都很好。

谢谢!现在很开心。希望这也能帮助其他人。

I've found the solution/workaround myself. I just delete the project, re-import it as a maven project, added the facets and finally everything is fine now.

Thanks! Very happy now. Hopefully this could help others also.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文