问题描述
<?xml version =1.0encoding =UTF-8 ?>
< classpath>
< classpathentry kind =srcpath =src/>
...
...
< classpathentry kind =libpath =lib / hibernate3.jar/>
< classpathentry kind =libpath =lib / antlr-2.7.6.jar/>
...
< / classpath>
添加了一些.jar。当我尝试这样做时:
查询query2 = session.createQuery(sql2);
抛出异常问题名称:
任何想法?
预先致谢。
问候。
这与Hibernate API有关。
如果我没有记错的话,Hibernate 3.0使用ANTLR(另一种语言识别工具)来处理HSQL查询。
您需要添加一个额外的jar(ANTLR-2.7.5H3.jar)到您的类路径。
或者你可以将下面的maven依赖关系添加到pom.xml中:
<依赖性>
< groupId> org.hibernate< / groupId>
< artifactId> antlr< / artifactId>
< version> 2.7.5H3< / version>
< /依赖关系>
I have this in .classpath:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
...
...
<classpathentry kind="lib" path="lib/hibernate3.jar"/>
<classpathentry kind="lib" path="lib/antlr-2.7.6.jar"/>
...
</classpath>
Some .jar added. When I try this:
Query query2 = session.createQuery(sql2);
throw exception in question name:
Any idea?
Thanks in advance.
Greetings.
This is related to the Hibernate API. Hibernate 3.0 uses ANTLR (Another Tool for Language Recognition) for processing HSQL queries - if I remember correctly.
You need to add an additional jar (ANTLR-2.7.5H3.jar) to your classpath.
Or you can add the below maven dependency to the pom.xml
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>antlr</artifactId>
<version>2.7.5H3</version>
</dependency>
这篇关于java.lang.ClassNotFoundException:antlr.ANTLRException但我有项目的文件夹库中的antlr-2.7.6的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!