[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1777) org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
Naresh Kumar Mallineni (JIRA)
noreply at atlassian.com
Thu Nov 26 06:56:08 EST 2009
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=34767#action_34767 ]
Naresh Kumar Mallineni commented on HHH-1777:
---------------------------------------------
Put antlr.jar in PRE_CLASSPATH="" in setDomainEnv.sh/bat file and restart the servers.
> org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
> -------------------------------------------------------------------------------------
>
> Key: HHH-1777
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1777
> Project: Hibernate Core
> Issue Type: Bug
> Affects Versions: 3.1.3
> Environment: Hibernate 3.1.3,mysql-5.0.21-win32,mysql-connector-java-3.0.17-ga,jdk1.4.1_05,Struts 1.1,weblogic 8.1,MyEclipse 4.1.1GA
> Reporter: Ranjit Patil
> Attachments: AbstractBook.java, Book.hbm.xml, Book.java, BookListAction.java, BookListForm.class, hibernate.cfg.xml, HibernateSessionFactory.java, LibraryManager.java
>
>
> 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)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list