eclipse:在NullpointerException中添加JSF 2 facet结果

时间:2011-01-18 15:51:44

标签: java eclipse jsf jsf-2 primefaces

我有一个maven项目,然后,我想启用JSF 2 facet进入项目,因为我意识到我不能使用jsf / primefaces标签和带有ctrl空间的标签属性进行自动完成编辑我的jsf页面。

在我的Helios eclipse中启用JSF 2 facet导致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)

这里可能有什么问题......或者......

也许还有其他方法可以在Eclipse Helios中添加动态Web模块和jsf 2 facet来启用自动完成功能吗?

1 个答案:

答案 0 :(得分:3)

我自己找到了解决方案/解决方法。我只是删除了项目,重新导入它作为maven项目,添加了facets,最后一切都很好。

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