Tag Archives: javaEE

[Solved] error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver

error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver

July 08, 2019 2:39:14 PM com.alibaba.druid.pool.DruidDataSource error
WARNING:error {dataSource-1} init error java.sql.SQLException: com.mysql.cj.jdbc.Driver
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:520)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:583)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:598)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:655)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:686)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
	at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:776)
	at edu.haizi.dao.UserDao.login(UserDao.java:17)
	at edu.haizi.test.UserDaoTest.testLogin(UserDaoTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:518)
	... 36 more

July 08, 2019 2:39:14 PM com.alibaba.druid.pool.DruidDataSource info
MESSAGES:{dataSource-1} inited

org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driver

	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:598)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:655)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:686)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:698)
	at org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:776)
	at edu.haizi.dao.UserDao.login(UserDao.java:17)
	at edu.haizi.test.UserDaoTest.testLogin(UserDaoTest.java:15)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.sql.SQLException: com.mysql.cj.jdbc.Driver
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:520)
	at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:583)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:915)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:911)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:98)
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
	... 29 more
Caused by: java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:264)
	at com.alibaba.druid.util.JdbcUtils.createDriver(JdbcUtils.java:518)
	... 36 more


Process finished with exit code -1

Solution: the version of MySQL under windows is higher than idea, which makes the version incompatible

Modify Maven dependency package

Original version 5.1.9

<dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>5.1.9</version>
    </dependency>

Modify to a later version

<dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.28</version>
    </dependency>

[Solved] Error updating database. Cause: java.sql.SQLException: Incorrect integer value: ‘**‘ for column

### Error updating database. Cause: java.sql.SQLException: Incorrect integer value: ‘**‘ for column

Type Exception Report

Message Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException:

Description The server encountered an unexpected condition that prevented it from completing the request.

Exceptions

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
### The error may exist in com/bjpowernode/dao/StudentDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into student(name,age) values(?,?)
### Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)


org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
### The error may exist in com/bjpowernode/dao/StudentDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into student(name,age) values(?,?)
### Cause: java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
	org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:199)
	org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	com.sun.proxy.$Proxy14.insert(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
	com.sun.proxy.$Proxy15.insertStudent(Unknown Source)
	com.bjpowernode.service.impl.StudentServiceImpl.addStudent(StudentServiceImpl.java:19)
	com.bjpowernode.controller.StudentController.addStudent(StudentController.java:26)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)


java.sql.SQLException: Incorrect integer value: '刘文' for column 'name' at row 1
	com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
	com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
	com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
	com.mysql.cj.jdbc.ClientPreparedStatement.execute(ClientPreparedStatement.java:371)
	com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:498)
	org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:47)
	org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74)
	org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50)
	org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
	org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:197)
	org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:184)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	com.sun.proxy.$Proxy14.insert(Unknown Source)
	org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
	org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62)
	org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:58)
	com.sun.proxy.$Proxy15.insertStudent(Unknown Source)
	com.bjpowernode.service.impl.StudentServiceImpl.addStudent(StudentServiceImpl.java:19)
	com.bjpowernode.controller.StudentController.addStudent(StudentController.java:26)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	java.lang.reflect.Method.invoke(Method.java:498)
	org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
	org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
	org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
	org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
	org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
):Note that the full stack information for the main issue can be viewed in the server logs

 

Solution:

The reason is that I mistakenly wrote the name type as int type. Open navicate to find the created table, right-click to find the design table, and change the name type to varchar

 

Mybatis reports an error (error building sqlsession.) when using annotations without deleting redundant files

First, the SQL statement is read by using the mapping configuration file
the file is iuserdao.xml, as follows:

package com.wwh.dao;

import com.wwh.domain.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created By DELL on 2021/10/21-17:41
 * Persistence layer interface for users
 */
public interface IUserDao {
    /**
     * Query all operations
     * @return
     */
    @Select("select * from user")
    List<User> findAll();
}

The main profile is:


