An error occurred while combining struts2 and hibernate! -- Java. Lang. nosuchmethoderror: anlr. Collections. Ast. Getline (

Source: Internet
Author: User
Tags apache tomcat

In the past few days, a part-time employee's information entry system has encountered an error where hibernate cannot query the specified condition data. Now we can find a solution:

The error message is as follows:
HTTP status 500-

--------------------------------------------------------------------------------

Type exception report

Message

Description the server encountered an internal error () that prevented it from fulfilling this request.

Exception

Java. Lang. Reflect. invocationtargetexception
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 (defaactionactioninvocation. Java: 242)
Com. opensymphony. xwork2.interceptor. defaultworkflowinterceptor. dointercept (defaworkworkflowinterceptor. Java: 163)
Com. opensymphony. xwork2.interceptor. methodfilterinterceptor. Intercept (methodfilterinterceptor. Java: 87)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. 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 (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. conversionerrorinterceptor. Intercept (conversionerrorinterceptor. Java: 122)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. 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 (defaactionactioninvocation. 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 (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. staticparametersinterceptor. Intercept (staticparametersinterceptor. Java: 148)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. checkboxinterceptor. Intercept (checkboxinterceptor. Java: 93)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. fileuploadinterceptor. Intercept (fileuploadinterceptor. Java: 235)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. modeldriveninterceptor. Intercept (modeldriveninterceptor. Java: 89)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. scopedmodeldriveninterceptor. Intercept (scopedmodeldriveninterceptor. Java: 128)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. profilingactivationinterceptor. Intercept (profilingactivationinterceptor. Java: 104)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. debugging. debugginginterceptor. Intercept (debugginginterceptor. Java: 267)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. chaininginterceptor. Intercept (chaininginterceptor. Java: 126)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. 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 (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. i18ninterceptor. Intercept (i18ninterceptor. Java: 148)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. servletconfiginterceptor. Intercept (servletconfiginterceptor. Java: 164)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. aliasinterceptor. Intercept (aliasinterceptor. Java: 128)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. exceptionmappinginterceptor. Intercept (exceptionmappinginterceptor. Java: 176)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org.apache.struts2.impl.strutsactionproxy.exe cute (strutsactionproxy. Java: 52)
Org. Apache. struts2.dispatcher. Dispatcher. serviceaction (dispatcher. Java: 468)
Org. Apache. struts2.dispatcher. filterdispatcher. dofilter (filterdispatcher. Java: 395)

Root Cause

Java. Lang. nosuchmethoderror: anlr. Collections. Ast. Getline () I
Org. hibernate. hql. Ast. hqlsqlwalker. generatepositionalparameter (hqlsqlwalker. Java: 896)
Org. hibernate. hql. anlr. hqlsqlbasewalker. parameter (hqlsqlbasewalker. Java: 4819)
Org. hibernate. hql. anlr. hqlsqlbasewalker. expr (hqlsqlbasewalker. Java: 1373)
Org. hibernate. hql. anlr. hqlsqlbasewalker. exprorsubquery (hqlsqlbasewalker. Java: 4243)
Org. hibernate. hql. anlr. hqlsqlbasewalker. comparisonexpr (hqlsqlbasewalker. Java: 3725)
Org. hibernate. hql. anlr. hqlsqlbasewalker. logicalexpr (hqlsqlbasewalker. Java: 1864)
Org. hibernate. hql. anlr. hqlsqlbasewalker. logicalexpr (hqlsqlbasewalker. Java: 1789)
Org. hibernate. hql. anlr. hqlsqlbasewalker. whereclause (hqlsqlbasewalker. Java: 818)
Org. hibernate. hql. anlr. hqlsqlbasewalker. Query (hqlsqlbasewalker. Java: 604)
Org. hibernate. hql. anlr. hqlsqlbasewalker. selectstatement (hqlsqlbasewalker. Java: 288)
Org. hibernate. hql. anlr. 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)
Org. springframework. Orm. hibernate3.hibernatetemplate $30. doinhibernate (hibernatetemplate. Java: 923)
Org. springframework. Orm. hibernate3.hibernatetemplate. doexecute (hibernatetemplate. Java: 419)
Org.springframework.orm.hibernate3.hibernatetemplate.exe cutewithnativesession (hibernatetemplate. Java: 374)
Org. springframework. Orm. hibernate3.hibernatetemplate. Find (hibernatetemplate. Java: 921)
Com. wgk. Dao. impl. userdaoimpl. Get (userdaoimpl. Java: 54)
Com. wgk. Service. impl. userserviceimpl. Get (userserviceimpl. Java: 86)
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)
Org. springframework. AOP. Support. aoputils. invokejoinpointusingreflection (aoputils. Java: 307)
Org. springframework. AOP. Framework. reflectivemethodinvocation. invokejoinpoint (reflectivemethodinvocation. Java: 182)
Org. springframework. AOP. Framework. reflectivemethodinvocation. Proceed (reflectivemethodinvocation. Java: 149)
Org. springframework. transaction. Interceptor. transactioninterceptor. Invoke (transactioninterceptor. Java: 106)
Org. springframework. AOP. Framework. reflectivemethodinvocation. Proceed (reflectivemethodinvocation. Java: 171)
Org. springframework. AOP. Interceptor. exposeinvocationinterceptor. Invoke (exposeinvocationinterceptor. Java: 89)
Org. springframework. AOP. Framework. reflectivemethodinvocation. Proceed (reflectivemethodinvocation. Java: 171)
Org. springframework. AOP. Framework. jdkdynamicaopproxy. Invoke (jdkdynamicaopproxy. Java: 204)
$ Proxy0.get (unknown source)
Com.wgk.action.loginaction.exe cute (loginaction. Java: 39)
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 (defaactionactioninvocation. Java: 242)
Com. opensymphony. xwork2.interceptor. defaultworkflowinterceptor. dointercept (defaworkworkflowinterceptor. Java: 163)
Com. opensymphony. xwork2.interceptor. methodfilterinterceptor. Intercept (methodfilterinterceptor. Java: 87)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. 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 (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. conversionerrorinterceptor. Intercept (conversionerrorinterceptor. Java: 122)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. 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 (defaactionactioninvocation. 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 (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. staticparametersinterceptor. Intercept (staticparametersinterceptor. Java: 148)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. checkboxinterceptor. Intercept (checkboxinterceptor. Java: 93)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. fileuploadinterceptor. Intercept (fileuploadinterceptor. Java: 235)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. modeldriveninterceptor. Intercept (modeldriveninterceptor. Java: 89)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. scopedmodeldriveninterceptor. Intercept (scopedmodeldriveninterceptor. Java: 128)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. profilingactivationinterceptor. Intercept (profilingactivationinterceptor. Java: 104)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. debugging. debugginginterceptor. Intercept (debugginginterceptor. Java: 267)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. chaininginterceptor. Intercept (chaininginterceptor. Java: 126)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. 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 (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. i18ninterceptor. Intercept (i18ninterceptor. Java: 148)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org. Apache. struts2.interceptor. servletconfiginterceptor. Intercept (servletconfiginterceptor. Java: 164)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. aliasinterceptor. Intercept (aliasinterceptor. Java: 128)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Com. opensymphony. xwork2.interceptor. exceptionmappinginterceptor. Intercept (exceptionmappinginterceptor. Java: 176)
Com. opensymphony. xwork2.defaultactioninvocation. Invoke (defaactionactioninvocation. Java: 236)
Org.apache.struts2.impl.strutsactionproxy.exe cute (strutsactionproxy. Java: 52)
Org. Apache. struts2.dispatcher. Dispatcher. serviceaction (dispatcher. Java: 468)
Org. Apache. struts2.dispatcher. filterdispatcher. dofilter (filterdispatcher. Java: 395)

Note the full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

--------------------------------------------------------------------------------

Apache Tomcat/6.0.20

Symptom: You can obtain the business logic bean in the main method to query the database. However, you can call the business logic to query the database by passing parameters to the action on the webpage,
This exception prompt appears.
Cause: there is a conflict between the two jar packages in the project: antlr-2.7.6.jar and anltr-2.7.2.jar. Remove the anltr-2.7.2.jar package.
The reason for smooth execution in the main method is that the anlr. jar package is dependent on struts2. If you do not pass parameters on a webpage, you do not need them, so they can be executed smoothly.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/im110/archive/2009/09/29/4617310.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.