我有一个web应用程序,通常在weblogic 9.2中正常运行,但在将weblogic 9.2迁移到10.3.6时面临以下问题。
Aug 27, 2014 7:35:07 PM org.hibernate.impl.SessionFactoryImpl <init>
SEVERE: Error in named query: getOutstandingDetailsByAgreementBetweenDatesFromRCMDate
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [SELECT model FROM com.crisil.ratings.sfb.batch.engine.model.SfbAgreementOutstandDetsVw model WHERE model.agreementId = :agreementId AND model.rcmDate BETWEEN TO_DATE (:rcmDate1, 'dd-mm-yyyy') AND TO_DATE (:rcmDate2, 'dd-mm-yyyy')]
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
at antlr.CharScanner.<init>(CharScanner.java:51)
at antlr.CharScanner.<init>(CharScanner.java:60)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:56)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:53)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:50)
at org.hibernate.hql.ast.HqlLexer.<init>(HqlLexer.java:26)
at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:242)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
at org.hibernate.impl.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:402)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:352)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:730)
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:127)
at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:393)
at weblogic.deployment.BasePersistenceUnitInfoImpl.initializeEntityManagerFactory(BasePersistenceUnitInfoImpl.java:386)
at weblogic.deployment.BasePersistenceUnitInfoImpl.<init>(BasePersistenceUnitInfoImpl.java:158)
at weblogic.deployment.PersistenceUnitInfoImpl.<init>(PersistenceUnitInfoImpl.java:39)
at weblogic.deployment.AbstractPersistenceUnitRegistry.storeDescriptors(AbstractPersistenceUnitRegistry.java:349)
at weblogic.deployment.AbstractPersistenceUnitRegistry.loadPersistenceDescriptors(AbstractPersistenceUnitRegistry.java:124)
at weblogic.deployment.ModulePersistenceUnitRegistry.<init>(ModulePersistenceUnitRegistry.java:58)
at weblogic.servlet.internal.WebAppModule.setupPersistenceUnitRegistry(WebAppModule.java:1827)
at weblogic.servlet.internal.WebAppServletContext.initClassLoader(WebAppServletContext.java:3029)
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:448)
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:494)
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:418)
at weblogic.servlet.internal.WebAppModule.registerWebApp(WebAppModule.java:976)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:384)
at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:648)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
at weblogic.application.internal.BaseDeployment.prepare(BaseDeployment.java:191)
at weblogic.application.internal.EarDeployment.prepare(EarDeployment.java:59)
at weblogic.application.internal.DeploymentStateChecker.prepare(DeploymentStateChecker.java:154)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.prepare(AppContainerInvoker.java:60)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.createAndPrepareContainer(ActivateOperation.java:208)
at weblogic.deploy.internal.targetserver.operations.ActivateOperation.doPrepare(ActivateOperation.java:98)
at weblogic.deploy.internal.targetserver.operations.AbstractOperation.prepare(AbstractOperation.java:217)
at weblogic.deploy.internal.targetserver.DeploymentManager.handleDeploymentPrepare(DeploymentManager.java:747)
at weblogic.deploy.internal.targetserver.DeploymentManager.prepareDeploymentList(DeploymentManager.java:1216)
at weblogic.deploy.internal.targetserver.DeploymentManager.handlePrepare(DeploymentManager.java:250)
at weblogic.deploy.internal.targetserver.DeploymentServiceDispatcher.prepare(DeploymentServiceDispatcher.java:159)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.doPrepareCallback(DeploymentReceiverCallbackDeliverer.java:171)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer.access$000(DeploymentReceiverCallbackDeliverer.java:13)
at weblogic.deploy.service.internal.targetserver.DeploymentReceiverCallbackDeliverer$1.run(DeploymentReceiverCallbackDeliverer.java:46)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Aug 27, 2014 7:35:07 PM org.hibernate.impl.SessionFactoryImpl <init>
解决此问题的最佳方法是什么?
我正在使用Hibernate3,JPA 1.0,Struts 2.0和WebLogic 10.3.6
我尝试了一些解决方案但不适合我。
答案 0 :(得分:0)
我不认为Exception与WebLogic Server迁移有任何关系。每当您尝试获取Hibernate会话时,它都会加载所有映射文件和命名查询。
当Hibernate尝试初始化其SessionFactory
并且映射文件(.hbm.xml)或带注释的类文件中的命名查询语法错误时,您会收到错误。
命名查询 getOutstandingDetailsByAgreementBetweenDatesFromRCMDate 不正确。只是尝试修复它,或者如果没有任何效果,请将其注释掉。命名查询错误,例如 命名查询中的错误 或 DuplicateNamedQuery 非常常见,并且不会让您的Hibernate会话初始化即使你没有使用它们。