[解决]--java_out: User.proto: User.proto: Cannot generate Java output because the file 's
在使用 protocol buffer 的时候,用.proto文件生成代码文件时报错
使用命令
protoc.exe --java_out c:\logs\ User.proto
User.proto文件内容格式如下
message User{
required string userName = 1[default=""];
required string password = 2[default=""];
}
使用cmd命令时出现如下错误
--java_out: User.proto: User.proto: Cannot generate Java output because the file
's outer class name, "User", matches the name of one of the types declared insid
e it. Please either rename the type or use the java_outer_classname option to s
pecify a different outer class name for the .proto file.

解决方法:
原因User.proto文件名和里面的类名重复,文件名是User 里面内容message User都使用 User
修改User.proto文件名改成不和里面类名重复的就可以了,这里改成UserProtobuff
然后运行protoc.exe --java_out c:\logs\ UserProtobuff.proto 运行成功了。
第二种解决方法:
在ptoto文件中添加i行
option java_outer_classname="ReservationTypeOuterClass";
来指定生成的java类的类名
[解决]--java_out: User.proto: User.proto: Cannot generate Java output because the file 's的更多相关文章
- org.apache.hadoop.hive.ql.metadata.HiveException: Internal Error: cannot generate all output rows for a Partition解决
自己在路径访问明细表开发时,写的sql如下 SELECT guid, sessionid, event['url'] as page, `timestamp` as ts, row_number() ...
- 解决 Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg'
解决 Error: could not open `C:\Program Files\Java\jre7\lib\i386\jvm.cfg' 重装JDK后,因为没有装在以前的目录,运行java命令后报 ...
- 解决N个人过桥时间最短问题(Java版本)
[问题描述] n个人要晚上过桥,在任何时候最多两个人一组过桥,每组要有一只手电筒.在这n个人中只有一个手电筒能用,因此要安排以某种往返的方式来返还手电筒,使更多的人可以过桥. 注意:每个人的过桥速 ...
- 解决mac os x下 tomcat启动报 java.net.BindException: Permission denied <null>:80 错误
我在mac os x上启动tomcat的时候,报 java.net.BindException: Permission denied <null>:80,java.net.BindExce ...
- 解决String TestContext下使用junit4抛出异常(java.lang.NoClassDefFoundError)的问题
Spring版本2.5.5,JUnit 版本 4.8.1,使用了 Spring TestContext 的 SpringJUnit4ClassRunner.一直使用这个版本的JUnit,在写简单的测试 ...
- Cloud9:解决ThinkPHP在C9上运行时连接数据库时报错"No such file or directory"的问题
昨天尝试在c9上部署了一个ThinkPHP用于开发,但是当试图连接数据库时却出现了这样的问题.经过查找资料发现此问题是由于没有找到mysql.sock这个文件造成的(这个东西估计是mysql的连接线程 ...
- 解决Junit单元测试 找不到类 ----指定Java Build Path
做junit 单元测试时,发现怎么执行都是以前编译过得代码. 最后找到原因了, src/test/java 编译完的.class路径是 Default output folder Default ou ...
- 异常-----springmvc + ajaxfileupload解决ajax不能异步上传图片的问题。java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade cannot be cast to org.springframework.web.multipart.
说明这个问题产生的原因主要是form表单上传图片的时候必须是Content-Type:"multipart/form-data,这种格式的,但是ajax在页面不刷新的情况下去加载的时候只会把 ...
- android开发解决Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'. > java.lang.RuntimeException: java.lang.RuntimeException: c.....
网上常见的方法我都试过,都没能解决,偶然看到的一个方法解决了,在这了记录一下. 在App目录下的build.gradle的android{ ... ....}中添加如下代码,即可解决.(xx.xx. ...
随机推荐
- bzo j4825 [Hnoi2017]单旋
Description H 国是一个热爱写代码的国家,那里的人们很小去学校学习写各种各样的数据结构.伸展树(splay)是一种数据 结构,因为代码好写,功能多,效率高,掌握这种数据结构成为了 H 国的 ...
- bzoj2783 树
第一行是两个整数N和S,其中N是树的节点数. 第二行是N个正整数,第i个整数表示节点i的正整数. 接下来的N-1行每行是2个整数x和y,表示y是x的儿子. 输出格式: 输出路径节点总和为S的路径数量. ...
- JS中的this机制
1.this是啥? 简言之,this是JavaScript语言中定义的众多关键字之一,它的特殊在于它自动定义于每一个函数域内,但是this倒地指引啥东西却让很多人张二摸不着头脑.这里我们留个小悬念,希 ...
- VueRouter
使用VueRouter的前提: 1, 必须导入vue-router.js文件 2, 要有VueRouter()实例 3, 要把VueRouter实例挂载到Vue实例中 4, 路由的入口 ...
- 禅道 bug指向为数字问题解决过程
browse.html.php <td <?php if($bug->assignedTo == $this->app->user->account) echo ' ...
- http://www.5xcg.com/bbs/forum.php?mod=viewthread&tid=51143&extra=page%3D1
http://www.5xcg.com/bbs/forum.php?mod=viewthread&tid=51143&extra=page%3D1 因为身在酒店设备有限,只能尽量把文字 ...
- LUA全总结
------------------------------------------------------------------------------ --2018.7.21 do --开启或关 ...
- Graphics.Blit
[Graphics.Blit] 需求注意第4个参数,用4个参数pass用于指定使用哪一个pass.默认值为-1,即使用所有的pass. 参考:file:///C:/Program%20Files%20 ...
- linux 查看文件夹文件大小数目等信息
1. 查看当前目录所有文件和文件夹的大小 方法一: $du -sh * 或 $du -h -d 0 * '-d 0' 代表查询目录的深度为0 ,也就是当前目录,'-d 3' 表示文件目录深度为3,可以 ...
- 根据车辆品牌获取品牌所属公司,车标logo,创建年份等基本信息
接口:http://api.besttool.cn/?c=Car&a=brand 请求方式:post 参数: appid 请联系博主QQ987332767获取,注明车标接口,测试appid: ...