getHibernateTemplate.find () не работает после обновления с Hibernate 3 до Hibernate 4 - PullRequest
0 голосов
/ 17 января 2019

мы недавно обновили Springs с 2.5 до 4.1 и Hibernate 3 до Hibernate 4

getHibernateTemplate (). Find () выдает исключение

2019-01-16 15:53:07,678 INFO  [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] org.hibernate.hql.internal.QueryTranslatorFactoryInitiator: HHH000397: Using ASTQueryTranslatorFactory
Hibernate: select processing0_.DEPT_DVSN_CD as DEPT_DVSN_CD1_55_0_, payownacti1_.ACTION_SID as ACTION_SID1_33_1_, processing0_.DEPT_DVSN_DESC_TX as DEPT_DVSN_DESC_TX2_55_0_, processing0_.EFCTV_DT as EFCTV_DT3_55_0_, processing0_.XPRTN_DT as XPRTN_DT4_55_0_, processing0_.ACTION_ID as ACTION_ID5_55_0_, (select D.DEPT_DVSN_LONG_NM from Payown.DEPT_DVSN_AVT D where D.DEPT_DVSN_CD=processing0_.DEPT_DVSN_CD) as formula2_0_, (SELECT processing0_.COUNT (*)  FROM payown.paybl_error_vrn_dtl dtl, payown.paybl_error_vrn_st_log LOG WHERE dtl.paybl_error_vrn_dtl_sid = LOG.paybl_error_vrn_dtl_sid AND dtl.dept_dvsn_cd = processing0_.DEPT_DVSN_CD AND LOG.st_typ_cd != 'R') as formula3_0_, payownacti1_.ACTION_TYP_CD as ACTION_TYP_CD2_33_1_, payownacti1_.ACTION_PERFORMED_BY as ACTION_PERFORMED_B3_33_1_, payownacti1_.ACTION_PERFORMED_DATE as ACTION_PERFORMED_D4_33_1_, payownacti1_.PAYBL_SID as PAYBL_SID5_33_1_, payownacti1_.SVR_NM as SVR_NM6_33_1_, (select (E.EMP_FIRST_NAME || ' ' ||E.EMP_LAST_NAME) from Payown.Employee E where E.EMP_LOGIN_ID=upper(substr(payownacti1_.ACTION_PERFORMED_BY,1,instr(payownacti1_.ACTION_PERFORMED_BY,'/')-1))) as formula4_1_ from PAYOWN.PRCSNG_GRP_AVT processing0_ inner join PAYOWN.PAYOWN_ACTION_LOG payownacti1_ on processing0_.ACTION_ID=payownacti1_.ACTION_SID order by processing0_.DEPT_DVSN_CD
2019-01-16 15:53:07,828 WARN  [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] org.hibernate.engine.jdbc.spi.SqlExceptionHelper: SQL Error: 936, SQLState: 42000
2019-01-16 15:53:07,828 ERROR [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ORA-00936: missing expression


org.springframework.dao.InvalidDataAccessResourceUsageException: could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet
        at org.springframework.orm.hibernate4.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:146)
        at org.springframework.orm.hibernate4.HibernateTemplate.doExecute(HibernateTemplate.java:343)
        at org.springframework.orm.hibernate4.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:308)
        at org.springframework.orm.hibernate4.HibernateTemplate.find(HibernateTemplate.java:864)
        at ***.processingpayments.prcsnggrp.dao.impl.ProcessingGroupDaoImpl.findProcessingGroupsList(ProcessingGroupDaoImpl.java:26)
        at ***.bo.impl.ProcessingGroupBoImpl.findProcessingGroupsList(ProcessingGroupBoImpl.java:27)
        at ******.ProcessingGroupAction.view(ProcessingGroupAction.java:107)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
        at *******.util.SpectrumLookupDispatchAction.execute(SpectrumLookupDispatchAction.java:130)
        at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
        at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
        at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
        at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:301)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja

1 Ответ

0 голосов
/ 17 января 2019

Если вы внимательно посмотрите на журнал консоли, вы увидите следующие две строки:

2019-01-16 15:53:07,828 WARN  [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] org.hibernate.engine.jdbc.spi.SqlExceptionHelper: SQL Error: 936, SQLState: 42000
2019-01-16 15:53:07,828 ERROR [[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'] org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ORA-00936: missing expression

В конце каждой строки указывается, что в вашем синтаксисе sql отсутствуют выражения. Запустите sql в Navicat, вы можете получить сообщение об ошибке.

Между count(*) есть пробел, просто удалите его.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...