Troubleshooting protoc integration

47 views
Skip to first unread message

jmockittester

unread,
Sep 21, 2011, 9:42:14 AM9/21/11
to protobuf-dt
Hey All. I'd first like to say "Great job" on the development tools.
They're very handy. When I was reviewing it, I also noticed that it
would integrate with protoc, which, while not being the primary reason
of getting the tools, it was a nice bonus.

However, I'm having some trouble getting it to generate the compiled
class. I've got the "Java" option enabled from the Preferences, and
I've tried src-gen, src/main/java, I've put it in my project, put it
in my workspace, I've created the folders (I think I read through
another issue that it didn't create folders, so I did it for it), but
all to no avail. I've looked over all the documentation and issues,
but wasn't able to figure out what might be going wrong. Is there
something else I'm potentially missing to get it up and running?

This is 1.0.2 of the dt, 2.4.1 of protoc, and 3.7 of Eclipse.

Up until now, I've had the executable as an external tool in Eclipse
and I used Eclipse variables to dynamically place the proto in the
folder I wanted it generated, but I would be happy even getting the dt
to put it in a single spot. Any help would be greatly appreciated!

Ben Wright

unread,
Sep 21, 2011, 10:09:38 AM9/21/11
to protobuf-dt
Without more information I can only provide broad suggestions to try
to resolve the issue.

Source will be generated in the folder specified in the preference
page (default is src-gen)
The XText nature must be added to the project (you would have been
prompted to add this when opening a proto file in the project)
THe XText builder must be enabled (default is enabled)
The eclipse build process has to execute (do you have Build
Automatically on? otherwise tell the project to build)
There must be no errors in your proto file(s) - error markers will
prevent the build from running. This includes making sure and imports
are resolved (the preferences can control import directories)

Beyond those suggestions I'm not sure what might be wrong. I would
advise you to open the "Error Log" view in eclipse and see if you're
getting an error during the build process.

jmockittester

unread,
Sep 21, 2011, 10:37:17 AM9/21/11
to protobuf-dt
I do have Build Automatically on, and the XText builder is enabled. I
don't remember though if it asked me about the XText nature. Is there
a way to verify that I do have that?

Also, where should this src-gen folder be located? Is that at the
workspace level or the project level? I created folders at both
locations in case that it couldn't create them on its own, and I also
remove a few other classes that had compiler errors (if that somehow
matters), but it doesn't look like that's working either. Thank you
for the help though!

Ben Wright

unread,
Sep 21, 2011, 11:32:48 AM9/21/11
to protobuf-dt
You can check the project natures / builder is on the project by
opening the project properties and looking at the builders entry. You
should see a builder "XText Project Builder". Try forcing a build
(right click build) and then forcing a refresh (right click refresh)
on the project.

The src-gen folder should be at the project level.

If you're still not getting anything I'll create a project I know
works and attach as a zip.

What platform are you on?

OS / Version
Eclipse / Version
1.0.2 protobuf-dt

jmockittester

unread,
Sep 21, 2011, 5:12:36 PM9/21/11
to protobuf-dt
OS / Vista Service Pack 2 32-bit
Eclipse / Indigo 3.7.0

Pepe

unread,
Sep 27, 2011, 6:19:50 PM9/27/11
to protobuf-dt
I'm having similar problems also.

CONFIG:
eclipse.buildId=I20110613-1736
java.version=1.6.0_26
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=es_ES
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86 -product
org.eclipse.epp.package.jee.product -data C:\eclipse-indigo\workspaces
\Civis

PROTOBUF IDE CONFIG:
com.google.eclipse.protobuf.Protobuf.prefs :

compiler.enableProjectSettings=true
compiler.javaOutputDirectory=srcgen
compiler.protocFilePath=C\:\\protoc\\protoc.exe
eclipse.preferences.version=1
general.enableProjectSettings=true
paths.directoryPaths=${workspace_loc\:/${project}/src/main/resources/
protobuf}
paths.filesInMultipleDirectories=true
paths.filesInOneDirectoryOnly=false

ERROR MESSAGE:
org.eclipse.xtext.builder.impl.XtextBuilder - Unexpected internal
error near index 1
\
^


