參考:
安裝Dubbo管理主控台
2.5.4-SNAPSHOT dubbo admin error
下載dubbo-admin-2.5.4.war
初次使用dubbo管理主控台,啟動tomcat後,訪問url報錯,查看tomcat開機記錄,發現以下錯誤:
ERROR context.ContextLoader - Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uriBrokerService': Cannot create inner bean '(inner bean)' of type [com.alibaba.citrus.service.uribroker.impl.URIBrokerServiceImpl$URIBrokerInfo] while setting bean property 'brokers' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#25': Cannot create inner bean 'server' of type [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'server': Error setting property values; nested exception is 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.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122) at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:287)
查看github相關的issue,有兩種解決辦法: 1. 更換jdk8
dubbo-admin-2.5.4不支援jdk8,最高支援到jdk1.7
此方法最為方便。 2. 升級用到的spring包
原先的war包中lib包的內容:
更改後的內容:
3.1.4的包可以自行下載,或者在本地repository中拷貝。 3. 小技巧
其他相關的搭建管理台的教程都說到一點,刪除tomcat目錄下webapps目錄下ROOT目錄中的全部內容,把此war包解壓出來的內容全部拷貝至空的ROOT目錄中去。因為管理台介面中有點按鈕是按照 / 的方式訪問,不那樣做的話對頁面友好有一定影響。