在构建 SqlSessionFactory的时候出了错误
package com.imooc.db; import java.io.IOException; import java.io.Reader; import org.apache.ibatis.io.Resources; import org.apache.ibatis.session.SqlSession; import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactoryBuilder; /* * 访问数据库 */ public class DBAccess { public SqlSession getSqlSession() throws IOException{ //通过配置文件获取连接数据库连接信息 Reader reader=Resources.getResourceAsReader("com/imooc/config/Configuration.xml"); //通过配置信息来构建一个SqlSessionFactory System.out.println("输出1"); SqlSessionFactory sqlSessionFactory= new SqlSessionFactoryBuilder().build(reader); System.out.println("输出2"); //通过SqlSessionFactory打开一个会话 SqlSession sqlSession=sqlSessionFactory.openSession(); return sqlSession; } } 下面是报的错误 2016-9-5 2:20:02 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet ListName threw exception java.lang.ClassNotFoundException: ognl.PropertyAccessor at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) at org.apache.ibatis.scripting.defaults.RawSqlSource.getSql(RawSqlSource.java:49) at org.apache.ibatis.scripting.defaults.RawSqlSource.<init>(RawSqlSource.java:39) at org.apache.ibatis.scripting.xmltags.XMLScriptBuilder.parseScriptNode(XMLScriptBuilder.java:55) at org.apache.ibatis.scripting.xmltags.XMLLanguageDriver.createSqlSource(XMLLanguageDriver.java:39) at org.apache.ibatis.builder.xml.XMLStatementBuilder.parseStatementNode(XMLStatementBuilder.java:89) at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:132) at org.apache.ibatis.builder.xml.XMLMapperBuilder.buildStatementFromContext(XMLMapperBuilder.java:125) at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:115) at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:89) at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:319) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:104) at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:89) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:49) at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:35) at com.imooc.db.DBAccess.getSqlSession(DBAccess.java:20) at com.imooc.Dao.MessageDao.MessageQuery(MessageDao.java:25) at com.imooc.servicelist.ListService.MessageQuery(ListService.java:14) at com.imooc.Servlet.ListServlet.doGet(ListServlet.java:32) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 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:230) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619)
就是这样子 启动Tomcat 就报错