?
Solved

ClassNotFoundException: org.hibernate.hql.ast.HqlToken

Posted on 2007-10-16
4
Medium Priority
?
1,872 Views
Last Modified: 2013-12-02
Hi,

I create an AXIS2 web services. My AXIS2 is deployed within Tomcat 6 container. I use Hibernate 3.2 within my service to connect to MySQL 5 database. I get the below stack trace when I try to connect to the web service. The hibernate code just run fine if I run it in as console application. I have read about the changing the HQL parser to a classic one, it doesnt work for me and result in an error saying "Time out".


Thanks,

org.apache.axis2.AxisFault: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.mapring.career.Job where job_status='open']
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:387)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at com.mapring.career.MapringCareerStub.getVacancies(MapringCareerStub.java:181)
at Testing.main(Testing.java:13)
0
Comment
Question by:mapringteam
  • 2
  • 2
4 Comments
 
LVL 26

Expert Comment

by:ksivananth
ID: 20090981
Looks like the "MapringCareerStub.getVacancies" call returns the reference of hibernate entity!

Either
1. You have to include the Hibernate libraries in the client
or
2. Do a conversion int the service implementation so that it returns reference of the entities defined in the WSDL!
0
 

Author Comment

by:mapringteam
ID: 20098226
Thanks for your comment,

MapringCareerStub.getVacancies dooesn't return hibernate reference. What it returns is a complex type entity defined in my WSDL. I load the hibernate object from the database and copy the value (HibernateObject.getX()) column by column to the complex type.

More comments are welcome.

Thanks in advance.
0
 
LVL 26

Accepted Solution

by:
ksivananth earned 1500 total points
ID: 20098835
>>I load the hibernate object from the database and copy the value (HibernateObject.getX()) column by column to the complex type.

how do you copy, looks like it is not deep copy.

Note that the hibernate entities are subtype of the complext type you have defined, so the reference of hibernate entity always can be assigned to the supertype. Make sure you copied each and every atribute values, not just references!
0
 

Author Comment

by:mapringteam
ID: 20105953
Thanks for your comment,

I think there is nothing related to copy by reference because it still show the same error even when I just issue the statement:

session.createQuery("from Job");
session.close();


Thank u,
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question