【发布时间】:2012-01-11 15:22:22
【问题描述】:
我正在使用 static main 方法创建我的 Spring 上下文
return new ClassPathXmlApplicationContext("applicationContext.xml");
在applicationContext.xml 内部,我正在用我的一个豆子接线
<bean id="dataSource"
class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
<property name="driverClassName">
<value>${db.driverclassname}</value>
</property>
...
</bean>
我的类路径中有一个 .properties 文件,其中包含值 db.driverclassname。
不幸的是,我收到以下错误:
Property 'driverClassName' threw exception;
nested exception is java.lang.IllegalStateException:
Could not load JDBC driver class [${db.driverclassname}]
我做错了什么?我正在使用 Spring 2.5.5
【问题讨论】:
标签: java spring properties javabeans