dubbo-admin使用过程中报错URIType的问题

在使用dubbo的过程中,很多刚开始搭建的同学都希望很直观的看到自己编写的服务提供者和消费者信息,从而使用dubbo提供的服务监控平台——dubbo-admin。但是事实上,提供的源码在编译过程和部署是经常会遇到一些小问题。比如上面提到的,部分报错信息如下所示:

Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]: Bean property 'URIType' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:801)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)

根据github上网友大大们给出的答案,试过后确实有效。这其中主要是dubbo开源的时候,各组件版本都已经差距比较大。具体解决过程如下:

1、webx的依赖改为3.1.6版;

    <dependency>
        <groupId>com.alibaba.citrus</groupId>
        <artifactId>citrus-webx-all</artifactId>
        <version>3.1.6</version>
    </dependency>

2、添加velocity的依赖,我用了1.7;

    <dependency>
        <groupId>org.apache.velocity</groupId>
        <artifactId>velocity</artifactId>
        <version>1.7</version>
    </dependency>

3、对依赖项dubbo添加exclusion,避免引入旧spring

    <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>dubbo</artifactId>
        <version>${project.parent.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

 然后,可以去打包了。在checkout出来的dubbo目录执行

mvn install -Dmaven.test.skip=true

来尝试编译一下。

然后执行mvn package -Dmaven.test.skip,把dubbo-admin打成war。如果遇到报错,需要逐步检查解决。

然后,启动zookeeper,把打好的war扔到Tomcat根目录,启动。

启动完成后,浏览器就可以访问了,要仔细核对打包的名称。正常会出现输入用户名和密码的弹框。

输入root/root即可进入管理界面。具体如图:

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值