Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

带import 的 proto 生成Java报错 #69

Open
wjm0729 opened this issue Apr 16, 2017 · 1 comment
Open

带import 的 proto 生成Java报错 #69

wjm0729 opened this issue Apr 16, 2017 · 1 comment
Assignees
Labels

Comments

@wjm0729
Copy link

wjm0729 commented Apr 16, 2017

ProtobufIDLProxy.generateSource(protoPath, javaOutPath);
proto文件有import 会生成失败。
如下 生成 ProtobufIDLProxy.generateSource("./PlayerInfo.proto", "./out");
Exception in thread "main" java.lang.RuntimeException: Message 'PlayerInfo' depend on message 'ItemInfo' is missed
at com.baidu.bjf.remoting.protobuf.ProtobufIDLProxy.hasDependency(ProtobufIDLProxy.java:630)
at com.baidu.bjf.remoting.protobuf.ProtobufIDLProxy.createMessageClass(ProtobufIDLProxy.java:440)
at com.baidu.bjf.remoting.protobuf.ProtobufIDLProxy.doCreatePro(ProtobufIDLProxy.java:343)
at com.baidu.bjf.remoting.protobuf.ProtobufIDLProxy.doCreatePro(ProtobufIDLProxy.java:382)
at com.baidu.bjf.remoting.protobuf.ProtobufIDLProxy.generateSource(ProtobufIDLProxy.java:287)
at com.baidu.bjf.remoting.protobuf.ProtobufIDLProxy.generateSource(ProtobufIDLProxy.java:281)
at JprotobufTest.main(JprotobufTest.java:19)

proto 文件如下:

PlayerInfo.proto

syntax = "proto3";
import "ItemInfo.proto";
package Proto.Generate;
message PlayerInfo {
int64 uid=1;
string accountId=2;
string name=3;
int64 createTime=4;
string pf=5;
int32 level=6;
int64 exp=7;
int32 diamonds=8;
int32 superiors=9;
int32 gold=10;
int32 silver=11;
repeated ItemInfo items=12;
}

ItemInfo.proto

syntax = "proto3";
package Proto.Generate;
message ItemInfo {
int64 itemId=1;
int64 uid=2;
int32 templateId=3;
int32 count=4;
int64 createTime=5;
int32 para1=6;
int64 para2=7;
}

@xiemalin
Copy link
Contributor

fixed at 1.10.5 and 2.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants