在整合ssm框架的时候出现了一些错误,在这里记录一下解决方法 。以供参考:
1.Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService': Initialization of bean failed; nested exception is java.lang.AbstractMethodError
2.Handler dispatch failed; nested exception is java.lang.AbstractMethodError: Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.isClosed()Z is abstract
3.
The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application
错误1:sqlsessionfactory 创建失败无法注入
应该是配置文件出现问题
我在检查之后,发现在applicationContextxml文件中配置工厂出现错误
在引入连接池配置的时候,把标签名写成value 所以总是创建失败
<!--配置SqlSessionFactory工厂-->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource"/>
<!-- <property name="dataSource" value="dataSource"-->
错误2:c3p0连接池错误,这个原因是由于版本太低导致的
我使用的数据库是8.0版本,把数据库连接池版本调整到0.9.5.1 发现还是这个错,
于是去maven官网发现最高版本是0.9.5.4 改用此版本,问题解决
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.4</version>
</dependency>
错误3:[http://java.sun.com/jsp/jstl/core 在jsp文件中共引入,但是pom.xml中没有进行相应配置,所以报错
需要配置jstl
<!--jstl 配置-->
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-spec</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
修改后,运行成功!