org.hibernate.hql.antlr.HqlBaseParser.identPrimary(HqlBaseParser.java:4065) org.hibernate.hql.antlr.HqlBaseParser.primaryExpression(HqlBaseParser.java:861) org.hibernate.hql.antlr.HqlBaseParser.atom(HqlBaseParser.java:3438) org.hibernate.hql.antlr.HqlBaseParser.unaryExpression(HqlBaseParser.java:3216) org.hibernate.hql.antlr.HqlBaseParser.multiplyExpression(HqlBaseParser.java:3098) org.hibernate.hql.antlr.HqlBaseParser.additiveExpression(HqlBaseParser.java:2818) org.hibernate.hql.antlr.HqlBaseParser.concatenation(HqlBaseParser.java:570) org.hibernate.hql.antlr.HqlBaseParser.relationalExpression(HqlBaseParser.java:2586) org.hibernate.hql.antlr.HqlBaseParser.equalityExpression(HqlBaseParser.java:2542) org.hibernate.hql.antlr.HqlBaseParser.negatedExpression(HqlBaseParser.java:2413) org.hibernate.hql.antlr.HqlBaseParser.logicalAndExpression(HqlBaseParser.java:2331) org.hibernate.hql.antlr.HqlBaseParser.logicalOrExpression(HqlBaseParser.java:2296) org.hibernate.hql.antlr.HqlBaseParser.expression(HqlBaseParser.java:2082) org.hibernate.hql.antlr.HqlBaseParser.logicalExpression(HqlBaseParser.java:1858) org.hibernate.hql.antlr.HqlBaseParser.whereClause(HqlBaseParser.java:454) org.hibernate.hql.antlr.HqlBaseParser.queryRule(HqlBaseParser.java:708) org.hibernate.hql.antlr.HqlBaseParser.selectStatement(HqlBaseParser.java:296) org.hibernate.hql.antlr.HqlBaseParser.statement(HqlBaseParser.java:159) org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:248) org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157) org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111) org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:77) org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:56) org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72) org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133) org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112) org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623) org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:919) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917) org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:909) eBay.dao.SystemUserDao.findUser(SystemUserDao.java:14) eBay.service.LoginService.login(LoginService.java:34) eBay.action.LoginAction.login(LoginAction.java:54) 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:453) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:292) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:255) org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:256) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:265) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:138) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:211) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:90) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:145) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:171) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:192) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:511) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.42 logs.
解决方法:
1检查hql
这个错误是在页面中报出的:是hql语言出错了:
from systemuser where username=‘"+username+"’and password=‘"+password+“’”);
应该改成:from SystemUser where username=‘"+username+"’and password=‘"+password+“’”);
2,antlr包的版本问题
注意:hql语言是面向对象的 所有的东西是按照实体类来查询的 不是按照sql思路从第存数据开始看的;
这也是hibernate的成功之处;
题外话:hibernate的鼻祖 原来不会sql语言;在做项目是吃了大亏 然后就突发奇想 自己研究出来hibernate 让那些不会sql语句的人 也能实现sql相同的功能