JNDI 做数据源 spring管理hibernate 的Junit 测试
0
请问 我这个要怎么做测试啊,总是报错..
Error creating bean with name 'datasource' defined in class path resource [bean-pub.xml]:
bean-pub.xml 为:
<!--JNDI 配置DataSource -->
<bean id="datasource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/crm</value>
</property>
</bean>
<!--定义 SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="datasource"/>
Error creating bean with name 'datasource' defined in class path resource [bean-pub.xml]:
bean-pub.xml 为:
<!--JNDI 配置DataSource -->
<bean id="datasource"
class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/crm</value>
</property>
</bean>
<!--定义 SessionFactory -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="datasource"/>