org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title]

Hibernate JIRA | Ranjit Patil | 1 decade ago
  1. 0

    I have two tables book and customer. My index page has two links show book list and Show customer List.Currently I am working on only Book List. It calls BookListAction.java which in turn calls LibraryManager.java in which getAllBooks() has code something like this: public Book[] getAllBooks() { /* will hold the books we are going to return later */ List books = new ArrayList(); /* a Hibernate session */ Session session = null; /* we always need a transaction */ Transaction tx = null; /* get session of the current thread */ session = HibernateSessionFactory.currentSession(); tx = session.beginTransaction(); ----------Exception is thrown when the below line of code is executed--------------------- List tmpBooks = session.createQuery( "select b from Book as b order by b.author, b.title").list(); ----------------------------------------------------------------------------------------------------------------- for (Iterator iter = tmpBooks.iterator(); iter.hasNext();) { books.add((Book) iter.next()); } tx.commit(); return (Book[]) books.toArray(new Book[0]); } In eclipse it runs fine but when i deployed on weblogic i got following error when i clicked the show book list link: org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title] at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57) at antlr.CharScanner.setTokenObjectClass(CharScanner.java:287) at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31) at antlr.CharScanner.(CharScanner.java:42) at antlr.CharScanner.(CharScanner.java:51) at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:56) at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:53) at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:50) at org.hibernate.hql.ast.HqlLexer.(HqlLexer.java:26) at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:232) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:75) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:54) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583) at de.laliluna.library.bl.LibraryManager.getAllBooks(LibraryManager.java:35)

    Hibernate JIRA | 1 decade ago | Ranjit Patil
    org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title]
  2. 0

    I have two tables book and customer. My index page has two links show book list and Show customer List.Currently I am working on only Book List. It calls BookListAction.java which in turn calls LibraryManager.java in which getAllBooks() has code something like this: public Book[] getAllBooks() { /* will hold the books we are going to return later */ List books = new ArrayList(); /* a Hibernate session */ Session session = null; /* we always need a transaction */ Transaction tx = null; /* get session of the current thread */ session = HibernateSessionFactory.currentSession(); tx = session.beginTransaction(); ----------Exception is thrown when the below line of code is executed--------------------- List tmpBooks = session.createQuery( "select b from Book as b order by b.author, b.title").list(); ----------------------------------------------------------------------------------------------------------------- for (Iterator iter = tmpBooks.iterator(); iter.hasNext();) { books.add((Book) iter.next()); } tx.commit(); return (Book[]) books.toArray(new Book[0]); } In eclipse it runs fine but when i deployed on weblogic i got following error when i clicked the show book list link: org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title] at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57) at antlr.CharScanner.setTokenObjectClass(CharScanner.java:287) at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31) at antlr.CharScanner.(CharScanner.java:42) at antlr.CharScanner.(CharScanner.java:51) at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:56) at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:53) at org.hibernate.hql.antlr.HqlBaseLexer.(HqlBaseLexer.java:50) at org.hibernate.hql.ast.HqlLexer.(HqlLexer.java:26) at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44) at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:232) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155) at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:75) at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:54) at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71) at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583) at de.laliluna.library.bl.LibraryManager.getAllBooks(LibraryManager.java:35)

    Hibernate JIRA | 1 decade ago | Ranjit Patil
    org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title]
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Commerce Services: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

    Google Groups | 9 years ago | Lukas Zapletal
    org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.elasticpath.domain.attribute.Attribute as a where a.key = ?]
  5. 0

    0013572: Maintain and print stacktraces when calls to setAdminMode and restoreAdminMode are unbalanced - Openbravo Issue Tracking System

    openbravo.com | 12 months ago
    org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select ur from ADUserRoles ur where ur.userContact.id='0' and ur.active='Y' and ur.role.active='Y' order by ur.role.id asc]

    1 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.QueryException

      ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select b from de.laliluna.library.Book as b order by b.author, b.title]

      at org.hibernate.hql.ast.HqlLexer.panic()
    2. Hibernate HQL/JP-QL Parser
      HqlLexer.panic
      1. org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
      1 frame
    3. Antlr
      CharScanner.setTokenObjectClass
      1. antlr.CharScanner.setTokenObjectClass(CharScanner.java:287)
      1 frame
    4. Hibernate HQL/JP-QL Parser
      HqlLexer.setTokenObjectClass
      1. org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
      1 frame
    5. Antlr
      CharScanner.<init>
      1. antlr.CharScanner.<init>(CharScanner.java:42)
      2. antlr.CharScanner.<init>(CharScanner.java:51)
      2 frames
    6. Hibernate
      HqlBaseLexer.<init>
      1. org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:56)
      2. org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:53)
      3. org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:50)
      3 frames
    7. Hibernate HQL/JP-QL Parser
      QueryTranslatorImpl.compile
      1. org.hibernate.hql.ast.HqlLexer.<init>(HqlLexer.java:26)
      2. org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44)
      3. org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:232)
      4. org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:155)
      5. org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:109)
      5 frames
    8. Hibernate
      SessionImpl.createQuery
      1. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:75)
      2. org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:54)
      3. org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:71)
      4. org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
      5. org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
      6. org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1583)
      6 frames
    9. de.laliluna.library
      LibraryManager.getAllBooks
      1. de.laliluna.library.bl.LibraryManager.getAllBooks(LibraryManager.java:35)
      1 frame