java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I
org.hibernate.hql.ast.HqlSqlWalker.generatePositionalParameter(HqlSqlWalker.java:896)
org.hibernate.hql.antlr.HqlSqlBaseWalker.parameter(HqlSqlBaseWalker.java:4819)
org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1373)
org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4243)
org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3725)
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1864)
org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1789)
org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:818)
org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:604)
org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:288)
org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:231)
org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1651)
……………………………………………………………… java
當咱們在搭建Struts二、Spring、Hibernate框架的時候。框架
遇到一個問題,工程發佈後執行hibernate語句會報錯:java.lang.NoSuchMethodError: antlr.collections.AST.getLine(),eclipse
之前已經據說過是個jar包衝突的問題,原來也算SSH整合時一個經典的bug(主要怪MyEclipse):hibernate
Struts自帶的antlr-2.7.2.jar與Hibernate3.3自帶的antlr-2.7.6.jar發生衝突,須要刪除舊的jar包.雖然過程麻煩點不過總算搞好了,最後總結以下:ip
在MyEclipse的configuration\org.eclipse.osgi\bundles目錄下搜索antlr-2.7.2.jar,刪除全部antlr-2.7.2的jar包文件;在MyEclipse的Common\plugins目錄中get
搜索 *struts*.jar總共有3個jar包,用winRAR之類的軟件將其打開,刪除lib或者data下的antlr-2.7.2.jar文件。it