Java web编程错误,Spring加hibernate框架错误,求指点
我用Spring2+hibernate3,还有这是王者归来那本书的代码,求指点还有应该导入哪些Spring和hibernate的jar包啊,我上网查好像有些jar包需要删...
我用Spring2+hibernate3,还有这是王者归来那本书的代码,求指点
还有应该导入哪些Spring和hibernate的jar包啊,我上网查好像有些jar包需要删除
Error creating bean with name 'catDao' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.
BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is
org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect.MYSQLDialect
<bean id="dataSource" 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/spring"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
destroy-method="destroy">
<property name="dataSource" ref="dataSource"></property>
<property name="annotatedClasses">
<list>
<value>orm.Cat</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MYSQLDialect</prop>
<prop key="hibernate.hbm2dll.auto"> create </prop>
</props>
</property>
</bean>
<bean id="catDao" class="orm.CatDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean> 展开
还有应该导入哪些Spring和hibernate的jar包啊,我上网查好像有些jar包需要删除
Error creating bean with name 'catDao' defined in class path resource [applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.
BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is
org.hibernate.HibernateException: Dialect class not found: org.hibernate.dialect.MYSQLDialect
<bean id="dataSource" 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/spring"/>
<property name="username" value="root"/>
<property name="password" value="123456"/>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
destroy-method="destroy">
<property name="dataSource" ref="dataSource"></property>
<property name="annotatedClasses">
<list>
<value>orm.Cat</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MYSQLDialect</prop>
<prop key="hibernate.hbm2dll.auto"> create </prop>
</props>
</property>
</bean>
<bean id="catDao" class="orm.CatDaoImpl">
<property name="sessionFactory" ref="sessionFactory"/>
</bean> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询