org.hibernate.QueryException: , expected in SELECT [SELECT NEW com.coscon.cbs.domain.result.settlement.SettlementCommissionSumDetailResult (companys.companyNameCn as companyNameCn,commCntr.containerSizeType as containerSizeType, companyChargeCode.settlementChargeCodeDescription as settlementChargeCodeDescription, commCntr.commissionCurrencyCode as commissionCurrencyCode ,commCntr.commissionAmount as commissionAmount, COUNT(1) as containerNumbers,SUM(commCntr.commissionAmount) as commissionAmounts) FROM com.coscon.cbs.domain.model.settlement.SettlementHead settlementHead, com.coscon.cbs.domain.model.settlement.CommissionBill commBl, com.coscon.cbs.domain.model.settlement.SettlementAR settlementAR, com.coscon.cbs.domain.model.settlement.SettlementDocumentCommissionContainer commCntr, com.coscon.cbs.domain.model.master.Company companys, com.coscon.cbs.domain.model.master.CompanyChargeCode companyChargeCode WHERE commBl.billBasicUuid=:businessReferenceUuid AND commBl.companyCode =:companyCode AND commBl.commissionMode=:chargeCodeGroup AND commBl.commissionType=:chargeCode AND commBl.rateCurrencyCode=settlementAR.currencyCode AND commBl.actualFlag=:actualFlag AND settlementAR.settlementDocumentArItemUuid =:settlementDocumentArItemUuid AND settlementAR.currencyCode =:currencyCode AND settlementAR.settlementDocumentHeadUuid = settlementHead.settlementDocumentHeadUuid AND commBl.billBasicUuid = settlementHead.businessReferenceUuid AND commBl.companyCode =settlementHead.companyCode AND commBl.commissionMode=settlementAR.chargeCodeGroup AND commBl.commissionType=settlementAR.chargeCode AND commBl.companyCode = commCntr.companyCode AND commBl.commissionMode = commCntr.commissionMode AND commBl.agencyCode = commCntr.agencyCode AND commBl.billBasicUuid = commCntr.billBasicUuid AND companys.companyCode = commCntr.companyCode AND companyChargeCode.companyCode = commCntr.companyCode AND companyChargeCode.chargeCode = commCntr.commissionType GROUP BY ( companys.companyNameCn,commCntr.containerSizeType,companyChargeCode.settlementChargeCodeDescription, commCntr.commissionCurrencyCode,commCntr.commissionAmount)]
at org.hibernate.hql.classic.SelectParser.token(SelectParser.java:203)
at org.hibernate.hql.classic.ClauseParser.token(ClauseParser.java:109)
at org.hibernate.hql.classic.ClauseParser.end(ClauseParser.java:136)
出现这种情况跟你使用的hibernate的 版本的解析器有关..
还有就是跟你使用的方式有关.. 如.. 有 map 的方式 和 定制结果集的方式.. 进行的话,相对来说.map
的方式是最快的.. 但是有时候,我们的框架中定义死了. 如在weblogic中部署的问题
如,中文问题 等等.. 会将hibernate的解析器换成较低的版本
org.hibernate.QueryException:ClassNotFoundException:org.hibernate.hql.ast.HqlToken错误之解决办法
org.hibernate.QueryException: ClassNotFoundException:
org.hibernate.hql.ast.HqlToken
解决办法:
在Hibernate.hbm.xml中加入加入属性:
<property
name="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</property>
原因:
Hibernate3.0 采用新的基于ANTLR的HQL/SQL查询翻译器,在Hibernate的配置文件中,hibernate.query.factory_class属性用来选择查询翻译
器。
(1)选择Hibernate3.0的查询翻译器:
hibernate.query.factory_class=
org.hibernate.hql.ast.ASTQueryTranslatorFactory
(2)选择Hibernate2.1的查询翻译器
hibernate.query.factory_class=
org.hibernate.hql.classic.ClassicQueryTranslatorFactory
为了使用3.0的批量更新和删除功能,只能选择(1)否则不能解释批量更新的语句,当使用的时候出现了不支持条件输入中文的情况。选择(2
)可以支持输入中文,但没法解释批量更新语句了
在hibernate3中需要用到antlr,然而这个包在weblogic.jar中已经包含了antrl类库,就会产生一些类加载的错误,无法找到在war或者ear中
的hibernate3.jar。
出现这个错误之后,antlr会调用System.exit(),这样weblogic就会中止服务。
解决方法:
1.是在hibernate.properties文件中增加属性:hibernate.query.factory_class,属性的值是
org.hibernate.hql.classic.ClassicQueryTranslatorFactory,这样就可以解决问题了。
但是部分功能会有问题,譬如
但本系在批量删除和更新会有问题,本系统不采用
2.将antlr-2.7.5H3.jar到Weblogic的pre_Classpath :用WinRar或Winzip打开C:\bea\weblogic81\server\lib\weblogic.jar
删除里面的antlr
目录, 然后再antlr-2.7.5H3.jar放在weblogic.jar的同一目录(注:替换之后没做做过严格测试,尚不知是否有后遗症)
3. 1、拷贝Hibernate3里带的包antlr-2.7.5H3.jar到%WL_HOME%\server\lib下
2、修改% mydomain% \ startWebLogic.cmd :
在set CLASSPATH之前加上下面一句:
set PRE_CLASSPATH=%WL_HOME%\server\lib\antlr-2.7.5H3.jar;
在set CLASSPATH之后加上下面一句:
set CLASSPATH=%PRE_CLASSPATH%;%CLASSPATH%
一切OK!
分享到:
相关推荐
keil常见错误 main.c(35): warning: #128-D: ...initSpi.c(6): error: #268: declaration may not appear after executable statement in block main.c(31): warning: #223-D: function "initNvic" declared implicitly
NULL 博文链接:https://bnmnba.iteye.com/blog/2322332
1)....Fixed: Added workaround for codegen bug in Delphi 7 (possibly - other), bug manifests itself as wrong date-time in reports or integer overflows 2)....Fixed: Some MAPI DLLs may not be loaded ...
caffe_pb2文件,在出现TypeError: expected bytes, str found问题的时候可以考虑用来替换caffe_root/python/caffe/proto/caffe_pb2.py文件
Q: I am working with Oracle database 8.1.7 and I have written a JAVA code to update the table which contains one BLOB field . I am using updateBinaryStream method of resultset to update the BLOB field...
Neo4j Java Reference 3.0
magic-script是一款基于JVM的脚本语言,目前主要是为magic-api项目设计。magic-api,接口快速开发框架,通过Web页面配置,自动映射为...spider-flow,新一代爬虫平台,以图形化方式定义爬虫流程,不写代码即可完成爬虫
描述了oscahce在JAVA开发中的应用和配置说明
LSPosed-v1.8.6-6953-zygisk-release.zip
海思平台hi3559A 上, 通过PWM控制LED亮度的驱动源码。源码主要包括hi3559A的pwm控制部分, LED的控制和设置部分。同时还提供了一套测试的接口。
错误描述: 1、保存模型:model.save_weights(‘./model.h5’) 2、脚本重启 3、加载模型:model.load_weights(‘./model.h5’) 4、模型报错:ValueError: You are trying to load a weight file containing 12 ...
android 二进制xml 解析。AXMLPrinter2反编译的时候报错解决
.error: #18: 6.error: #18: expected a ")" 如果是出现在c文件中, 多半是因为少了一个")",或者错误行有编译器不识别的字符
The Delphi 2010 Handbook is expected to have about 300 pages covering exclusively new Delphi 2010 features. There is no introduction material or anything like that. The book is for developers who use...
解决AXMLPrinter2反编译的时候报错问题。 java.lang.ArrayIndexOutOfBoundsException: 128 at android.content.res.StringBlock.getShort(StringBlock.java:231) at android.content.res.StringBlock.getString...
Simple lib to find diffs between URI and represent it in pretty way. Quick start: Use maven: ru.lanwen.diff uri-differ-lib 1.3.0 Add some code: Get changes: UriDiff changes = UriDiffer.diff() ....
org.apache.hadoop.mapred.YarnChild: Error running child : java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.TaskAttemptContext, but class was expected at org.apache...
Nordic SDK16.0.0使用中遇到的问题,8.27.0 Pack问题,编译找不到nrf_erratas.h问题
OSError: no library called "cairo" was found no library called "libcairo-2" was found cannot load library 'libcairo.so.2': libcairo.so.2: cannot open shared object file: No such file or directory ...
One of '{MathWorksID, type}' is expected. 运行hosaver: Warning: Could not find an exact (case-sensitive) match for 'hosaver'. D:\Program Files\MATLAB\R2007b\toolbox\hosa_d\hosa\HOSAVER.M is a case-...