Bom dia a todos! Ao tentar responder a questão que retorna a quantidade de movimentações dos exercícios do capítulo 7, tenho o seguinte erro e exceção conforme abaixo. Alguém poderia me indicar as causas do problema? Agradeço qualquer suporte antecipadamente.
Observação: meu ambiente de desenvolvimento estava funcionando perfeitamente até chegar nos exercícios do capítulo 7.
Grato, Vicente
public class TesteConsultaFuncaoCount {
public static void main(String[] args) {
EntityManager manager = new JPAUtil().getEntityManager();
}
}
ERROR: line 1:1: unexpected token: elect
line 1:1: unexpected token: elect
at org.hibernate.hql.internal.antlr.HqlBaseParser.statement(HqlBaseParser.java:169)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:266)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:105)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:168)
at org.hibernate.internal.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:1071)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:519)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:72)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at br.com.caelum.financas.util.JPAUtil.<clinit>(JPAUtil.java:10)
at br.com.caelum.financas.teste.TesteConsultaFuncaoCount.main(TesteConsultaFuncaoCount.java:11)
Exception in thread "main" java.lang.ExceptionInInitializerError
at br.com.caelum.financas.teste.TesteConsultaFuncaoCount.main(TesteConsultaFuncaoCount.java:11)
Caused by: java.lang.IllegalArgumentException: node to traverse cannot be null!
at org.hibernate.hql.internal.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:63)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:272)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:180)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:105)
at org.hibernate.engine.query.spi.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.spi.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:168)
at org.hibernate.internal.SessionFactoryImpl.checkNamedQueries(SessionFactoryImpl.java:1071)
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:519)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1750)
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:94)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:920)
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:72)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
at br.com.caelum.financas.util.JPAUtil.<clinit>(JPAUtil.java:10)
... 1 more