ClassNotFoundException: org.hibernate.hql.ast.HqlToken

Posted on 2007-10-16
Last Modified: 2013-12-02

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".


org.apache.axis2.AxisFault: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from where job_status='open']
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
at org.apache.axis2.description.OutInAxisOperationClient.send(
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
at org.apache.axis2.client.OperationClient.execute(
at Testing.main(
Question by:mapringteam
    LVL 26

    Expert Comment

    Looks like the "MapringCareerStub.getVacancies" call returns the reference of hibernate entity!

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

    Author Comment

    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.
    LVL 26

    Accepted Solution

    >>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!

    Author Comment

    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");

    Thank u,

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
    Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now