java吧 关注:1,226,264贴子:12,685,842
  • 2回复贴,共1

SSH框架整合出错,大神帮忙看看

只看楼主收藏回复



IP属地:福建1楼2015-10-14 00:02回复
    整理spring和hibernate,出现以下错误
    严重: Context initialization failed
    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: true
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:304)


    IP属地:福建2楼2015-10-14 00:06
    回复
      applicationContext.xml中的内容
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd">
      <context:property-placeholder location="classpath:db.properties"/>
      <bean class="com.mchange.v2.c3p0.ComboPooledDataSource" id="dataSource">
      <property value="${jdbc.user}" name="user" />
      <property value="${jdbc.password}" name="password" />
      <property value="${jdbc.driverClass}" name="driverClass" />
      <property value="${jdbc.jdbcUrl}" name="jdbcUrl" />
      <property value="${jdbc.initPoolSize}" name="initialPoolSize" />
      <property value="${jdbc.maxPoolSize}" name="maxPoolSize" />
      </bean>
      <!-- 配置 SessionFactory -->
      <bean class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"
      id="sessionFactory">
      <property name="dataSource" ref="dataSource" />
      <property value="classpath:hibernate.cfg.xml" name="configLocation" />
      <property value="classpath:com/ssh/entities/*.hbm.xml" name="mappingLocations" />
      </bean>
      </beans>


      IP属地:福建3楼2015-10-14 00:07
      回复