欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Spring整合Hiberante在weblogic报错

程序员文章站 2022-06-08 07:57:55
...
org.springframework.orm.hibernate3.HibernateQueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from tw.com.synnex.competency.model.Duration where mtype = ? and ? between sdate and edate]; nested exception is org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from tw.com.synnex.competency.model.Duration where mtype = ? and ? between sdate and edate]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:640)
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:377)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:840)
at tw.com.synnex.competency.dao.hibernate.DurationDAOHibernate.between(DurationDAOHibernate.java:30)
Truncated. see log file for complete stacktrace

这个问题如何解决呢,我没有在spring整合hibernate的xml里面配置hibernate,我是Hibernate单独有配置文件,然后在spring配置文件里面引用
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value= "classpath:config/hibernate.cfg.xml" />
</bean>

Hibernate中这样配置
<property name="show_sql">false</property>
     <!--
        <property name="hbm2ddl.auto">update</property>
    -->
        <property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.cache.use_query_cache">true</property>