These are chat archives for alibaba/dubbo

9th
Jan 2018
vwyuheng
@vwyuheng
Jan 09 2018 02:13
dubbo3.0 什么时候提交代码
ken.lj
@chickenlj
Jan 09 2018 02:21
@konglz Currently, we are still working on dubbo-spring-boot-starter, non-official boot-starter in community may not work properly with the new annotation version of dubbo.
aspiringwei
@aspiringwei
Jan 09 2018 02:26
@chickenlj dubbo 2.6.0的rest 端口如何与boot的端口复用啊
image.png
ken.lj
@chickenlj
Jan 09 2018 02:27
@aspiringwei What do you mean by boot's port
aspiringwei
@aspiringwei
Jan 09 2018 02:27
image.png
ken.lj
@chickenlj
Jan 09 2018 02:27
use server="servlet"
aspiringwei
@aspiringwei
Jan 09 2018 02:27
我希望用server.port来指定rest的端口
ken.lj
@chickenlj
Jan 09 2018 02:28
And config com.alibaba.dubbo.remoting.http.servle.DispatcherServlet
aspiringwei
@aspiringwei
Jan 09 2018 02:28
ok, i try it
ken.lj
@chickenlj
Jan 09 2018 02:29

我想试下他的基于注解的形式,
registryConfig.setProtocol("rest"); 貌似行不通

Do you have some problem with annotation?

@aspiringwei Do you have some problem with annotation?
aspiringwei
@aspiringwei
Jan 09 2018 02:31
i use RegistryConfig try to set protocol,when running is wrong, must use node ProtocolConfig,now ,it works.
@chickenlj how to config DispatcherServlet using annotation
ken.lj
@chickenlj
Jan 09 2018 02:33
Just follow the standard servlet configuration
aspiringwei
@aspiringwei
Jan 09 2018 03:41
image.png
@chickenlj protocolConfig.setServer("servlet");
aspiringwei
@aspiringwei
Jan 09 2018 03:47
还需要config配置这个有点麻烦
konglz
@konglz
Jan 09 2018 07:40
有没有人愿意和我一起看看starter啊,我写了一个,在alibaba原版的基础上调了一点东西:
  1. 原版只能通过配置文件配7个属性,我改成可以配全部属性,并增加了spring boot描述文件;
