ssm框架整合报错总结

在整合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>

 修改后,运行成功!

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值