JdbcHttpSessionConfiguration混淆了我的Bean Constants

时间:2017-05-25 14:59:35

标签: java spring httpsession

我正在使用spring MVC 4.2我的app-context.xml中有这个代码

<bean id="beanConstants" name="beanConstants" class="com.my.web.controller.BeanConstants">
    <property name="dbProplocation" value="/my/database.properties" />
    <property name="extractDbProplocation" value="/my/extract.database.properties" />
    <property name="cssLocation" value="uncompiled" />
    <property name="enableSuspensionPollingStr" value="false" />
</bean>

<!--  JDBC Session Config -->
<bean class="org.springframework.session.jdbc.config.annotation.web.http.JdbcHttpSessionConfiguration"/>

<bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    <property name="driverClassName" value="com.mysql.jdbc.Driver" />
    <property name="url" value="${hibernate.connection.url}" />
    <property name="username" value="${hibernate.connection.username}" />
    <property name="password" value="${hibernate.connection.password}" />
</bean>

现在这一切都运行正常,直到我添加了JdbcHttpSessionConfiguration bean。如果我把这条线拿出来,那就行了。否则我明白了:

Caused by: java.lang.IllegalArgumentException: 
Could not resolve placeholder 'hibernate.connection.url' in string value "${hibernate.connection.url}"

我正在尝试在DB中保存sesstion信息。这是为什么这样做的?与另一个人有什么关系?

0 个答案:

没有答案