ClassNotFoundException: org.hibernate.hql.ast.HqlToken, kiedy próbuję wykonać HQL

Następujący wyjątek występuje, gdy próbuję wykonać HQL w moim kodzie. Sprawdziłem to w różnych witrynach i odkryłem, że antlr.2.7.6.jar powinien znajdować się w ścieżce klasy. Sprawdziłem to w moim projekcie i stwierdziłem, że jest to w moich zależnościach Maven. Więc nie powinno być takiego problemu. Ale wciąż dostaję ten problem. Czy ktoś może mi w tym pomóc. Dostaję ten błąd w linii „empList = getHibernateTemplate (). Find („ from Employee ”);” w poniższej funkcji.

public List<EmployeeTO> getAllEmp() {
    List<Employee> empList =  new ArrayList<Employee>();
List<EmployeeTO> empListTO =  new ArrayList<EmployeeTO>();
empList = getHibernateTemplate().find("from Employee");
try {
    BeanUtils.copyProperties(empListTO, empList);
} catch (IllegalAccessException e) {
    e.printStackTrace();
} catch (InvocationTargetException e) {
    e.printStackTrace();
}
    return empListTO;
}

Magazyn wyjątków:

Root cause of ServletException.
     org.springframework.orm.hibernate3.HibernateQueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.myapp.domain.Employee]; nested exception is org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.myapp.domain.Employee]
    at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:656)
    at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:411)
    at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912)
    Truncated. see log file for complete stacktrace
Caused By: org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [from com.myapp.domain.Employee]
    at org.hibernate.hql.ast.HqlLexer.panic(HqlLexer.java:80)
    at antlr.CharScanner.setTokenObjectClass(CharScanner.java:340)
    at org.hibernate.hql.ast.HqlLexer.setTokenObjectClass(HqlLexer.java:54)
    at antlr.CharScanner.<init>(CharScanner.java:51)
    at antlr.CharScanner.<init>(CharScanner.java:60)
    Truncated. see log file for complete stacktrace

questionAnswers(4)

yourAnswerToTheQuestion