6 Replies Latest reply on Apr 24, 2003 10:54 AM by bpfurtado

    java.sql.SQLException: ORA-00936: missing expression

    janekclaus

      I just starting to dive into the JBoss CMP features, but the simplest task fails already.
      I deployed an entity bean with just a single findByPrimaryKey method.
      I double checked the deployment descriptors and my entity bean. The deployment works fine, but as soon as I try to access an entity from a test session bean I get above mentioned exception from Oracle.
      We're using Oracle 8i (8.1.6) and my jbosscmp-jdbc uses the mapping for Oracle8. It looks like JBoss is not using the right statement to find my entity. Could the mapping be the problem?
      Thanks, Janek

      p.s.: The full output looks like this:
      22:53:22,450 ERROR [STDERR] javax.ejb.FinderException: Find failed: java.sql.SQLException: ORA-00936: missing expression
      22:53:22,450 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:194)
      22:53:22,450 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:91)
      22:53:22,450 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntityCommand.execute(JDBCFindEntityCommand.java:44)
      22:53:22,450 ERROR [STDERR] at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntity(JDBCStoreManager.java:591)
      22:53:22,450 ERROR [STDERR] at org.jboss.ejb.plugins.CMPPersistenceManager.findEntity(CMPPersistenceManager.java:312)
      22:53:22,450 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntity(CachedConnectionInterceptor.java:301)
      22:53:22,450 ERROR [STDERR] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:685)
      22:53:22,460 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      22:53:22,460 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:998)
      22:53:22,460 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
      22:53:22,460 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:188)
      22:53:22,480 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      22:53:22,480 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:88)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:91)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:61)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:28)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:88)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:74)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:92)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      22:53:22,540 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
      22:53:22,550 ERROR [STDERR] at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:477)
      22:53:22,550 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:694)
      22:53:22,550 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      22:53:22,550 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      22:53:22,550 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      22:53:22,550 ERROR [STDERR] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      22:53:22,550 ERROR [STDERR] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:88)
      22:53:22,550 ERROR [STDERR] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
      22:53:22,550 ERROR [STDERR] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
      22:53:22,550 ERROR [STDERR] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:175)
      22:53:22,550 ERROR [STDERR] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:82)
      22:53:22,550 ERROR [STDERR] at $Proxy42.findByPrimaryKey(Unknown Source)
      22:53:22,550 ERROR [STDERR] at bean.JBossSessionBean.getName(Unknown Source)
      22:53:22,550 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      22:53:22,550 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
      22:53:22,550 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      22:53:22,550 ERROR [STDERR] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
      22:53:22,560 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:674)
      22:53:22,560 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      22:53:22,560 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      22:53:22,560 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      22:53:22,560 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:359)
      22:53:22,560 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      22:53:22,560 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
      22:53:22,560 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:147)
      22:53:22,560 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      22:53:22,560 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
      22:53:22,560 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      22:53:22,560 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      22:53:22,560 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)
      22:53:22,610 INFO [STDOUT] Returning: Find failed: java.sql.SQLException: ORA-00936: missing expression

        • 1. Re: java.sql.SQLException: ORA-00936: missing expression
          raja05

          Set the log level to DEBUG in the log4j.xml of ur conf directory and start the server. the SQL would be generated in the log file just before your exception. That shud give u an idea of why Oracle is complaining.

          -Raj

          • 2. Re: java.sql.SQLException: ORA-00936: missing expression
            janekclaus

            Thanks, that gives me a lot of output. It is missing the oracle/jdbc/driver/OracleConnection even, when I dropped the oracle.zip with all the classes into deploy. Have to find a way so JBoss recognizes the classes in that zip. But thanks a lot,

            Janek

            • 3. Re: java.sql.SQLException: ORA-00936: missing expression
              raja05

              Rename to zip to jar. JBoss recognizes only files with extensions jar, war, ear, sar.. Rename ur classes.zip to classes.jar and it shud be able to recognize that.

              -Raj

              • 4. Re: java.sql.SQLException: ORA-00936: missing expression
                bpfurtado

                I?m having the same problem, but:

                - My oracle driver jar file has already the extension ".jar" (classes12.jar)

                - There are no Exceptions from my CMP at the jboss log, only in my tomcat log (catalina.out).


                Thanks for your time.

                • 5. Re: java.sql.SQLException: ORA-00936: missing expression
                  raja05

                  What exception message are you getting in ur catalina.out ? are there any SQL statements in your server.log, CMP should spit some messages if the log level is set to DEBUG..

                  • 6. Re: java.sql.SQLException: ORA-00936: missing expression
                    bpfurtado

                    There are really no Exceptions being logged at my jboss server.log file.

                    And I am setting the cmp package log level do debug by this xml code at my jboss log4j.xml file:





                    The exact Exception logged at catalina.out is:

                    javax.ejb.FinderException: Find failed: java.sql.SQLException: ORA-00936: missing expression

                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstractQueryCommand.java:148)
                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntitiesCommand.java:40)
                    at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManager.java:549)
                    at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManager.java:348)
                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntities(CachedConnectionInterceptor.jav
                    a:323)
                    at org.jboss.ejb.EntityContainer.findLocal(EntityContainer.java:612)
                    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:324)
                    at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1119)
                    at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
                    at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:206)
                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:
                    215)
                    at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
                    at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
                    at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
                    at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:232)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
                    at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
                    at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
                    at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
                    at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(BaseLocalContainerInvoker.java:230)
                    at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:110)
                    at $Proxy120.findByEspacoPublicitarioTipo(Unknown Source)
                    at br.com.tpi.ejb.category.FuncionalidadesReservaBean.buscaMercados(FuncionalidadesReservaBean.java:449)
                    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:324)
                    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)

                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)

                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
                    at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
                    at org.jboss.ejb.Container.invoke(Container.java:712)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                    at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:98)
                    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:102)
                    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
                    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
                    at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
                    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
                    at $Proxy147.buscaMercados(Unknown Source)
                    at br.com.tpi.businessdelegate.ebuilder.BDelegateBean.buscaMercados(BDelegateBean.java:355)
                    at br.com.tpi.businessdelegate.ebuilder.BDelegateBean.execute(BDelegateBean.java:294)
                    at sun.reflect.GeneratedMethodAccessor38.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:324)
                    at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:660)
                    at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)

                    at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:77)

                    at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:107)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
                    at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:60)
                    at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
                    at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
                    at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:313)
                    at org.jboss.ejb.Container.invoke(Container.java:712)
                    at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
                    at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
                    at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:324)
                    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
                    at sun.rmi.transport.Transport$1.run(Transport.java:148)
                    at java.security.AccessController.doPrivileged(Native Method)
                    at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
                    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
                    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
                    at java.lang.Thread.run(Thread.java:536)
                    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
                    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
                    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
                    at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
                    at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138)
                    at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
                    at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
                    at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
                    at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
                    at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
                    at $Proxy1.execute(Unknown Source)
                    at br.com.tpi.businessdelegate.ebuilder.BDelegateAccess.execute(BDelegateAccess.java:52)
                    at br.com.tpi.servlet.ebuilder.SelecionaTipoEspacoServlet.action(SelecionaTipoEspacoServlet.java:81)
                    at br.com.tpi.servlet.ebuilder.SelecionaTipoEspacoServlet.doPost(SelecionaTipoEspacoServlet.java:52)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
                    at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
                    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
                    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
                    at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
                    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
                    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
                    at java.lang.Thread.run(Thread.java:536)


                    Thanks for your help.