log4j:WARN Please initialize the log4j system properly.

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.<init>(HQLQueryPlan.java:77)

 at org.hibernate.engine.query.HQLQueryPlan.<init>(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 org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:919)

 at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419)

 at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)

 at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:917)

 at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:909)

 at com.dragon.dao.impl.UserInfoDaoImpl.getAllUserInfo(UserInfoDaoImpl.java:36)

 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)

 at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)

 at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)

 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)

 at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)

 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

 at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)

 at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)

 at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)

 at $Proxy4.getAllUserInfo(Unknown Source)

 at com.dragon.dao.UserInfoDaoImplTest.testGetAllUserInfo(UserInfoDaoImplTest.java:25)

 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)

 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:73)

 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:46)

 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)

 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)

 at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)

 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)

 at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

 at org.junit.runners.ParentRunner.run(ParentRunner.java:220)

 at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)

 at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

 at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


node to traverse cannot be null 的意思是遍历的节点不能为空

这是我遇到的问题

String queryString = "from UserInfo ";本应该是这样子

String queryString = "frm UserInfo ";结果写成这样子了

原因因为sql语句写错了

分享一哈自己的错误!希望能对您有所帮助!!哈哈