一 問題描述 java
在本機搭建了基於Scala的Eclipse Plugin+scala2.10.3的開發環境, 但打開maven項目pom.xml文件時,卻報空指針異常, pom editor打開失敗. git
查找了網上的一些資料,發現這是scala-ide-play2的一個BUG致使的. github
能夠參考以下信息: app
scala-ide-play2 Version 0.4.0.v-2_10-201308021043-8c62ead breaks Maven POM Editor #176
https://github.com/scala-ide/scala-ide-play2/issues/176 eclipse
二:解決方案
1.升級scala-ide-play2
2.刪除eclipse安裝目錄中plugins,features目錄中包含play的全部目錄及jar,從新啓動eclipse
maven
本人採用第二種方案,測試成功 ide
三 異常信息以下: 測試
java.lang.NullPointerException at org.eclipse.jface.preference.PreferenceConverter.getColor(PreferenceConverter.java:205) at scala.tools.eclipse.util.EclipseUtils$PimpedPreferenceStore.getColor(EclipseUtils.scala:51) at scala.tools.eclipse.properties.syntaxcolouring.ScalaSyntaxClass.getStyleInfo(ScalaSyntaxClass.scala:57) at scala.tools.eclipse.properties.syntaxcolouring.ScalaSyntaxClass.getTextAttribute(ScalaSyntaxClass.scala:30) at scala.tools.eclipse.lexical.AbstractScalaScanner$class.scala$tools$eclipse$lexical$AbstractScalaScanner$$getTextAttribute(AbstractScalaScanner.scala:27) at scala.tools.eclipse.lexical.AbstractScalaScanner$class.scala$tools$eclipse$lexical$AbstractScalaScanner$$createToken(AbstractScalaScanner.scala:18) at scala.tools.eclipse.lexical.AbstractScalaScanner$$anonfun$getToken$1.apply(AbstractScalaScanner.scala:15) at scala.tools.eclipse.lexical.AbstractScalaScanner$$anonfun$getToken$1.apply(AbstractScalaScanner.scala:15) at scala.collection.MapLike$class.getOrElse(MapLike.scala:128) at scala.collection.AbstractMap.getOrElse(Map.scala:58) at scala.tools.eclipse.lexical.AbstractScalaScanner$class.getToken(AbstractScalaScanner.scala:15) at org.scalaide.play2.routeeditor.lexical.AbstractRouteScanner.getToken(AbstractRouteScanner.scala:10) at org.scalaide.play2.routeeditor.lexical.AbstractRouteScanner.<init>(AbstractRouteScanner.scala:11) at org.scalaide.play2.templateeditor.lexical.TemplateDefaultScanner.<init>(TemplateDefaultScanner.scala:11) at org.scalaide.play2.templateeditor.TemplateConfiguration.<init>(TemplateConfiguration.scala:51) at org.scalaide.play2.templateeditor.sse.TemplateStructuredTextViewerConfiguration.org$scalaide$play2$templateeditor$sse$TemplateStructuredTextViewerConfiguration$$scalaConfiguration$lzycompute(TemplateStructuredTextViewerConfiguration.scala:26) at org.scalaide.play2.templateeditor.sse.TemplateStructuredTextViewerConfiguration.org$scalaide$play2$templateeditor$sse$TemplateStructuredTextViewerConfiguration$$scalaConfiguration(TemplateStructuredTextViewerConfiguration.scala:26) at org.scalaide.play2.templateeditor.sse.TemplateStructuredTextViewerConfiguration.getConfiguredContentTypes(TemplateStructuredTextViewerConfiguration.scala:77) at org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration.getContentAssistant(StructuredTextViewerConfiguration.java:286) at org.eclipse.wst.sse.ui.internal.StructuredTextViewer.configure(StructuredTextViewer.java:219) at org.eclipse.ui.texteditor.AbstractTextEditor.createPartControl(AbstractTextEditor.java:3416) at org.eclipse.ui.texteditor.StatusTextEditor.createPartControl(StatusTextEditor.java:54) at org.eclipse.ui.texteditor.AbstractDecoratedTextEditor.createPartControl(AbstractDecoratedTextEditor.java:447) at org.eclipse.wst.sse.ui.StructuredTextEditor.createPartControl(StructuredTextEditor.java:1517) at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:243)