1 Reply Latest reply on Dec 21, 2004 5:24 AM by Alexei Sadovnikov

    Hibernate: unexpected token: as

    Alexei Sadovnikov Newbie

      Please help! I'm trying to use Hibernate2 under JBoss 3.2.6. The application works fine as a standalone one, but under JBoss it throws an exception:
      unexpected token: as [from PersonVO as p where p.shortName = :shortName]

      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/EdilSessionFactory
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=4177336500f50b640100f50b65400000
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] opened session
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] find: from UnitGroupVO as g where g.id = :id
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.engine.QueryParameters] named parameters: {id=1}
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.hql.QueryTranslator] compiling query
      2004-12-21 10:55:53,171 INFO [STDOUT] net.sf.hibernate.QueryException: unexpected token: as [from UnitGroupVO as g where g.id = :id]
       at net.sf.hibernate.hql.FromParser.token(FromParser.java:94)
       at net.sf.hibernate.hql.ClauseParser.token(ClauseParser.java:87)
       at net.sf.hibernate.hql.PreprocessingParser.token(PreprocessingParser.java:123)
       at net.sf.hibernate.hql.ParserHelper.parse(ParserHelper.java:29)
       at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:149)
       at net.sf.hibernate.hql.QueryTranslator.compile(QueryTranslator.java:138)
       at net.sf.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:294)
       at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1561)
       at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1532)
       at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
       at net.sf.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:542)
       at ch.syseca.edil.server.unit.UnitServiceImpl.getUnits(UnitServiceImpl.java:165)
       at ch.syseca.edil.server.unit.ejb.UnitServiceEJB.getUnits(UnitServiceEJB.java:49)
       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:683)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:315)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:148)
       at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:111)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:331)
       at org.jboss.ejb.Container.invoke(Container.java:709)
       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.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:360)
       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 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:534)
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] flushing session
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushing entities and processing referenced collections
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] Processing unreferenced collections
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] Scheduling collection removes/(re)creates/updates
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushed: 0 insertions, 0 updates, 0 deletions to 0 objects
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] Flushed: 0 (re)creations, 0 updates, 0 removals to 0 collections
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] executing flush
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] post flush
      2004-12-21 10:55:53,171 DEBUG [net.sf.hibernate.impl.SessionImpl] closing session