SQLSyntaxErrorException: ORA-02201: sequence not allowed here

173
17 мая 2019, 22:50

При попытке вытащить данные вылетает ошибка (местами обрезал ибо ограничение):

2018-11-29 14:36:47,127 [STDOUT][] INFO - 14:36:47,127 WARN  [JDBCExceptionReporter] SQL Error: 2201, SQLState: 42000
2018-11-29 14:36:47,128 [STDOUT][] INFO - 14:36:47,128 ERROR [JDBCExceptionReporter] ORA-02201: sequence not allowed here
2018-11-29 14:36:47,129 [STDOUT][] INFO - 14:36:47,128 INFO  [DefaultLoadEventListener] Error performing load command
org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
        at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager.doSearch(SsrRiverManager.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager_$$_javassist_seam_10.doSearch(SsrRiverManager_$$_javassist_seam_10.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at org.apache.catalina.core.StandardWrapperValve.invoke(
2018-11-29 14:36:47,129 [STDOUT][] INFO - StandardWrapperValve.java:230)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.sql.SQLSyntaxErrorException: ORA-02201: sequence not allowed here
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
        ... 109 more
2018-11-29 14:36:47,131 [javax.enterprise.resource.webcontainer.jsf.application][] FATAL - javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager.doSearch(SsrRiverManager.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager_$$_javassist_seam_10.doSearch(SsrRiverManager_$$_javassist_seam_10.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
        ... 51 more
Caused by: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
        ... 84 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-02201: sequence not allowed here
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
        ... 109 more
2018-11-29 14:36:47,132 [javax.enterprise.resource.webcontainer.jsf.lifecycle][] WARN - #{ssrRiverManager.doSearch}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
javax.faces.FacesException: #{ssrRiverManager.doSearch}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
        at javax.faces.component.UICommand.broadcast(UICommand.java:383)
        at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
        ... 50 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager.doSearch(SsrRiverManager.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
        ... 51 more
Caused by: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
        ... 84 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-02201: sequence not allowed here
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
        ... 109 more
2018-11-29 14:36:47,132 [javax.enterprise.resource.webcontainer.jsf.lifecycle][] WARN - executePhase(INVOKE_APPLICATION 5,com.sun.faces.context.FacesContextImpl@10401922) threw exception
javax.faces.FacesException: #{ssrRiverManager.doSearch}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:105)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.FacesException: #{ssrRiverManager.doSearch}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
        at javax.faces.component.UICommand.broadcast(UICommand.java:383)
        at org.ajax4jsf.component.AjaxActionComponent.broadcast(AjaxActionComponent.java:55)
        at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)
        at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
        ... 43 more
Caused by: javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
        ... 50 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager.doSearch(SsrRiverManager.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager_$$_javassist_seam_10.doSearch(SsrRiverManager_$$_javassist_seam_10.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
        ... 51 more
Caused by: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
        ... 84 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-02201: sequence not allowed here
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        at org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
        ... 109 more
2018-11-29 14:36:47,136 [STDOUT][] INFO - 14:36:47,136 ERROR [Exceptions] handled and logged exception
javax.servlet.ServletException: #{ssrRiverManager.doSearch}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
        at java.lang.Thread.run(Thread.java:745)
Caused by: javax.faces.FacesException: #{ssrRiverManager.doSearch}: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:107)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
        ... 40 more
Caused by: javax.faces.el.EvaluationException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
        at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:91)
        ... 50 more
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:76)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager.doSearch(SsrRiverManager.java:125)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
        at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
        at kz.ktk.epz.shipRegisterManager.SsrRiverManager_$$_javassist_seam_10.doSearch(SsrRiverManager_$$_javassist_seam_10.java)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodE
2018-11-29 14:36:47,136 [STDOUT][] INFO - xpression.java:68)
        at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:77)
        ... 51 more
Caused by: org.hibernate.exception.SQLGrammarException: could not load an entity: [kz.ktk.epzDS.entity.shipGeneral.ShipGeneralOwner#9]
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:90)
        at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
        ... 84 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-02201: sequence not allowed here
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:450)
        ... 109 more

Сам запрос такой:

        Query query = em.createQuery("from ShipGeneralTicket t where 1 = 1" +
            " and (:regNumber = '' or :regNumber is null or t.shipRegNumber = :regNumber)" +
            " and (:ticketNumber= '' or :ticketNumber is null or t.shipTicketNumber = :ticketNumber)" +
            " and (:ownerName = '' or :ownerName is null or UPPER(t.shipGeneralOwner.nameRu) like :ownerName or UPPER(t.shipGeneralOwner.nameKz) like :ownerName)" +
            " and (:bin = '' or :bin is null or t.shipGeneralOwner.bin = :bin)" +
            " and (:registerId = t.registerType.id)" +
            " and ( " +
            "    (:dc = 1 and TRUNC(t.ticketDate) = :ticketDate1)" +
            " or (:dc = 2 and TRUNC(t.ticketDate) >= :ticketDate1)" +
            " or (:dc = 3 and TRUNC(t.ticketDate) <= :ticketDate2)" +
            " or (:dc = 4 and (TRUNC(t.ticketDate) between :ticketDate1 and :ticketDate2))" +
            " or (:dc = 0))" +
            " order by t.id desc")
            .setParameter("regNumber", criteria.getRegNumber())
            .setParameter("registerId", 2L) //id реестра морских судов
            .setParameter("ticketNumber", criteria.getTicketNumber())
            .setParameter("bin", criteria.getBin())
            .setParameter("ownerName", QueryUtils.valueForLike(criteria.getOwnerName()))
            .setParameter("dc", dateCondition)
            .setParameter("ticketDate1", criteria.getDate1())
            .setParameter("ticketDate2", criteria.getDate2());
    QueryUtils.limitQuery(query, criteria);
    foundShipTicketList = query.getResultList();

Саму ошибку выбивает при попытке вызвать query.getResultList(). Однако странно то, что все отлично работает при запуске приложения на локальном сервере на ноуте под виндой с БД на VM Ware Oracle, и никаких ошибок в лог не дает. Ошибка же вылетает на сервере под Linux

READ ALSO
Как не наследовать св-во transform?

Как не наследовать св-во transform?

Коллеги, подскажитеОбхожу li и ставлю активный класс с увеличение scale 1

142
Как проверить innertext или text(jquery) на null

Как проверить innertext или text(jquery) на null

Есть задача добавляять в список дел , через promptНо я не могу выйти нормально из цикла тк innertext or text от propmt при cancel (null) возвращает значение пустой...

160
Работа setTimeout в фоновом режиме?

Работа setTimeout в фоновом режиме?

Я новичок, и задался проблемой написать таймер pomodoro с помощью jsРеализовал это с помощью setTimeout

122