java 抛出No SqlMapClient specified异常。如何解决?
2012-05-2813:56:14,435WARN(AbstractExceptionHandler.java:95)-Unhandledexceptionjava.l...
2012-05-28 13:56:14,435 WARN (AbstractExceptionHandler.java:95) - Unhandled exception
java.lang.IllegalArgumentException: No SqlMapClient specified
at org.springframework.util.Assert.notNull(Assert.java:113)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:163)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241)
at com.aspire.boc.mms.sp.dao.impl.UserInfoDAOImpl.selectUserInfo(UserInfoDAOImpl.java:38)
at com.aspire.boc.mms.sp.struts.action.ListAction.getAppIdByUsername(ListAction.java:109)
at com.aspire.boc.mms.sp.struts.action.ListAction.execute(ListAction.java:86)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
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:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward
解决了。是因为new了一个UserInfoDAOImpl,而不是通过context.getBean()的方式,所以报了这个错。 展开
java.lang.IllegalArgumentException: No SqlMapClient specified
at org.springframework.util.Assert.notNull(Assert.java:113)
at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:163)
at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241)
at com.aspire.boc.mms.sp.dao.impl.UserInfoDAOImpl.selectUserInfo(UserInfoDAOImpl.java:38)
at com.aspire.boc.mms.sp.struts.action.ListAction.getAppIdByUsername(ListAction.java:109)
at com.aspire.boc.mms.sp.struts.action.ListAction.execute(ListAction.java:86)
at org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
at org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
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:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
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.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at org.apache.catalina.core.ApplicationDispatcher.forward
解决了。是因为new了一个UserInfoDAOImpl,而不是通过context.getBean()的方式,所以报了这个错。 展开
5个回答
展开全部
UserInfoDAOImpl.java:38)
找找这个数据库实现类所对应的ibaties中的sql吧,估计sql写错了或者是那个xml文件里面有些东西没定义。
找找这个数据库实现类所对应的ibaties中的sql吧,估计sql写错了或者是那个xml文件里面有些东西没定义。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
麻烦能具体说下如何解决的么!我也遇到了这个问题!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
看看ibatis的配置是不是没写对
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询