Java教程

java.lang.IllegalArgumentException: node to traverse cannot be null!

本文主要是介绍java.lang.IllegalArgumentException: node to traverse cannot be null!,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

报错信息:

java.lang.IllegalArgumentException: node to traverse cannot be null!
 at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:31)
 at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:254)
 at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:157)
 at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:111)
 at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:77)
 at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:56)
 at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:72)
 at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:133)
 at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:112)
 at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1623)
 at com.cqa.core.common.dao.EntityDaoImpl.findPage(EntityDaoImpl.java:154)
 at com.cqa.service.vip.znx.ZnxServiceImpl.findMemberMail(ZnxServiceImpl.java:10)
 at com.cqa.service.vip.znx.ZnxServiceImpl$$FastClassByCGLIB$$b3302b8d.invoke()
 at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
 at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:714)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:162)
 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
 at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:652)
 at com.cqa.service.vip.znx.ZnxServiceImpl$$EnhancerByCGLIB$$6bde40b5.findMemberMail()
 at com.cqa.action.vip.znx.VipZnxAction.loadMemberMail(VipZnxAction.java:41)
 at com.cqa.action.vip.znx.VipZnxAction.show(VipZnxAction.java:23)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)

解决方法:

      通常此类错误都是由于HQL语句写的不正确,例如from写成了form,或者set A = 1 and B = 2,其中set不同字段用逗号","分离而不是用and.总之仔细检查HQL语句,看看有没有语法错误即可.


这篇关于java.lang.IllegalArgumentException: node to traverse cannot be null!的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!