当前位置:   article > 正文

启动dubbo时报错: For input string: "0:0:xxxx:20880"_dubbo for input string: "0:0:0:0:0:0:1:20880

dubbo for input string: "0:0:0:0:0:0:1:20880
报错信息如下:
Exception in thread "main" java.lang.NumberFormatException: For input string: "0:0:0:2ce0:1f1:6d77:56fd%15:20880"
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"?>  
<beans xmlns="http://www.springframework.org/schema/beans"  
       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 或 6-monitor 会显示这个名字,方便辨识-->  
    <dubbo:application name="demotest-provider" owner="programmer" organization="dubbox"/>  
    <!--使用 zookeeper 注册中心暴露服务,注意要先开启 zookeeper-->  
    <dubbo:registry address="zookeeper://127.0.0.1:2181"/>  
    <!-- 用dubbo协议在20880端口暴露服务 -->  
    <dubbo:protocol  name="dubbo" port="20887" />  
    <!--使用 dubbo 协议实现定义好的 api.PermissionService 接口-->  
    <dubbo:service interface="com.zxfc.dubbo.demo.service.DemoService" ref="demoService" protocol="dubbo" />  
    <!--具体实现该接口的 bean-->  
    <bean id="demoService" class="com.zxfc.dubbo.demo.service.impl.DemoServiceImpl"/>  
</beans> 


解决方法:经过几天的努力问题解决了,解决方法很简单,在  <dubbo:protocol  name="dubbo" port="20887" />中增加host="192.168.0.10 5"服务器地址就行了, 在公司的服务器上没有加这个也没有报错,所以具体原因有待深入研究dubbo后再详细解答

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/165998
推荐阅读
相关标签
  

闽ICP备14008679号