3 Replies Latest reply: Oct 6, 2008 3:20 PM by PaKo RSS

    Error in JPA Toplink

    403936
      Hi,

      I'm using JPA (toplink implementation). When I'm running following named query

      *@NamedQuery(name = "Class.search",*
      query =  "select c "
      + "from Clazz c, Subject sub, School sch "
      + "where sub = c.subject"
      + " and lower(c.name) like :name"
      + " and lower(sub.name) like :subject"
      + " and lower(sch.name) like :school"
      + " and sch = c.school "
      + "order by c.name"
      *)*

      inside the 11g container, an sqlexception happens. In the exception I can see that the query is translated into following

      SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
           bind => [%, %, %]

      As you can see, the prefix on the class table is class in the select part while it is t0 in the rest of the sql.

      If I run this query in my test outside the container (j2se), then it works fine. I'm using preview 4.

      What is the problem.

      BR

      Jakup
        • 1. Re: Error in JPA Toplink
          hofespet
          Hi,

          can you post the error exception please.

          Peter
          • 2. Re: Error in JPA Toplink
            403936
            Hi,

            Here is the exception (I have to cut the last part because it is exceding the maximum length):

            2008-10-06 11:28:48 com.evermind.server.ejb.logging.EJBMessages logException
            SEVERE: [TeachingService:public java.util.List fo.samteld.vitanet.services.TeachingServiceBean.searchClasses(java.lang.String,java.lang.String,java.lang.String)] exception occurred during method invocation: javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz); nested exception is: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
            javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz); nested exception is: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
            Local Exception Stack:
            Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
                 at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:304)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:613)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
                 at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
                 at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:117)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
                 at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2480)
                 at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2438)
                 at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
                 at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
                 at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)
                 at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
                 at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
                 at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:899)
                 at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2697)
                 at oracle.toplink.tools.profiler.DMSPerformanceProfiler.profileExecutionOfQuery(DMSPerformanceProfiler.java:693)
                 at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1072)
                 at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)
                 at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)
                 at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:377)
                 at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:488)
                 at fo.samteld.vitanet.services.TeachingServiceBean.searchClasses(TeachingServiceBean.java:112)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:27)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
                 at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:182)
                 at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:511)
                 at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:301)
                 at oracle.oc4j.security.JaasModeImpl$BasicExecutor.execute(JaasModeImpl.java:161)
                 at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58)
                 at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:104)
                 at TeachingService_LocalProxy_5ndopdi.searchClasses(Unknown Source)
                 at fo.samteld.vitanet.ui.backing.teaching.ClassSearchBean$CriteriaPane.search(ClassSearchBean.java:95)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
                 at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
                 at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
                 at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1213)
                 at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
                 at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:153)
                 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$GrabEvents.broadcastEvents(LifecycleImpl.java:1109)
                 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:283)
                 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
                 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:178)
                 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
                 at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilter(SharedLibraryFilter.java:135)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
                 at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:69)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
                 at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter.java:85)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
                 at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
                 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:583)
                 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:334)
                 at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:942)
                 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:843)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:658)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:626)
                 at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:417)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:163)
                 at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
                 at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:237)
                 at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:29)
                 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:877)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                 at java.lang.Thread.run(Thread.java:595)
            Caused by: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

                 at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:77)
                 at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:111)
                 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:472)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:422)
                 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1089)
                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:204)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:945)
                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1303)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3556)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3608)
                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1341)
                 at oracle_jdbc_driver_OraclePreparedStatementWrapper_Proxy.executeQuery(Unknown Source)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:813)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:539)
                 ... 99 more
            javax.ejb.EJBException: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz); nested exception is: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
                 at com.evermind.server.ejb.EJBUtils.getLocalUserException(EJBUtils.java:96)
                 at com.evermind.server.ejb.interceptor.system.AbstractTxInterceptor.convertAndHandleMethodException(AbstractTxInterceptor.java:93)
                 at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:52)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.JAASInterceptor$1.run(JAASInterceptor.java:52)
                 at java.security.AccessController.doPrivileged(Native Method)
                 at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
                 at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:182)
                 at oracle.oc4j.security.SecurityServices.doAsPrivileged(SecurityServices.java:511)
                 at oracle.oc4j.security.JaasModeImpl$DoAsPrivilegedExecutor.execute(JaasModeImpl.java:301)
                 at oracle.oc4j.security.JaasModeImpl$BasicExecutor.execute(JaasModeImpl.java:161)
                 at com.evermind.server.ejb.interceptor.system.JAASInterceptor.invoke(JAASInterceptor.java:57)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.InvocationContextPool.invoke(InvocationContextPool.java:58)
                 at com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(StatelessSessionEJBObject.java:104)
                 at TeachingService_LocalProxy_5ndopdi.searchClasses(Unknown Source)
                 at fo.samteld.vitanet.ui.backing.teaching.ClassSearchBean$CriteriaPane.search(ClassSearchBean.java:95)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at com.sun.el.parser.AstValue.invoke(AstValue.java:151)
                 at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
                 at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
                 at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1213)
                 at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:62)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:174)
                 at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:66)
                 at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:153)
                 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl$GrabEvents.broadcastEvents(LifecycleImpl.java:1109)
                 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:283)
                 at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
                 at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
                 at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:178)
                 at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
                 at oracle.adfinternal.view.faces.webapp.rich.SharedLibraryFilter.doFilter(SharedLibraryFilter.java:135)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
                 at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:69)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
                 at oracle.adfinternal.view.faces.activedata.ADSFilter.doFilter(ADSFilter.java:85)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:281)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._invokeDoFilter(TrinidadFilterImpl.java:241)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:198)
                 at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:141)
                 at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
                 at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:583)
                 at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:334)
                 at com.evermind.server.http.HttpRequestHandler.doDispatchRequest(HttpRequestHandler.java:942)
                 at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:843)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:658)
                 at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:626)
                 at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:417)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:189)
                 at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:163)
                 at oracle.oc4j.network.ServerSocketReadHandler$ClientRunnable.run(ServerSocketReadHandler.java:275)
                 at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:237)
                 at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:29)
                 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:877)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
                 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
                 at java.lang.Thread.run(Thread.java:595)
            Caused by: Exception [TOPLINK-4002] (Oracle TopLink - 11g Technology Preview 4 (11.1.1.0.0) (Build 080422)): oracle.toplink.exceptions.DatabaseException
            Internal Exception: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

            Error Code: 904
            Call: SELECT CLASS.ID, CLASS.NAME, CLASS.VERSION_NO, CLASS.CURRICULUM, CLASS.MODIFIED_BY, CLASS.CREATED_BY, CLASS.CREATED_DATE, CLASS.ACTIVE, CLASS.MODIFIED_DATE, CLASS.TEACHING_MATERIAL, CLASS.START_DATE, CLASS.END_DATE, CLASS.SUBJECT_ID, CLASS.SCHOOL_ID FROM CLASS t0, SCHOOL t2, SUBJECT t1 WHERE (((((t1.ID = t0.SUBJECT_ID) AND (LOWER(t0.NAME) LIKE ?)) AND (LOWER(t1.NAME_FO) LIKE ?)) AND (LOWER(t2.NAME) LIKE ?)) AND (t2.ID = t0.SCHOOL_ID)) ORDER BY t0.NAME ASC
                 bind => [%, %, %]
            Query: ReadAllQuery(fo.samteld.vitanet.domain.teaching.Clazz)
                 at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:304)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:613)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)
                 at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:447)
                 at oracle.toplink.internal.sessions.IsolatedClientSession.executeCall(IsolatedClientSession.java:117)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:193)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeCall(DatasourceCallQueryMechanism.java:179)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.executeSelectCall(DatasourceCallQueryMechanism.java:250)
                 at oracle.toplink.internal.queryframework.DatasourceCallQueryMechanism.selectAllRows(DatasourceCallQueryMechanism.java:583)
                 at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRowsFromTable(ExpressionQueryMechanism.java:2480)
                 at oracle.toplink.internal.queryframework.ExpressionQueryMechanism.selectAllRows(ExpressionQueryMechanism.java:2438)
                 at oracle.toplink.queryframework.ReadAllQuery.executeObjectLevelReadQuery(ReadAllQuery.java:467)
                 at oracle.toplink.queryframework.ObjectLevelReadQuery.executeDatabaseQuery(ObjectLevelReadQuery.java:874)
                 at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:671)
                 at oracle.toplink.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:835)
                 at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:445)
                 at oracle.toplink.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:899)
                 at oracle.toplink.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2697)
                 at oracle.toplink.tools.profiler.DMSPerformanceProfiler.profileExecutionOfQuery(DMSPerformanceProfiler.java:693)
                 at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1072)
                 at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1058)
                 at oracle.toplink.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:1032)
                 at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:377)
                 at oracle.toplink.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:488)
                 at fo.samteld.vitanet.services.TeachingServiceBean.searchClasses(TeachingServiceBean.java:112)
                 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                 at java.lang.reflect.Method.invoke(Method.java:585)
                 at com.evermind.server.ejb.interceptor.joinpoint.EJBJoinPointImpl.invoke(EJBJoinPointImpl.java:27)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.SetContextActionInterceptor.invoke(SetContextActionInterceptor.java:44)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.DMSInterceptor.invoke(DMSInterceptor.java:52)
                 at com.evermind.server.ejb.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:101)
                 at com.evermind.server.ejb.interceptor.system.TxRequiredInterceptor.invoke(TxRequiredInterceptor.java:50)
                 ... 65 more
            Caused by: java.sql.SQLException: ORA-00904: "CLASS"."SCHOOL_ID": ugyldig identifikator

                 at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:77)
                 at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:111)
                 at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:472)
                 at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:422)
                 at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:1089)
                 at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:204)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
                 at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:945)
                 at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1303)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3556)
                 at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3608)
                 at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1341)
                 at oracle_jdbc_driver_OraclePreparedStatementWrapper_Proxy.executeQuery(Unknown Source)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeSelect(DatabaseAccessor.java:813)
                 at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:539)
                 ... 99 more
            BR

            Jakup
            • 3. Re: Error in JPA Toplink
              PaKo
              Yes, it looks like bug. There are such problems in TopLink which was included in TP4. Now there is Release of TopLink 11g so you can try downloading and replacing the .jars...

              Still, I would rewrite query in more JPA-style:

              @NamedQuery(name = "Class.search",
              query = "select c from Clazz c "
              + "where lower(c.name) like :name"
              + " and lower(c.subject.name) like :subject"
              + " and lower(c.school.name) like :school "
              + "order by c.name"
              )

              Try with rewritten query in TP4, it may work well.

              Edited by: PaKo on Oct 6, 2008 10:20 PM