-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
PostPosted: Wed Feb 06, 2008 7:40 am 
Newbie

Joined: Wed Feb 06, 2008 7:20 am
Posts: 3
Location: United Kingdom
Hi,

I am using hibernate3.2.5.ga. I am getting following error when application is run.

What is the cause for this error?
Your answer is greatly appreciated.

[Starting OC4J using the following ports: HTTP=8988, RMI=23891, JMS=9227.]
C:\jdevstudiobase10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config>
"C:\Program Files\Java\jdk1.5.0_14\bin\javaw.exe" -client -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=1798 -classpath C:\jdevstudiobase10133\j2ee\home\oc4j.jar;C:\jdevstudiobase10133\jdev\lib\jdev-oc4j-embedded.jar -Xverify:none -XX:MaxPermSize=256m -DcheckForUpdates=adminClientOnly -Doracle.application.environment=development -Doracle.j2ee.dont.use.memory.archive=true -Doracle.j2ee.http.socket.timeout=500 -Doc4j.jms.usePersistenceLockFiles=false oracle.oc4j.loader.boot.BootStrap -config C:\jdevstudiobase10133\jdev\system\oracle.j2ee.10.1.3.41.57\embedded-oc4j\config\server.xml
[waiting for the server to complete its initialization...]
Listening for transport dt_socket at address: 1798
Debugger connected to local process.
Feb 6, 2008 11:29:33 AM com.evermind.server.jms.JMSMessages log
INFO: JMSServer[]: OC4J JMS server recovering transactions (commit 0) (rollback 0) (prepared 0).
Feb 6, 2008 11:29:33 AM com.evermind.server.jms.JMSMessages log
INFO: JMSServer[]: OC4J JMS server recovering local transactions Queue[jms/Oc4jJmsExceptionQueue].
Feb 6, 2008 11:29:46 AM oracle.wireless.its.ra.TelnetResourceAdapter run
INFO: Industrial Telnet Server version: Version 10.1.3.0.0 started-up successfully.
Ready message received from Oc4jNotifier.
Embedded OC4J startup time: 28601 ms.

Target URL -- http://localhost:8988/employee-context- ... gLogin.jsp
08/02/06 11:29:50 Oracle Containers for J2EE 10g (10.1.3.3.0) initialized
WARNING: Code-source C:\hibernate\lib\connector.jar (from <classpath> in C:\employeeData\employee\public_html) has the same filename but is not identical to /C:/jdevstudiobase10133/j2ee/home/lib/connector.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\jdevstudiobase10133\j2ee\home\oc4j.jar). If it contains different versions of the same classes, it will be masked as the latter is already visible in the search path of loader current-workspace-app.web.employee-webapp:0.0.0.
WARNING: Code-source C:\hibernate\lib\jta.jar (from <classpath> in C:\employeeData\employee\public_html) has the same filename but is not identical to /C:/jdevstudiobase10133/j2ee/home/lib/jta.jar (from <code-source> (ignore manifest Class-Path) in META-INF/boot.xml in C:\jdevstudiobase10133\j2ee\home\oc4j.jar). If it contains different versions of the same classes, it will be masked as the latter is already visible in the search path of loader current-workspace-app.web.employee-webapp:0.0.0.
08/02/06 11:29:53 log4j:WARN No appenders could be found for logger (org.apache.struts.util.PropertyMessageResources).
08/02/06 11:29:53 log4j:WARN Please initialize the log4j system properly.
org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select a.password from employee.dbbeans.LoginBean as a where a.userName = ?]
at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:57)
at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:31)
at antlr.CharScanner.<init>(CharScanner.java:51)
at antlr.CharScanner.<init>(CharScanner.java:60)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:56)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:53)
at org.hibernate.hql.antlr.HqlBaseLexer.<init>(HqlBaseLexer.java:50)
at org.hibernate.hql.ast.HqlLexer.<init>(HqlLexer.java:26)
at org.hibernate.hql.ast.HqlParser.getInstance(HqlParser.java:44)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:242)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
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:1623)
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:585)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
at $Proxy0.createQuery(Unknown Source)
at employee.data.dao.employee.EmployeeDetailsDAOImpl.isLoginValid(EmployeeDetailsDAOImpl.java:40)
at employee.delegate.employee.EmployeeDetailsDelegate.isLoginValid(EmployeeDetailsDelegate.java:19)
at employee.web.action.admin.AdminLoginAction.execute(AdminLoginAction.java:43)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)

_________________
Regards,
Vadiraj


Top
 Profile  
 
 Post subject: It is working solution found
PostPosted: Thu Feb 07, 2008 7:44 am 
Newbie

Joined: Wed Feb 06, 2008 7:20 am
Posts: 3
Location: United Kingdom
dear friends,

It is working now.

Solution is to add following property to the hibernate configuration file hibernate.cfg.xml

<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

_________________
Regards,
Vadiraj


Top
 Profile  
 
 Post subject: It is working solution found
PostPosted: Thu Feb 07, 2008 7:45 am 
Newbie

Joined: Wed Feb 06, 2008 7:20 am
Posts: 3
Location: United Kingdom
dear friends,

It is working now.

Solution is to add following property to the hibernate configuration file hibernate.cfg.xml

<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>

_________________
Regards,
Vadiraj


Top
 Profile  
 
 Post subject: Re: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
PostPosted: Wed May 12, 2010 5:27 pm 
Newbie

Joined: Wed May 12, 2010 5:24 pm
Posts: 1
You rock!!!

It solved my problem too....


Top
 Profile  
 
 Post subject: Re: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
PostPosted: Thu Jul 08, 2010 4:27 am 
Regular
Regular

Joined: Fri Feb 09, 2007 3:47 pm
Posts: 56
Thanks a lot.

It also worked for me! (WebLogic+MySQL).


Top
 Profile  
 
 Post subject: Re: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
PostPosted: Fri Jun 10, 2011 4:12 pm 
Newbie

Joined: Fri Jun 10, 2011 4:06 pm
Posts: 1
Thanks, it worked for me too.


Top
 Profile  
 
 Post subject: Re: ClassNotFoundException: org.hibernate.hql.ast.HqlToken
PostPosted: Wed Dec 21, 2011 3:57 pm 
Newbie

Joined: Wed Dec 21, 2011 3:37 pm
Posts: 1
While the suggested fix in this thread will work around the problem, the actual cause of the issue is a library conflict. We resolved this in our environment, WebLogic 10g (10.3.4), by adding an appropriate version of antlr.jar to the classpath prior to any other entries.

For instance (as written the WebLogic config.xml):
Code:
<class-path>/somewhere/lib/antlr-x.y.z.jar:$CLASSPATH</class-path>


I can't speak for all scenarios, but this was our issue. I believe WebLogic was loading an earlier version of antlr that was not compatible with what Hibernate expected, but it was loaded higher in the classloader hierarchy so the library provided in the application did not take precedence.

The above suggestion of using the ClassicQueryTranslatorFactory simply sidesteps this particular library issue.

Hope this helps!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.