报错信息如下:
Exception in thread "main" java.lang.NumberFormatException: For input string: "0:0:0:2ce0:1f1:6d77:56fd%15:20887"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.alibaba.dubbo.common.URL.valueOf(URL.java:239)
at com.alibaba.dubbo.config.ServiceConfig.exportLocal(ServiceConfig.java:503)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:465)
at com.alibaba.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:281)
at com.alibaba.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:242)
at com.alibaba.dubbo.config.ServiceConfig.export(ServiceConfig.java:143)
at com.alibaba.dubbo.config.spring.ServiceBean.onApplicationEvent(ServiceBean.java:109)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:163)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:136)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:381)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:335)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:855)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:541)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at com.zxfc.dubbo.demo.service.impl.Provider.main(Provider.java:9)
Spring配置文件applicationContext-service.xml内容如下:
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://code.alibabatech.com/schema/dubbo
http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
<!--定义了提供方应用信息,用于计算依赖关系;在 dubbo-admin 或 dubbo-monitor 会显示这个名字,方便辨识-->
<!--使用 zookeeper 注册中心暴露服务,注意要先开启 zookeeper-->
<!-- 用dubbo协议在20880端口暴露服务 -->
<!--使用 dubbo 协议实现定义好的 api.PermissionService 接口-->
<!--具体实现该接口的 bean-->
这个问题困扰了我好长时间了,由于这个问题导致我如法向下继续学习dubbo,希望dubbo大牛能帮忙看看,感激不尽。。。。。
"0:0:0:2ce0:1f1:6d77:56fd%15:20887"
这个格式无效,请你确认下它是否支持ipv6以及多个ip等情况,建议你用xxx.xxx.xxx.xxx:xxxx这种 ipv4:端口 的形式。
谢谢大家的支持,经过几天的努力问题解决了,解决方法很简单,在 增加host="192.168.0.10 5"服务器地址就行了, 在公司的服务器上没有加这个也没有报错,所以具体原因有待深入研究dubbo后再详细解答。
这个是找不到你的注册地址的问题,或者你注册地址有问题,或者格式不对导致的