Export to GitHub

protobuf-dt - issue #203

NPE when generating protoc command


Posted on Feb 10, 2012 by Happy Panda

When i save a .proto file I receive the following exception. I've created the src-gen folder and the protobuf-dt is stetted-up like in the wiki tutorial.

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:56) at com.google.eclipse.protobuf.ui.builder.protoc.ProtobufBuildParticipant.build(ProtobufBuildParticipant.java:60) at org.eclipse.xtext.builder.impl.RegistryBuilderParticipant.build(RegistryBuilderParticipant.java:60) at org.eclipse.xtext.builder.impl.XtextBuilder.doBuild(XtextBuilder.java:160) at org.eclipse.xtext.builder.impl.XtextBuilder.incrementalBuild(XtextBuilder.java:141) at org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:91) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:239) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:292) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:295) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:351) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:374) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Java and Eclipse Info:

eclipse.buildId=M20110909-1335 java.version=1.6.0_29 java.vendor=Apple Inc. BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=it_IT

Attachments

Comment #1

Posted on Feb 10, 2012 by Grumpy Cat

(No comment was entered for this change.)

Comment #2

Posted on Feb 10, 2012 by Grumpy Cat

What version of the proto editor are you using?

Thanks, -Alex

Comment #3

Posted on Feb 12, 2012 by Grumpy Cat

I can't reproduce this issue. Please provide steps to reproduce (or better yet, attach a project where this issue is reproducible.)

Comment #4

Posted on Feb 12, 2012 by Grumpy Cat

(No comment was entered for this change.)

Comment #5

Posted on Feb 13, 2012 by Happy Panda

I've installed the eclipse plugin from http://protobuf-dt.googlecode.com/git/update-site I'm developing an OSGi plugin project. I've attached a simple OSGi plugin project that reproduces the issue.

Attachments

Comment #6

Posted on Feb 13, 2012 by Grumpy Cat

Great!! thanks a lot.

Comment #7

Posted on Feb 13, 2012 by Grumpy Cat

(No comment was entered for this change.)

Comment #8

Posted on Feb 14, 2012 by Grumpy Cat

I found the problem: IResource#getLocation does not like whitespace in the parent root folder. The interesting part: fixing it.

Comment #9

Posted on Feb 14, 2012 by Grumpy Cat

r48452a6cad7f

Comment #10

Posted on Feb 14, 2012 by Grumpy Cat

Proto editor will not throw NPEs when the path of file to compile has whitespace, but protoc may not be able to compile it. See http://code.google.com/p/protobuf/issues/detail?id=169

Comment #11

Posted on Feb 14, 2012 by Happy Panda

Thanks, I will pay attention to specify paths without white spaces to avoid further problems with protoc.

Status: Fixed

Labels:
Type-Defect Priority-Critical Milestone-Release-1.2.3