SSM整合问题汇总

问题一:java.sql.SQLException: Access denied for user '121'@'localhost' (using password: YES)

**解决方法:**
jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/ssmbuild?useSSL=false&useUnicode=true&characterEncoding=utf8
jdbc.username=root
jdbc.password=root
在属性前面加上jdbc前缀,问题解决。

问题二:Caused by: java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors

**解决方法:**
jdbc.url=jdbc:mysql://localhost:3306/ssmbuild?useSSL=true&useUnicode=true&characterEncoding=utf8中的useSSL改为false

问题三:Spring 编程式事务管理xml文件配置问题org.springframework.beans.NotWritablePropertyException: Invalid property
解决方法:

<!-- 配置事务管理器 -->
    <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">

        <!--注入数据库连接池-->
        <property name="dataSource " ref="dataSource"/>

    </bean>
中property属性中name的dataSource多了一个空格。

问题四:mybatis报错:A query was run and no Result Maps were found for the Mapped Statement
解决方法:mybatis中的所有查询,都必须返回resultType或者resultMap的值,否则就会报如上错误的。

问题五:java.lang.ClassNotFoundException: org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException
解决方法:
缺少jar包,只要导入一个aspectjweaver.jar就可以了

<dependency>

      <groupId>org.aspectj</groupId>

      <artifactId>aspectjweaver</artifactId>

      <version>1.9.4<version>

    </dependency>

原文地址:https://www.cnblogs.com/ITHSZ/p/13916153.html