目录
错误1:Error:(4, 30) java: 程序包io.swagger.annotations不存在
错误3:Diamond types are not supported at language level ‘6’
错误4:Error:java: Compilation failed: internal java compiler error
错误5:程序包com.sun.xml.internal.messaging.saaj.util不存在
错误6:idea中编译项目时报错:错误: 找不到或无法加载主类 com.xxxx.xxx.Application
错误7:cmd窗口运行npm run dev 报错 'webpack-dev-server' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
错误8: IntelliJ Idea解决Could not autowire. No beans of 'xxxx' type found的错误提示
错误9:Intellij IDEA Cannot resolve symbol XXX 问题解决办法汇总
错误10:运行报错Cannot find module @babel/compat-data/corejs3-shipped-proposals
提示:这篇博文是记录自己在使用Idea开发JAVA过程中遇到的错误集合以及解决方法,可以自行搜索是否有你遇到的坑,说不定就中奖了~ 将持续更新!
错误1:Error:(4, 30) java: 程序包io.swagger.annotations不存在
描述:无法识别的注解@ApiModel
解决办法:下载io.springfox:springfox-swagger2:2.8.0 依赖,这里使用的是Gradle来管理依赖,如果是Maven请自行搜索配置方式
错误2:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goodsController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.
BeanCreationException: Error creating bean with name 'goodsService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'goodsDao' defined in file [D:\idea_project\testgradleJDBC\out\production\classes\cn\lixp\testgradle\goods\dao\GoodsDao.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [D:\idea_project\testgradleJDBC\out\production\resources\mapper\GoodsMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [D:\idea_project\testgradleJDBC\out\production\resources\mapper\GoodsMapper.xml]'. Cause: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibatis.type.TypeException: Could not resolve type alias 'cn.lixp1.testgradle.goods.entity.goodsInfo'. Cause: java.lang.ClassNotFoundException: Cannot find class: cn.lixp1.testgradle.goods.entity.goodsInfo
分析:这NM 也太长了~,重点看加粗部分,说人话就是“资源依赖项的注入失败”, 该错误发生的场景需要介绍下,项目中使用了Mybits框架
MyBatis 是支持普通 SQL 查询,存储过程和高级映射的优秀持久层框架。 MyBatis 消除了几乎所有的 JDBC 代码和参数的手工设置以及对结果集的检索。MyBatis 可