spring+hibernate配置异常
主要是在hibernate的配置文件中配置了数据源,建议在spring里面配置
dataSource异常:
java.lang.UnsupportedOperationException: Not supported by BasicDataSource
解决方案:
删除hibernate里数据源的配置信息,在spring里面添加如下
<bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="hibernateProperties" value="hibernate.dialect=org.hibernate.dialect.MySQLDialect"></property>
<property name="configLocation">
<value>classpath:hibernate/hibernate.cfg.xml</value>
</property>
</bean>