`
youjianbo_han_87
  • 浏览: 18275 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Spring整合Hiberante在weblogic报错

    博客分类:
  • java
阅读更多
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>
分享到:
评论
2 楼 youjianbo_han_87 2009-05-20  
问题解决
在weblogic启动命令里面
事先设定antrl.jar的顺序
@ECHO OFF

@REM WARNING: This file is created by the Configuration Wizard.
@REM Any changes to this script may be lost when adding extensions to this configuration.

SETLOCAL

set JAVA_OPTIONS=-Dfile.encoding=UTF-8

set DOMAIN_HOME=E:\bea\user_projects\domains\competency

set EXT_PRE_CLASSPATH=%DOMAIN_HOME%\lib\antlr-2.7.6rc1.jar

call "%DOMAIN_HOME%\bin\startWebLogic.cmd" %*

ENDLOCAL
1 楼 youjianbo_han_87 2009-05-20  
在Hibernate配置文件里面增加
<property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>

也没用效果

相关推荐

Global site tag (gtag.js) - Google Analytics