2.原版provider侧注解只能控制到类级别,控制不到方法级,我改为可以控制到方法级
3.原版没有monitor,我配了monitor
slbty
@slbty
Jan 09 2018 07:43
you are awesome
konglz
@konglz
Jan 09 2018 07:45
并且,增加了restful的pom依赖和一些相关的AutoConfig
zhangcong
@zhangcong001
Jan 09 2018 07:46
666666
konglz
@konglz
Jan 09 2018 07:47
master代码是原版的,klz_refactor_for_rest_0108 分支是我改之后的
Ian Luo
@beiwei30
Jan 09 2018 07:51
@konglz why not submit a pull request so that it can benefit all?
konglz
@konglz
Jan 09 2018 07:52
因为我觉得代码还不够好,希望热心的大牛帮忙看下,给点建议;我改得更好之后,会发pull request的
昨天仓促之间写得,没时间仔细改进……
Ian Luo
@beiwei30
Jan 09 2018 07:53
@konglz we could discuss on the pull request :smile: what do you think? u could enhance ur code as better as possible, before you ask more people to review
konglz
@konglz
Jan 09 2018 07:54
ok,3ks
linziguan
@linziguan
Jan 09 2018 07:59
star
luffyke
@luffyke
Jan 09 2018 08:29
@konglz 粗略看了下,几个建议:
.idea这种文件夹放到gitignore,再删掉。。
代码格式化跟原项目一致。。
做enhancement代码放到原来的包里面去,别另起包。。
springboot的版本最好跟dubbo的spring版本一致。。
定义常量类Constants,用final修饰类就行了。。
konglz
@konglz
Jan 09 2018 08:30
get
konglz
@konglz
Jan 09 2018 10:26
image.png
这个是什么情况啊?
Yu Chenglong
@evasnowind
Jan 09 2018 11:37
编译dubbo-admin,结果maven,这个大家有什么建议不?我是mac本,oracle jdk 1.8, maven 3.5.2
konglz
@konglz
Jan 09 2018 11:38
编译不过吗?
linziguan
@linziguan
Jan 09 2018 11:38
报什么错?
要加上忽略测试
Yu Chenglong
@evasnowind
Jan 09 2018 11:38
maven报错,稍等哈
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project dubbo-admin: Compilation failure -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project dubbo-admin: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
先执行这句mvn clean install -DskipTests 吗?
如果要忽视单元测试,是先执行mvn clean install -DskipTests,然后mvn package -Dmaven.skip.test=true ?
Yu Chenglong
@evasnowind
Jan 09 2018 11:44
编译就报错,目前试过的方法如下:1、pom.xml文件中添加新的一个叫做maven-compiler-plugin的plugin 2、pom.xml中的properties中添加
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
但这两个都不好使,仍然报错
看stackoverflow上有说用jdk 1.7编译
……
linziguan
@linziguan
Jan 09 2018 11:45
1.8就可以了。
mvn package -Dmaven.skip.test=true
直接这句呢?
Yu Chenglong
@evasnowind
Jan 09 2018 11:48
一样的报错啊
😳
linziguan
@linziguan
Jan 09 2018 11:48
是在dubbo-admin目 录下执行的吗?
mvn package -Dmaven.skip.test=true
Yu Chenglong
@evasnowind
Jan 09 2018 11:49
直接mvn package -Dmaven.skip.test=true 不行,然后我搜报错信息,然后有了上面加plugin 加properties的尝试
是啊
image.png
linziguan
@linziguan
Jan 09 2018 11:50
无解...
Yu Chenglong
@evasnowind
Jan 09 2018 11:50
image.png
我也是搜了半天,实在没招了啊,o(╯□╰)o
konglz
@konglz
Jan 09 2018 11:54
你开启maven的debug模式看看
那样会输出更详细的错误信息
另外,可以把报错信息重定向到一个txt文件里贴出来,那样就很完整;截图只能看到半截
Yu Chenglong
@evasnowind
Jan 09 2018 11:58
先谢过各位的关注哈
我也换台机器试试
Yu Chenglong
@evasnowind
Jan 09 2018 12:35
哦,不知是否有关系,还是说下:我编译时直接进入dubbo-admin进行操作,没有在dubbo顶层目录编译
Ian Luo
@beiwei30
Jan 09 2018 12:35
@evasnowind 可能就是这个原因
linziguan
@linziguan
Jan 09 2018 12:35
没关系的,我也是直接进入admin进行mvn
konglz
@konglz
Jan 09 2018 12:35
我也是直接进去的
Yu Chenglong
@evasnowind
Jan 09 2018 12:36
泪奔……
一脸懵逼中,o(╯□╰)o
Ian Luo
@beiwei30
Jan 09 2018 12:37
@evasnowind dubbo-admin module?
Yu Chenglong
@evasnowind
Jan 09 2018 12:37
对啊,dubbo-admin 编译过不去
Ian Luo
@beiwei30
Jan 09 2018 12:37
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ dubbo-admin ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ dubbo-admin ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 6 source files to /Users/bw/github/dubbo/dubbo-admin/target/test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ dubbo-admin ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-war-plugin:2.2:war (default-war) @ dubbo-admin ---
[INFO] Packaging webapp
[INFO] Assembling webapp [dubbo-admin] in [/Users/bw/github/dubbo/dubbo-admin/target/dubbo-admin-2.5.8]
[INFO] Processing war project
[INFO] Copying webapp resources [/Users/bw/github/dubbo/dubbo-admin/src/main/webapp]
[INFO] Webapp assembled in [1678 msecs]
[INFO] Building war: /Users/bw/github/dubbo/dubbo-admin/target/dubbo-admin-2.5.8.war
[INFO] WEB-INF/web.xml already added, skipping
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.216 s
[INFO] Finished at: 2018-01-09T20:37:38+08:00
[INFO] Final Memory: 16M/305M
[INFO] ------------------------------------------------------------------------
bw@kaku:~/github/dubbo/dubbo-admin (master)
@evasnowind try to wipe out the whole $HOME/.m2, and try again
Yu Chenglong
@evasnowind
Jan 09 2018 12:48
@beiwei30 thx a lot!!! it works!!!
after clean $HOME/.m2, build success!!!
Ian Luo
@beiwei30
Jan 09 2018 12:48
@evasnowind it looks some of apache plugin artifacts corrupted in your local repository :)
Yu Chenglong
@evasnowind
Jan 09 2018 12:48
image.png
o(╯□╰)o