Error creating bean with name 'sessionFactory' defined
更多是因为jar包冲突所致,asm-util-2.2.3,asm-2.2.3,asm-commons-2.2.3 这三个保留第二个。
另外,关于用eclipse自动添加spring支持,生成的applicationContext.xml文件里定义的内容:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>
应该改为:
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configLocation"
value="classpath:hibernate.cfg.xml">
</property>
</bean>