关闭

java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I

标签: hibernate框架struts2.0spring
447人阅读 评论(0) 收藏 举报
分类:
今天开发一个ssh项目时用myeclipse自动导入ssh的jar包报出以下错误:java.lang.NoSuchMethodError: antlr.collections.AST.getLine()Iorg.hibernate.hql.ast.HqlSqlWalker.generateNamedParameter(HqlSqlWalker.java:931)org.hibernate.hql.antlr.HqlSqlBaseWalker.parameter(HqlSqlBaseWalker.java:4909)org.hibernate.hql.antlr.HqlSqlBaseWalker.expr(HqlSqlBaseWalker.java:1404)org.hibernate.hql.antlr.HqlSqlBaseWalker.exprOrSubquery(HqlSqlBaseWalker.java:4383)org.hibernate.hql.antlr.HqlSqlBaseWalker.comparisonExpr(HqlSqlBaseWalker.java:3859)org.hibernate.hql.antlr.HqlSqlBaseWalker.logicalExpr(HqlSqlBaseWalker.java:1907)org.hibernate.hql.antlr.HqlSqlBaseWalker.whereClause(HqlSqlBaseWalker.java:822)org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:608)org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:292)org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:235)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.(HQLQueryPlan.java:101)org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:80)org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:98)org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1760)com.hnau.dao.UserDAOIMP.isReg(UserDAOIMP.java:56)com.hnau.action.UserAction.register(UserAction.java:41)sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440)com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242)com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138)com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176)com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76)一头雾水问度娘后得知: java.lang.NoSuchMethodError: antlr.collections.AST.getLine()I 的错误。这是因为在struts2自带的antlr-2.7.2.jar包的版本较低。需要换成antlr-2.7.6.jar。其实在项目中已经存在了antlr-2.7.6.jar这个包,现在唯一需要做的就是删除antlr-2.7.2.jar包。选择windows---preferences---在文本框中搜索struts 2(中间有空格)---选择struts 2---选择antlr-2.7.2.jar---Remove---OK。
1
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:38553次
    • 积分:727
    • 等级:
    • 排名:千里之外
    • 原创:32篇
    • 转载:8篇
    • 译文:0篇
    • 评论:8条
    文章分类
    最新评论