STACK TRACE:
java.util.regex.PatternSyntaxException: Unexpected internal error near
index 1
\
^
at java.util.regex.Pattern.error(Pattern.java:1713)
at java.util.regex.Pattern.compile(Pattern.java:1466)
at java.util.regex.Pattern.<init>(Pattern.java:1133)
at java.util.regex.Pattern.compile(Pattern.java:823)
at java.lang.String.split(String.java:2292)
at java.lang.String.split(String.java:2334)
at
com.google.eclipse.protobuf.ui.builder.OutputDirectories.findOrCreateOutputDirectory(OutputDirectories.java:
45)
at
com.google.eclipse.protobuf.ui.builder.OutputDirectories.findOrCreateOutputDirectory(OutputDirectories.java:
41)
at
com.google.eclipse.protobuf.ui.builder.OutputDirectories.findOrCreateOutputDirectories(OutputDirectories.java:
34)
at
com.google.eclipse.protobuf.ui.builder.ProtobufBuildParticipant.build(ProtobufBuildParticipant.java:
52)
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.fullBuild(XtextBuilder.java:
182)
at
org.eclipse.xtext.builder.impl.XtextBuilder.build(XtextBuilder.java:
85)
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.basicBuild(BuildManager.java:
256)
at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:
394)
at org.eclipse.core.internal.resources.Project$1.run(Project.java:
618)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:
2344)
at
org.eclipse.core.internal.resources.Project.internalBuild(Project.java:
597)
at org.eclipse.core.internal.resources.Project.build(Project.java:
114)
at
com.google.eclipse.protobuf.ui.preferences.pages.paths.PathsPreferencePage
$4.run(PathsPreferencePage.java:200)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Pepe

unread,
Sep 27, 2011, 6:22:53 PM9/27/11
to protobuf-dt
I forgot to mention the protobuf-dt version:
1.0.2.201109132345

Ben Wright

unread,
Sep 27, 2011, 6:34:52 PM9/27/11
to proto...@googlegroups.com
you would think i would recognize an issue I fixed myself right away... sorry about that...

The issue you're seeing is covered in https://code.google.com/p/protobuf-dt/issues/detail?id=119
and has been resolved for the next release (I do not know when the next release is planned).  I mistakenly thought the fix was in 1.0.2

If you need this fix sooner you can build the plugin from source.  I've also attached an update site build here that includes a few fixes after 1.0.2 including 119. 

Disclaimer... the protobuf-dt team cannot take any responsibility for issues you have off of this build as it is not a release - it's a personal build from modified source on 9/16/2011.

If you update to this version you may need to uninstall it prior to updating to 1.0.3 when it is released.
protobuf-dt-1.0.2-patched.zip

Alex Ruiz

unread,
Sep 27, 2011, 7:57:18 PM9/27/11
to proto...@googlegroups.com
Thanks Ben for taking care of this! :)

The new release is a bit delayed. The main reason is that support for custom options (hyperlinking, content-assist, etc.) is taking longer than expected. Hopefully we'll have it ready in two weeks.

Cheers!
-Alex

Pepe

unread,
Sep 27, 2011, 8:03:10 PM9/27/11
to protobuf-dt
Thanks a lot for the patch, problem solved !!!!

jmockittester

unread,
Sep 29, 2011, 1:18:43 PM9/29/11
to protobuf-dt
Thank you, both Ben and Pepe. I didn't even think to check the error
log to see if the tool was blowing up.

On Sep 27, 5:34 pm, Ben Wright <compuware...@gmail.com> wrote:
> you would think i would recognize an issue I fixed myself right away...
> sorry about that...
>
> The issue you're seeing is covered in *https://code.google.com/p/protobuf-dt/issues/detail?id=119
> *and has been resolved for the next release (I do not know when the next
> release is planned).  I mistakenly thought the fix was in 1.0.2
>
> If you need this fix sooner you can build the plugin from source.  I've also
> attached an update site build here that includes a few fixes after 1.0.2
> including 119.  
>
> Disclaimer... the protobuf-dt team cannot take any responsibility for issues
> you have off of this build as it is not a release - it's a personal build
> from *modified *source on 9/16/2011.
>
> If you update to this version you may need to uninstall it prior to updating
> to 1.0.3 when it is released.
>
>  protobuf-dt-1.0.2-patched.zip
> 1231KViewDownload
Reply all
Reply to author
Forward
0 new messages