严重: Servlet threw load() exception
java.lang.NumberFormatException: For input string: "${dubbo.port}"
扫描配置
<?xml version="1.0" encoding="UTF-8"?>
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
之前是dao层的配置文件报错"${jdbc.url}" 无法解析,搜了资料在扫描配置文件上加了*ignore-unresolvable="true",然后就报错数字转换异常了,百度查了下,有这样的问题,但是都没解决,在dubbo配置文件加上host解决不了
这种报错正常是没在配置文件中找到这个名为dubbo.port的值,你要看下dubbo配置文件有没有被加载进去,也就是你的spring配置文件有没有引入这个dubbo配置文件
请添加相应的头文件,下面是我自己的你看下。
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
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
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd">
<!-- 读取配置文件 -->
<util:properties id="app" location="classpath:app.properties"/>