hibernate报NullPointerException,求解答

 我来答
你郎仙9276
2017-10-30 · 超过23用户采纳过TA的回答
知道答主
回答量:58
采纳率:0%
帮助的人:37.2万
展开全部
String HqlString="select new cn.hnedu.jyjk.vo.OldXjStudent" + "(t.yxdm, t.xh, t.xm, t.sfzhm," + " t.byslxdh, t.jtlxdh, t., t.email, " + " t.xbdm, t.xldm, t.zydm, t.sfsfbz, t.sfsfbz as sfslbdm, t.pyfsdm, t.xz, t.mzdm, t.zzmmdm, t.rxsj,convert(nvarchar,t.nbynf) as bysj," + " t.zxwyyzdm, t.syszddm, t.remark8 as jtdz, " + " t.jtyzbm, t.ksh, t.kslbdm, t.xysbh, t.x as kzx6, t.wpdxdw, t.bjhm,convert(nvarchar,t.stuYear) as kzx8, t.jyknlbdm, " + " b.byqxdm, b.bdzqflbdm, b.bdzdwmc as dwmc, b.dwdm, b.bdzdwdzx as dwszddm, b.dwxzdm, b.jylbdm, " + " b.jyzkdm, b.bdzbz as kzx1, b.gyname as kzx5, b.zzjgdm as dwzzjg, b.dwhydm, b.zwlbdm as gzzwlbdm, b.gyszdx as sjdwszddm, b.dwlxfs as dwdh, " + " b.byzsbh as byzh, b.dajsdwmc as dajsdw, b.dajsdwdzx as dajsdwszd, b.dajsdwyzbm as dajsdwyb, b.dajsdwlxr, b.dajsdwlxdh as dajsdwdh) ";List oldsList = this.getJyzxByqxLogic().find(HqlString+ " from JyzxJsstudent t,JyzxByqx b where t.xldm=b.xldm and t.stuYear= + this.get_mr_year(jyzxXxuser.getXxdm()) + and t.byszgrz=1 ORDER BY t.bjhm,t.xh");没做映射文件,直接new 的对象。是将2张有映射的表的数据集合到新对象上。。但是tomat报hibernate里面的一个get构造方法的空指针异常。但是我明明写了构造方法的。没写的话也不是报这个错,是报的没有合适的构造方法这个错啊。求大家帮我看看问题出在哪里?tomat报错如下Plain Text code?1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 java.lang.NullPointerException at org.hibernate.util.ReflectHelper.getConstructor(ReflectHelper.java:172) at org.hibernate.hql.ast.tree.ConstructorNode.resolveConstructor(ConstructorNode.java:114) at org.hibernate.hql.ast.tree.ConstructorNode.prepare(ConstructorNode.java:88) at org.hibernate.hql.ast.HqlSqlWalker.processConstructor(HqlSqlWalker.java:840) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExpr(HqlSqlBaseWalker.java:1956) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectExprList(HqlSqlBaseWalker.java:1825) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectClause(HqlSqlBaseWalker.java:1394) at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:553) at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:281) at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:229) at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:228) at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:160) 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 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 cn.hnedu.jyjk.dao.impl.JyzxByqxDAO.find(JyzxByqxDAO.java:148) at cn.hnedu.jyjk.service.impl.JyzxByqxServiceImpl.find(JyzxByqxServiceImpl.java:33) at cn.hnedu.jyjk.web.xx.XxAction.exportByqxDBFtoOldSystem(XxAction.java:1171) at cn.hnedu.jyjk.web.xx.XxAction.doExecute(XxAction.java:104) at cn.hnedu.jyjk.web.XxuserAuditAction.execute(XxuserAuditAction.java:26) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462) at javax.servlet.http.HttpServlet.service(HttpServlet.java:643) at javax.servlet.http.HttpServlet.service(HttpServlet.java:723) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227) at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690) at java.lang.Thread.run(Thread.java:619)hibernate报NullPointerException,求解答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式