日期:2014-05-20  浏览次数:20724 次

ibatis创建SqlMapClient对象报错!
String resource="sql-map-config.xml";
Reader reader;
try {
reader=Resources.getResourceAsReader(resource);
SqlMapClient sqlMap=SqlMapClientBuilder.buildSqlMapClient(reader);
}catch(IOException e)
{
e.printStackTrace();
}
在新建sqlMap对象时报错:
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

求教!!!

------解决方案--------------------
探讨
String resource="sql-map-config.xml";
Reader reader;
try {
reader=Resources.getResourceAsReader(resource);
SqlMapClient sqlMap=SqlMapClientBuilder.buildSqlMapClient(reader);
}catch(IOException e)……

------解决方案--------------------
你没有引入commons-logging.jar包,当然找不到那个类了
------解决方案--------------------
探讨
<typeAlias alias="caiXinBean" 这里没有空格,这里要隔开啊 type="entity.CaiXinBean"/>