3 Replies Latest reply on Jun 5, 2006 10:09 AM by Michael Arnett

    Three part identifiers prohibited in statement

    Michael Arnett Newbie

      All,
      I am using:
      Jboss seam 1.0.0.CR3
      JBoss IDE 1.6
      JBoss 4.0.4GA (ejb3 config)
      SQL Server 2000
      MS SQL Server 200 JDBC drivers

      I am trying to complete the CRUD example from the example movie. I get everything up and running and go to the web interface and try to run a search and I get the following issue.

      I have tried a variety of things, but I consistently receive the exception:
      Three part identifiers prohibited in statement

      I copied the sql statement from the stack trace and ran it against the SQL Server db (replacing the ?'s with values) using Sql Server's Query Analyzer and the sql statement runs fine.

      Is anyone familiar with this exception? I apologize if this is more of a JDBC related issue, but I am at a loss for where to start on this one.
      Thanks,
      -MLA

        • 1. Re: Three part identifiers prohibited in statement
          Michael Arnett Newbie

          Ok, let's try a different angle:

          1. Has anyone got Seam working with MS Sql Server 2000?
          2. Has anyone seen this excpetion before? Is anyone familiar with what it means? Is the primary key being ignored?

          Thanks again for any help anyone can offer.
          -MLA

          • 2. Re: Three part identifiers prohibited in statement
            Max Rydahl Andersen Master

            what is the exception ? your previous message does not show it.

            • 3. Re: Three part identifiers prohibited in statement
              Michael Arnett Newbie


              Here is a portion of the stacktrace. Please let me know if more would be helpful. Also, please note that this is the same problem, but this is for a different schema than the example. In this scenario, I used a single table from an existing database project in hopes of reducing the problem set. If it would be helpful, I can rerun the example schema:


              java.sql.SQLException: Three part identifiers prohibited in statement [select top ? locs0_.ID as ID145_, locs0_.Name as Name145_, locs0_.State as State145_, locs0_.City as City145_, locs0_.Zip as Zip145_, locs0_.Comments as Comments145_, locs0_.OID as OID145_, locs0_.Phone_Prim as Phone8_145_, locs0_.Phone_Sec as Phone9_145_, locs0_.Address_Line_1 as Address10_145_, locs0_.Address_Line_2 as Address11_145_ from LOC_LC.dbo.Locs locs0_ where locs0_.Name like ?]
              at org.hsqldb.jdbc.Util.throwError(Unknown Source)
              at org.hsqldb.jdbc.jdbcPreparedStatement.(Unknown Source)
              at org.hsqldb.jdbc.jdbcConnection.prepareStatement(Unknown Source)
              at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:349)
              at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:337)
              at org.jboss.resource.adapter.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:187)
              at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
              at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
              at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
              at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1561)
              at org.hibernate.loader.Loader.doQuery(Loader.java:661)
              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
              at org.hibernate.loader.Loader.doList(Loader.java:2145)
              at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
              at org.hibernate.loader.Loader.list(Loader.java:2024)
              at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:392)
              at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:333)
              at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
              at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1109)
              at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
              at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:53)
              at com.lrn.rm.deploy.labman.locsFinderBean.executeQuery(locsFinderBean.java:134)
              at com.lrn.rm.deploy.labman.locsFinderBean.findFirstPage(locsFinderBean.java:140)
              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 org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:109)
              at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:168)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
              at org.jboss.seam.interceptors.ValidationInterceptor.validateTargetComponent(ValidationInterceptor.java:64)
              at sun.reflect.GeneratedMethodAccessor144.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.interceptors.OutcomeInterceptor.interceptOutcome(OutcomeInterceptor.java:21)
              at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.interceptors.RollbackInterceptor.rollbackIfNecessary(RollbackInterceptor.java:30)
              at sun.reflect.GeneratedMethodAccessor142.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.interceptors.BijectionInterceptor.bijectTargetComponent(BijectionInterceptor.java:33)
              at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.interceptors.ConversationInterceptor.endOrBeginLongRunningConversation(ConversationInterceptor.java:68)
              at sun.reflect.GeneratedMethodAccessor140.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.interceptors.BusinessProcessInterceptor.manageBusinessProcessContext(BusinessProcessInterceptor.java:60)
              at sun.reflect.GeneratedMethodAccessor139.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.interceptors.RemoveInterceptor.removeIfNecessary(RemoveInterceptor.java:39)
              at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.seam.util.Reflections.invoke(Reflections.java:13)
              at org.jboss.seam.interceptors.Interceptor.aroundInvoke(Interceptor.java:87)
              at org.jboss.seam.interceptors.SeamInvocationContext.proceed(SeamInvocationContext.java:60)
              at org.jboss.seam.ejb.SeamInterceptor.aroundInvokeInContexts(SeamInterceptor.java:73)
              at org.jboss.seam.ejb.SeamInterceptor.aroundInvoke(SeamInterceptor.java:45)
              at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:585)
              at org.jboss.ejb3.interceptor.InvocationContextImpl.proceed(InvocationContextImpl.java:120)
              at org.jboss.ejb3.interceptor.EJB3InterceptorsInterceptor.invoke(EJB3InterceptorsInterceptor.java:62)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.entity.ExtendedPersistenceContextPropagationInterceptor.invoke(ExtendedPersistenceContextPropagationInterceptor.java:57)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:54)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.aspects.tx.TxPolicy.invokeInCallerTx(TxPolicy.java:126)
              at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:196)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:81)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
              at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
              at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:199)
              at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
              at $Proxy270.findFirstPage(Unknown Source)
              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 org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
              at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
              at javax.faces.component.UICommand.broadcast(UICommand.java:106)
              at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
              at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
              at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:316)
              at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)
              2006-05-31 17:08:09,265 WARN [org.hibernate.util.JDBCExceptionReporter] SQL Error: -226, SQLState: 22019
              2006-05-31 17:08:09,265 ERROR [org.hibernate.util.JDBCExceptionReporter] Three part identifiers prohibited in statement [select top ? locs0_.ID as ID145_, locs0_.Name as Name145_, locs0_.State as State145_, locs0_.City as City145_, locs0_.Zip as Zip145_, locs0_.Comments as Comments145_, locs0_.OID as OID145_, locs0_.Phone_Prim as Phone8_145_, locs0_.Phone_Sec as Phone9_145_, locs0_.Address_Line_1 as Address10_145_, locs0_.Address_Line_2 as Address11_145_ from LOC_LC.dbo.Locs locs0_ where locs0_.Name like ?]
              2006-05-31 17:08:09,265 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url null
              2006-05-31 17:08:09,265 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@1e11c0e, cl=org.jboss.mx.loading.HeirarchicalLoaderRepository3$CacheClassLoader@127ea69{ url=null ,addedOrder=0}
              2006-05-31 17:08:09,265 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url null
              2006-05-31 17:08:09,265 DEBUG [org.jboss.mx.loading.RepositoryClassLoader] setRepository, repository=org.jboss.mx.loading.HeirarchicalLoaderRepository3@1e11c0e, cl=org.jboss.mx.loading.UnifiedClassLoader3@18ebb11{ url=null ,addedOrder=0}
              2006-05-31 17:08:09,265 DEBUG [org.jboss.seam.interceptors.RemoveInterceptor] Stateful component was removed: locsFinder
              2006-05-31 17:08:09,265 ERROR [org.jboss.seam.servlet.SeamExceptionFilter] uncaught exception handled by Seam
              javax.servlet.ServletException: Error calling action method of component with id _id2:_id24
              at javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.seam.servlet.SeamExceptionFilter.doFilter(SeamExceptionFilter.java:45)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
              at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
              at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
              at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
              at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
              at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:54)
              at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:174)
              at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
              at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
              at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
              at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
              at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
              at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
              at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
              at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
              at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
              at java.lang.Thread.run(Thread.java:595)