2012-02-09 49 views
1

我正在使用Eclipse Indigo和最新的JBoss工具。 對於現有的Seam 2項目,我無法將Seam 2設置應用於任何Seam項目(主要接縫項目,ejb)。添加Seam 2設置錯誤

任何時候,我嘗試設置縫設置爲已知的Seam運行時我得到以下空指針:

java.lang.NullPointerException 
    at org.eclipse.core.internal.resources.ProjectDescription.setBuildSpec(ProjectDescription.java:569) 
    at org.jboss.tools.jst.web.WebModelPlugin.addNatureToProjectWithValidationSupport(WebModelPlugin.java:206) 
    at org.jboss.tools.seam.core.SeamUtil.enableSeamSupport(SeamUtil.java:57) 
    at org.jboss.tools.seam.ui.preferences.SeamSettingsPreferencePage.performOk(SeamSettingsPreferencePage.java:759) 
    at org.eclipse.jface.preference.PreferenceDialog$13.run(PreferenceDialog.java:964) 
    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.preference.PreferenceDialog.okPressed(PreferenceDialog.java:944) 
    at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.okPressed(FilteredPreferenceDialog.java:447) 
    at org.eclipse.jface.preference.PreferenceDialog.buttonPressed(PreferenceDialog.java:233) 
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624) 
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240) 
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84) 
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) 
    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:158) 
    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:1053) 
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165) 
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754) 
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696) 
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660) 
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494) 
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674) 
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332) 
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667) 
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) 
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123) 
    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:344) 
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179) 

回答

1

我解決了這一點,但我從來沒有得到根本原因。

我使用了一個我知道工作的版本,並將eclipse的.classpath和.project文件複製到違規項目中。不是最好的解決方案,但它工作。在比較兩個項目時,我無法手動處理首選項,因爲它們完全相同(除了代碼庫更改)。

0

對我來說,我能夠解決這個問題,將buildSpec和nature標籤添加到.project文件,然後重新啓動eclipse。

<buildCommand> 
    <name>org.jboss.tools.seam.core.seambuilder</name> 
    <arguments> 
    </arguments> 
</buildCommand> 
    ... 
<natures> 
    <nature>org.jboss.tools.seam.core.seamnature</nature> 
</natures>