HQL with parameters NoSuchMethodError

北战南征 提交于 2019-12-01 05:56:54

Problem here is there is a conflict between the two ANT jar files(namely: antlr-2.7.6.jar from Hibernate Jar library & antlr-2.7.2 from struts-1.3) in your project. This appears to be a peculiar problem with Struts-1.3 & Hibernate applications.

Please remove antlr-2.7.2.jar from your project(/WEB-INF/lib folder)& it should work fine.. Let me know if it works..

Looks like you mixed incompatible versions of Hibernate jars (probably ANTLR jar has a wrong version).

user2337145

You can this:

<dependency>
    <groupId>org.apache.struts</groupId>
    <artifactId>struts-core</artifactId>
    <version>1.3.10</version>

    <exclusions>
        <exclusion>
            <groupId>antlr</groupId>
            <artifactId>antlr</artifactId>
        </exclusion>
    </exclusions>
</dependency>

Try add this dependency in your pom.xml:

    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.7</version>
    </dependency>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!