Session factory setup doesn't work
I am evaluating an upgrade of my Spring/Hibernate application from 2.5.6/3.3.2 to 3.2/4.1.9 respectively and have found my database connection no longer works.
The datasource definition seems to be ignored as I now get this error:
UnsupportedOperationException: Not supported by BasicDataSource
I'm using commons-dbcp-1.4 and the error indicates it's looking for username/password.
If I remove the datasource property and put the datasource properties into the hibernate property, it works fine. unfortunately, I need to encrypt these values via Jasypt and that no longer works either.
Code:
<beans>
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/training1"/>
<property name="username" value="user1"/>
<property name="password" value="password1"/>
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"/>
<property name="mappingResources">
<list>
<value>product.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.MySQLInnoDBDialect
</prop>
</props>
</property>
</bean>
</beans>
Anyone else have this problem or am I missing some additional parameters?
Thank in advance,
Steven.