Idea开发JAVA过程中遇到的错误集合以及解决方法,持续更新

这篇博客汇总了在Idea中开发JAVA时遇到的各种错误,如:swagger注解找不到、Spring Bean创建异常、Java语言版本问题、找不到主类、Maven/Gradle依赖问题、webpack命令缺失等,并提供了详细的解决办法。
摘要由CSDN通过智能技术生成

目录

错误1:Error:(4, 30) java: 程序包io.swagger.annotations不存在

  错误2:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goodsController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.

  错误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 可

  • 2
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值