4 Replies Latest reply on Mar 15, 2011 2:52 PM by Merv Newell

    getSingleResult() issues in JBoss 6

    Merv Newell Newbie

      I'm trying to convert an application that was running in JBoss 4.2.3 to JBoss 6 and after figthing through most of the changes have come across one I can't find an explanation for.

       

      I have a named query

       

      @NamedQuery

      (

           name = "GetTransportSilo"

           query = "select s from Silo s where name = 'TransportSilo' and CVClientID = 1"

       

      )

       

      I call it twice

      First time

      public Integer checkForTransportSilo ()

      {

        int nCount = 0;

       

        Query q = getEntityManager().createNamedQuery("GetTransportSilo");

        Collection<Silo> oColl = q.getResultList();

        for(int i = 0; i < oColl.size(); i++)

        {

         nCount++;

        }

       

        return new Integer(nCount);

      }

       

       

      This query runs fine

       

      The second query

      public Silo getTransportSilo()
      {
        Query q = getEntityManager().createNamedQuery("GetTransportSilo");

        return (Silo) q.getSingleResult();
      }

      Throws a SQL exception listed below - note both these queries run fine under Jboss 4.2.3 - any sugesstions as to what is wrong with this query under JBoss 6

       

      Exception was(Entire log file is attached):

      07:50:45,358 ERROR [JDBCExceptionReporter] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2 silo0_.Id as Id50_, silo0_.CVClientID as CVClientID50_, silo0_.JNDIName as JND' at line 1

      07:50:45,374 ERROR [CVManager] Error accessing database bean SiloLocal: javax.ejb.EJBException: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:183) [:0.0.1]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:251) [:0.0.1]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.required(CMTTxInterceptor.java:349) [:0.0.1]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:209) [:0.0.1]

      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52) [:0.0.1]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) [:1.0.0.GA]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:323) [:1.7.17]

      at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:380) [:1.7.17]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]

      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]

      at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalContainerInvocation.invokeTarget(SessionLocalProxyInvocationHandler.java:184) [:1.0.11]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.proxy.impl.handler.session.SessionLocalProxyInvocationHandler$LocalInvokableContextHandler.invoke(SessionLocalProxyInvocationHandler.java:159) [:1.0.11]

      at $Proxy269.invoke(Unknown Source) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11]

      at $Proxy213.getTransportSilo(Unknown Source) at com.esp.cv.core.inbound.wrapper.CVManager.getSilos(CVManager.java:230) [:]

      at com.esp.cv.core.inbound.wrapper.CVManager.loadSilos(CVManager.java:171) [:]

      at com.esp.cv.core.inbound.wrapper.CVManager.init(CVManager.java:109) [:]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]

      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72) [:1.1.3]

      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) [:1.1.3]

      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) [:1.1.3]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]

      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]

      at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74) [:1.1.3]

      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_12108710.invoke(InvocationContextInterceptor_z_fillMethod_12108710.java) [:]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90) [:1.1.3]

      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_12108710.invoke(InvocationContextInterceptor_z_setup_12108710.java) [:]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95) [:1.7.17]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInNoTx(CMTTxInterceptor.java:234) [:0.0.1]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.never(CMTTxInterceptor.java:296) [:0.0.1]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invoke(CMTTxInterceptor.java:205) [:0.0.1]

      at org.jboss.ejb3.tx2.aop.CMTTxInterceptorWrapper.invoke(CMTTxInterceptorWrapper.java:52) [:0.0.1]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) [:1.0.0.GA]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:182) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.core.context.CurrentInvocationContextInterceptor.invoke(CurrentInvocationContextInterceptor.java:47) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) [:1.0.1]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptor.EJB3TCCLInterceptor.invoke(EJB3TCCLInterceptor.java:86) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:392) [:1.7.17]

      at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:88) [:1.7.17]

      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:75) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.async.impl.interceptor.AsynchronousClientInterceptor.invoke(AsynchronousClientInterceptor.java:143) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62) [:1.0.1.GA]

      at $Proxy272.invoke(Unknown Source) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:185) [:1.0.11]

      at $Proxy271.init(Unknown Source) at com.esp.cv.core.dispatcher.DispatcherServlet.loadSilos(DispatcherServlet.java:206) [:]

      at com.esp.cv.core.dispatcher.DispatcherServlet.init(DispatcherServlet.java:88) [:]

      at javax.servlet.GenericServlet.init(GenericServlet.java:242) [:1.0.0.Final]

      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1208) [:6.0.0.Final]

      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1108) [:6.0.0.Final]

      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3628) [:6.0.0.Final]

      at org.apache.catalina.core.StandardContext.start(StandardContext.java:3851) [:6.0.0.Final]

      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:294) [:6.0.0.Final]

      at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146) [:6.0.0.Final]

      at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:477) [:6.0.0.Final]

      at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.Final]

      at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.Final]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]

      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]

      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157) [:6.0.0.GA]

      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96) [:6.0.0.GA]

      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) [:6.0.0.GA]

      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271) [:6.0.0.GA]

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670) [:6.0.0.GA]

      at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206) [:2.2.0.GA]

      at $Proxy41.start(Unknown Source) at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:53) [:2.2.0.GA]

      at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:41) [:2.2.0.GA]

      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:301) [:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:894) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:641) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:182) [:2.2.0.GA]

      at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:58) [:2.2.0.GA]

      at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62) [:2.2.0.GA]

      at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:55) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:179) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1832) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1550) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1571) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1603) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1491) [:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.change(DeployersImpl.java:1983) [:2.2.0.GA]

      at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:1076) [:2.2.0.GA]

      at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:679) [:2.2.0.GA]

      at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.process(MainDeployerPlugin.java:106) [:6.0.0.Final]

      at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.process(ProfileControllerContext.java:143) [:0.2.2]

      at org.jboss.profileservice.dependency.ProfileDeployAction.deploy(ProfileDeployAction.java:151) [:0.2.2]

      at org.jboss.profileservice.dependency.ProfileDeployAction.installActionInternal(ProfileDeployAction.java:94) [:0.2.2]

      at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54) [jboss-kernel.jar:2.2.0.GA]

      at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42) [jboss-kernel.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:379) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:2044) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:1083) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1322) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1246) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1139) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:939) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:654) [jboss-dependency.jar:2.2.0.GA]

      at org.jboss.profileservice.dependency.ProfileActivationWrapper$BasicProfileActivation.start(ProfileActivationWrapper.java:190) [:0.2.2]

      at org.jboss.profileservice.dependency.ProfileActivationWrapper.start(ProfileActivationWrapper.java:87) [:0.2.2]

      at org.jboss.profileservice.dependency.ProfileActivationService.activateProfile(ProfileActivationService.java:215) [:0.2.2]

      at org.jboss.profileservice.dependency.ProfileActivationService.activate(ProfileActivationService.java:159) [:0.2.2]

      at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.activate(AbstractProfileServiceBootstrap.java:112) [:0.2.2]

      at org.jboss.profileservice.resolver.BasicResolverFactory$ProfileResolverFacade.deploy(BasicResolverFactory.java:87) [:0.2.2]

      at org.jboss.profileservice.bootstrap.AbstractProfileServiceBootstrap.start(AbstractProfileServiceBootstrap.java:91) [:0.2.2]

      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:132) [:6.0.0.Final]

      at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]

      at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

      at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

      at java.lang.Thread.run(Thread.java:619) [:1.6.0_16]

      Caused by: javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not execute query

      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1214) [:3.6.0.Final]

      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1147) [:3.6.0.Final]

      at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:307) [:3.6.0.Final]

      at com.esp.cv2.dao.ejb3.SiloBean.getTransportSilo(SiloBean.java:72) [:]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]

      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeTarget(MethodInvocation.java:122) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:111) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptors.container.ContainerMethodInvocationWrapper.invokeNext(ContainerMethodInvocationWrapper.java:72) [:1.1.3]

      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.invoke(InterceptorSequencer.java:76) [:1.1.3]

      at org.jboss.ejb3.interceptors.aop.InterceptorSequencer.aroundInvoke(InterceptorSequencer.java:62) [:1.1.3]

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_16]

      at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_16]

      at org.jboss.aop.advice.PerJoinpointAdvice.invoke(PerJoinpointAdvice.java:174) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.fillMethod(InvocationContextInterceptor.java:74) [:1.1.3]

      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_fillMethod_12108710.invoke(InvocationContextInterceptor_z_fillMethod_12108710.java) [:]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor.setup(InvocationContextInterceptor.java:90) [:1.1.3]

      at org.jboss.aop.advice.org.jboss.ejb3.interceptors.aop.InvocationContextInterceptor_z_setup_12108710.invoke(InvocationContextInterceptor_z_setup_12108710.java) [:]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.async.impl.interceptor.AsynchronousServerInterceptor.invoke(AsynchronousServerInterceptor.java:128) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:62) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.entity.TransactionScopedEntityManagerInterceptor.invoke(TransactionScopedEntityManagerInterceptor.java:56) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:47) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) [:1.0.3]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:68) [:1.7.17]

      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) [jboss-aop.jar:2.2.1.GA]

      at org.jboss.ejb3.core.context.SessionInvocationContextAdapter.proceed(SessionInvocationContextAdapter.java:95) [:1.7.17]

      at org.jboss.ejb3.tx2.impl.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:247) [:0.0.1]

      ... 189 more

      Caused by: org.hibernate.exception.SQLGrammarException: could not execute query

      at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:92) [:3.6.0.Final]

      at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) [:3.6.0.Final]

      at org.hibernate.loader.Loader.doList(Loader.java:2536) [:3.6.0.Final]

      at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) [:3.6.0.Final]

      at org.hibernate.loader.Loader.list(Loader.java:2271) [:3.6.0.Final]

      at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) [:3.6.0.Final]

      at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) [:3.6.0.Final]

      at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) [:3.6.0.Final]

      at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) [:3.6.0.Final]

      at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) [:3.6.0.Final]

      at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:274) [:3.6.0.Final]

      ... 225 more

      Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2 silo0_.Id as Id50_, silo0_.CVClientID as CVClientID50_, silo0_.JNDIName as JND' at line 1

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [:1.6.0_16]

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) [:1.6.0_16]

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) [:1.6.0_16]

      at java.lang.reflect.Constructor.newInstance(Constructor.java:513) [:1.6.0_16]

      at com.mysql.jdbc.Util.handleNewInstance(Util.java:407) [:]

      at com.mysql.jdbc.Util.getInstance(Util.java:382) [:]

      at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052) [:]

      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3603) [:]

      at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3535) [:]

      at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1989) [:]

      at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2150) [:]

      at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2626) [:]

      at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119) [:]

      at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2281) [:]

      at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:342) [:6.0.0.Final]

      at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208) [:3.6.0.Final]

      at org.hibernate.loader.Loader.getResultSet(Loader.java:1953) [:3.6.0.Final]

      at org.hibernate.loader.Loader.doQuery(Loader.java:802) [:3.6.0.Final]

      at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) [:3.6.0.Final]

      at org.hibernate.loader.Loader.doList(Loader.java:2533) [:3.6.0.Final]

      ... 233 more

       

       

       

       

       

       

       

        • 1. getSingleResult() issues in JBoss 6
          Karsten Wutzke Expert

          Chances are that Hibernate generates invalid SQL. Please post the code that Hibernate generates from the statement. (You have to put something like

           

                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>

                <property name="hibernate.show_sql" value="true" />

                <property name="hibernate.format_sql" value="true" />

           

          into your persistence.xml or hibernate.cfg.xml)

           

          Karsten

          • 2. getSingleResult() issues in JBoss 6
            Merv Newell Newbie

            Here is the SQL for the method using the getSingleResult that didn't work - note when I added your lines to the persistence.xml file I no longer see the SQL exception in the log - so it would appear as though 1 or 2 of the propery names you had me enter fixes the problem - without going through trial and error do you think its line 1 or 3 - I doubt its line 2 - or do you think something else is going on

             

            07:38:09,695 INFO [STDOUT] select

            07:38:09,695 INFO [STDOUT] silo0_.Id as Id13_,

            07:38:09,695 INFO [STDOUT] silo0_.CVClientID as CVClientID13_,

            07:38:09,695 INFO [STDOUT] silo0_.JNDIName as JNDIName13_,

            07:38:09,695 INFO [STDOUT] silo0_.ClassName as ClassName13_,

            07:38:09,695 INFO [STDOUT] silo0_.Master as Master13_,

            07:38:09,695 INFO [STDOUT] silo0_.Name as Name13_,

            07:38:09,695 INFO [STDOUT] silo0_.Parent as Parent13_,

            07:38:09,695 INFO [STDOUT] silo0_.ScheduleID as ScheduleID13_,

            07:38:09,695 INFO [STDOUT] silo0_.siloOrder as siloOrder13_

            07:38:09,695 INFO [STDOUT] from

            07:38:09,695 INFO [STDOUT] Silo silo0_

            07:38:09,695 INFO [STDOUT] where

            07:38:09,695 INFO [STDOUT] silo0_.Name='TransportSilo'

            07:38:09,695 INFO [STDOUT] and silo0_.CVClientID=1 limit ? 07:38:09,695 INFO [STDOUT] Hibernate:

            07:38:09,695 INFO [STDOUT] select

            07:38:09,695 INFO [STDOUT] schedule0_.scheduleID as scheduleID46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.CVClientID as CVClientID46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.lastChange as lastChange46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.run24Hours as run4_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runFriday as runFriday46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runMonday as runMonday46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runSaturday as runSatur7_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runStartTime as runStart8_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runStopTime as runStopT9_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runSunday as runSunday46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runThursday as runThur11_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runTuesday as runTuesday46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.runWednesday as runWedn13_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.scheduleName as schedul14_46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.scope as scope46_1_,

            07:38:09,695 INFO [STDOUT] schedule0_.sleepInterval as sleepIn16_46_1_,

            07:38:09,695 INFO [STDOUT] client1_.CVClientID as CVClientID9_0_,

            07:38:09,695 INFO [STDOUT] client1_.clientName as clientName9_0_,

            07:38:09,695 INFO [STDOUT] client1_.clientShortName as clientSh3_9_0_

            07:38:09,695 INFO [STDOUT] from

            07:38:09,695 INFO [STDOUT] Schedule schedule0_

            07:38:09,695 INFO [STDOUT] inner join

            07:38:09,695 INFO [STDOUT] Client client1_

            07:38:09,695 INFO [STDOUT] on schedule0_.CVClientID=client1_.CVClientID

            07:38:09,695 INFO [STDOUT] where

            07:38:09,695 INFO [STDOUT] schedule0_.scheduleID=? 07:38:09,695 INFO [STDOUT] Hibernate:

            07:38:09,695 INFO [STDOUT] select

            07:38:09,695 INFO [STDOUT] params0_.SiloID as SiloID13_1_,

            07:38:09,695 INFO [STDOUT] params0_.ID as ID1_,

            07:38:09,695 INFO [STDOUT] params0_.ID as ID47_0_,

            07:38:09,695 INFO [STDOUT] params0_.DateValue as DateValue47_0_,

            07:38:09,695 INFO [STDOUT] params0_.EndDate as EndDate47_0_,

            07:38:09,695 INFO [STDOUT] params0_.IntValue as IntValue47_0_,

            07:38:09,695 INFO [STDOUT] params0_.JavaType as JavaType47_0_,

            07:38:09,695 INFO [STDOUT] params0_.Name as Name47_0_,

            07:38:09,695 INFO [STDOUT] params0_.NumValue as NumValue47_0_,

            07:38:09,695 INFO [STDOUT] params0_.SiloID as SiloID47_0_,

            07:38:09,695 INFO [STDOUT] params0_.StartDate as StartDate47_0_,

            07:38:09,695 INFO [STDOUT] params0_.StringValue as StringV10_47_0_

            07:38:09,695 INFO [STDOUT] from

            07:38:09,695 INFO [STDOUT] SiloSettings params0_

            07:38:09,695 INFO [STDOUT] where

            07:38:09,695 INFO [STDOUT] params0_.SiloID=?

            • 3. getSingleResult() issues in JBoss 6
              Karsten Wutzke Expert

              Well, line 2 and 3 are just Hibernate settings to log the SQL and to format the SQL so its not on a single line, so if there was a setting that fixed your problem then it's line 1. But why don't you try it yourself and tell us about it here? ;-)

               

              Karsten

              • 4. getSingleResult() issues in JBoss 6
                Merv Newell Newbie

                Yes line 1 did fix the problem. In my persistence.xml file that I was using that worked for JBoss 4.2.3 it had the line

                 

                <property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect"/>

                 

                so when I changed it to

                 

                <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/>

                 

                I got past the getSingleResult error - The line you gave me makes sense since I'm using MySql - not sure why 4.2.3 worked using the line that was there but hey its working for Jboss 6 now and that's all that counts.

                 

                Thanks for the help

                merv