本文介绍了在Apache Netbeans9中异常创建新的Maven项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Apache Netbeans9中创建新的maven项目时,我遇到了此异常,我正在使用Java10.

I faced this exception when I create a new maven project in Apache Netbeans9, I'm using Java10.

以下是例外文本:

java.lang.IllegalArgumentException: Key contains code point U+0000
    at java.prefs/java.util.prefs.AbstractPreferences.get(AbstractPreferences.java:296)
    at org.netbeans.modules.maven.queries.MavenFileOwnerQueryImpl.registerCoordinates(MavenFileOwnerQueryImpl.java:153)
    at org.netbeans.modules.maven.ProjectOpenedHookImpl.registerWithSubmodules(ProjectOpenedHookImpl.java:431)
    at org.netbeans.modules.maven.ProjectOpenedHookImpl.projectOpened(ProjectOpenedHookImpl.java:138)
    at org.netbeans.spi.project.ui.ProjectOpenedHook$1.projectOpened(ProjectOpenedHook.java:60)
[catch] at org.netbeans.modules.project.ui.OpenProjectList.notifyOpened(OpenProjectList.java:1273)
    at org.netbeans.modules.project.ui.OpenProjectList.doOpenProject(OpenProjectList.java:1354)
    at org.netbeans.modules.project.ui.OpenProjectList.open(OpenProjectList.java:798)
    at org.netbeans.modules.project.ui.OpenProjectList$6.run(OpenProjectList.java:650)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:278)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)

屏幕截图

推荐答案

最后,找到解决方法!

您(还有我)都使用了较早版本的Netbeans,因此Netbeans在

保留了旧的首选项和设置,例如DB连接,AppServer,已安装的模块等.C:\Users\[your username]\AppData\Roaming\NetBeans\

...并尝试将其导入.您的任何首选项或设置可能包含错误的数据.只需删除或重命名此目录,然后重新启动即可.

You (and me as well) used Netbeans of older versions, so Netbeans keeps old preferences and settings like DB connections, AppServers, installed modules and so on at

C:\Users\[your username]\AppData\Roaming\NetBeans\

... and tries to import it. Possibly any of your preferences or settings containes wrong data. Just remove or rename this directory and start for fresh.

请注意:您的所有偏好都会丢失!

Be aware: all you preferences will be lost!

另一种方法:您可以在较旧配置的所有文件中搜索patterm \u0000(仅作为文本).在我的情况下,两个文件包含行

Another approach: you can search patterm \u0000 (just as text) in all files at older configurations. In my case two files were containing lines

\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000

从一开始.删除即可解决问题.

at the very begining. Removing that solved the problem.

这篇关于在Apache Netbeans9中异常创建新的Maven项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 12:34