```css
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--The main configuration file for mybatis - >
<configuration>
    <! --configuration-environments-->
    <environments default="mysql">
        <! --configure the type of mysql -->
        <environment id="mysql">
            <! --configure the type of transaction -->
            <transactionManager type="JDBC"></transactionManager>
            <! -- Configure data source (connection pool) -->
            <dataSource type="POOLED">
                <! -- Configure the four basic information for connecting to the database -- >
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/eesy"/>
                <property name="username" value="root"/>
                <property name="password" value="123456"/>
            </dataSource>

        </environment>
    </environments>

    <! -- Specify the location of the mapping profile, the mapping profile refers to a separate profile for each dao
        If the configuration is done with annotations, the class attribute should be used here to specify the fully qualified class name of the annotated dao
    -->
    <mappers>
        <mapper resource="com/wwh/dao/IUserDao.xml"/>
    </mappers>
</configuration>

Then, the SQL is read by annotation, and the main configuration file is changed to:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<!--The main configuration file for mybatis - >
<configuration>
    <! --configuration-environments-->
    <environments default="mysql">
        <! --configure the type of mysql -->
        <environment id="mysql">
            <! --configure the type of transaction -->
            <transactionManager type="JDBC"></transactionManager>
            <! -- Configure data source (connection pool) -->
            <dataSource type="POOLED">
                <! -- Configure the four basic information for connecting to the database -- >
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql://localhost:3306/eesy"/>
                <property name="username" value="root"/>
                <property name="password" value="123456"/>
            </dataSource>

        </environment>
    </environments>

    <! -- Specify the location of the mapping profile, the mapping profile refers to a separate profile for each dao
        If the configuration is done with annotations, the class attribute should be used here to specify the fully qualified class name of the annotated dao
    -->
    <mappers>
        <mapper class="com.wwh.dao.IUserDao"/>
    </mappers>
</configuration>

The notes are:

package com.wwh.dao;

import com.wwh.domain.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created By DELL on 2021/10/21-17:41
 * Persistence layer interface for users
 */
public interface IUserDao {
    /**
     * Query all operations
     * @return
     */
    @Select("select * from user")
    List<User> findAll();
}

When running the mapping configuration file discovery program, it can run through, but when running the annotation program, it is found that an error is reported:

### Error building SqlSession.
### The error may exist in com/wwh/dao/IUserDao.xml
### Cause: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.wwh.dao.IUserDao.findAll
	at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:80)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:64)
	at com.wwh.test.MybatisTest.main(MybatisTest.java:27)
Caused by: org.apache.ibatis.builder.BuilderException: Error parsing SQL Mapper Configuration. Cause: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.wwh.dao.IUserDao.findAll
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:121)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parse(XMLConfigBuilder.java:99)
	at org.apache.ibatis.session.SqlSessionFactoryBuilder.build(SqlSessionFactoryBuilder.java:78)
	... 2 more
Caused by: java.lang.IllegalArgumentException: Mapped Statements collection already contains value for com.wwh.dao.IUserDao.findAll
	at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:872)
	at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:844)
	at org.apache.ibatis.session.Configuration.addMappedStatement(Configuration.java:668)
	at org.apache.ibatis.builder.MapperBuilderAssistant.addMappedStatement(MapperBuilderAssistant.java:302)
	at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parseStatement(MapperAnnotationBuilder.java:351)
	at org.apache.ibatis.builder.annotation.MapperAnnotationBuilder.parse(MapperAnnotationBuilder.java:134)
	at org.apache.ibatis.binding.MapperRegistry.addMapper(MapperRegistry.java:72)
	at org.apache.ibatis.session.Configuration.addMapper(Configuration.java:741)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:381)
	at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:119)
	... 4 more

Process finished with exit code 1

Viewing the error information, we can see that the reason is that your iuserdao.xml has not been deleted. After the annotation method is adopted, the relevant mapping configuration file has no effect. If it is not deleted, an error will be reported (even if it is marked as excluded)
after deletion, you can run through:

Version 1.8.0_201 of the JVM is not suitable for this product. Version: 11 or greater is required.

Eclipse starts with this problem:
Version 1.8.0_201 of the JVM is not suitable for this product. Version: 11 or greater is required.
 
Solution: Open Eclipse.ini and modify it as follows


-Xmx1024m
-startup
plugins/org.eclipse.equinox.launcher_1.5.800.v20200727-1323.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.1300.v20200819-0940
-product
org.eclipse.epp.package.java.product
-showsplash
org.eclipse.epp.package.common
--launcher.defaultAction
openFile
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.8
[email protected]/eclipse-workspace
-XX:+UseG1GC
-XX:+UseStringDeduplication
--add-modules=ALL-SYSTEM
-Dosgi.requiredJavaVersion=1.8
-Dosgi.dataAreaRequiresExplicitInit=true
-Xms256m
-Xmx2048m
--add-modules=ALL-SYSTEM
-vm
-D:\java\jdk\bin\javaw.exe

Add JDK path:
-vm
-D:\java\jdk\bin\javaw.exe
The modified version is 1.8