我正在使用Eclipse和protobuf-dt插件。我已经设置了一个项目,每当我编辑一个原型文件时,日志中都会出现以下错误:
java.lang.NullPointerException
at com.google.eclipse.protobuf.ui.protoc.command.ImportRootsProtocOption.locationAsFile(ImportRootsProtocOption.java:94)
at com.google.eclipse.protobuf.ui.protoc.command.ImportRootsProtocOption.singleImportRoot(ImportRootsProtocOption.java:77)
at com.google.eclipse.protobuf.ui.protoc.command.ImportRootsProtocOption.initialize(ImportRootsProtocOption.java:58)
at com.google.eclipse.protobuf.ui.protoc.command.ImportRootsProtocOption.addOptionToCommand(ImportRootsProtocOption.java:42)
at com.google.eclipse.protobuf.ui.protoc.command.ProtocCommandBuilder.buildCommand(ProtocCommandBuilder.java:51)
at com.google.eclipse.protobuf.ui.builder.protoc.ProtobufBuildParticipant.build(ProtobufBuildParticipant.java:79)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant$DeferredBuilderParticipant.build(RegistryBuilderParticipant.java:161)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:69)
at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:291)
at org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextBuilder.java:319)
at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:155)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
我在代码中进行了一些挖掘,它似乎试图解决导入路径并失败,所以我尝试按如下方式更改配置(之前选择了一个目录选项):
错误更改为:
java.lang.NullPointerException
at com.google.eclipse.protobuf.ui.protoc.command.ProtocCommand.setFileToCompile(ProtocCommand.java:42)
at com.google.eclipse.protobuf.ui.protoc.command.ProtocCommandBuilder.buildCommand(ProtocCommandBuilder.java:55)
at com.google.eclipse.protobuf.ui.builder.protoc.ProtobufBuildParticipant.build(ProtobufBuildParticipant.java:79)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant$DeferredBuilderParticipant.build(RegistryBuilderParticipant.java:161)
at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:69)
at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:291)
at org.eclipse.xtext.builder.impl.XtextBuilder.fullBuild(XtextBuilder.java:319)
at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:155)
at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:235)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
有没有人知道这里发生了什么以及我如何修复它?