spring错误集
- 1. Mapper.xml中的SQL语句错误导致的
- 2. java.io.IOException: Could not find resource mybatis-config.xml
- 3. ERROR:Caused by: java.lang.ClassNotFoundException: com.alibaba.fastjson.JSON
- 4. 端口占用异常
- 5. springBoot启动错误
- 6. 数据库版本问题:
- 7. IDEA中Maven项目的web.xml中报错:cannot resolve servlet 'spring-mvc'
- 8. org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 19
- 9.No qualifying bean of type 'java.util.concurrent.ScheduledExecutorService' available
- 10. org.apache.ibatis.binding.BindingException: Type interface com.hh.mapper.UserMapper is not known to the MapperRegistry.
- 11.exec-maven-plugin:3.0.0:exec (default-cli) on project mybatis-01: Command execution failed.
- 12. maven install 时报:Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12.4:test
- 13. BeanInitializationException 异常
1. Mapper.xml中的SQL语句错误导致的
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'deletes from mybatis.user where id=5' at line 1
deletes from mybatis.user where id=#{id}; 错误
delete from mybatis.user where id=#{id};
<delete id="deleteUser" parameterType="int">
delete from mybatis.user where id=#{
id};
</delete>
2. java.io.IOException: Could not find resource mybatis-config.xml
异常:
java.io.IOException: Could not find resource mybatis-config.xml
解决:
<build>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.properties</include>
<include>**/*.xml</include>
</includes>