spring-boot - Springboot别名'Int'已经映射到值'java.lang.Integer'
问题描述
当我重命名应用程序包名并尝试启动 springboot 时,我收到一条错误消息。错误信息如下:
17:36:19.198 [restartedMain] WARN osbwscAnnotationConfigServletWebServerApplicationContext - [log,87] - 上下文初始化期间遇到异常 - 取消刷新尝试:org.springframework.beans.factory.BeanCreationException:在类路径资源中定义名称为“objectMapperConfigurer”的 bean 创建错误[springfox/documentation/spring/web/SpringfoxWebMvcConfiguration.class]:bean实例化之前的BeanPostProcessor失败;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:在类路径资源 [net/changhai/framework/config/ShiroConfig.class] 中定义名称为“authorizationAttributeSourceAdvisor”的 bean 创建时出错:通过方法“authorizationAttributeSourceAdvisor”参数 0 表示的依赖关系不满足; 嵌套异常是 org. springframework.beans.factory.UnsatisfiedDependencyException:在类路径资源[net/changhai/framework/config/ShiroConfig.class]中定义的名称为'shiroFilterFactoryBean'的bean创建时出错:通过方法'shiroFilterFactoryBean'参数0表示的不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:在类路径资源 [net/changhai/framework/config/ShiroConfig.class] 中定义名称为 'securityManager' 的 bean 创建错误:通过方法 'securityManager' 参数 0 表达的不满足的依赖关系; 嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:创建名为 'userRealm' 的 bean 时出错:通过字段 'menuService' 表达的依赖关系不满足;嵌套异常是 org.springframework。beans.factory.UnsatisfiedDependencyException:创建名为“sysMenuServiceImpl”的bean时出错:通过字段“menuMapper”表示不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.UnsatisfiedDependencyException:在文件 [D:\dev\cube2\ch-system\target\classes\net\changhai\system\mapper\SysMenuMapper. class]:通过 bean 属性 'sqlSessionFactory' 表达的不满足的依赖关系;嵌套异常是 org.springframework.beans.factory.BeanCreationException:在类路径资源 [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class] 中定义名称为“sqlSessionFactory”的 bean 创建时出错:通过工厂方法进行的 bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化[org.apache.ibatis.session.SqlSessionFactory]:工厂方法'sqlSessionFactory'抛出异常;嵌套异常是 org.apache.ibatis.type.TypeException:别名“Int”已映射到值“java.lang.Integer”。
解决方案
看来您正在将别名“Int”绑定到某个类。默认情况下它绑定到 java.lang.Integer,所以它被 MyBatis 保存,你不应该将它重新绑定到另一个。
推荐阅读
- go - golang嵌套切片中删除元素的奇怪行为
- sql - 如何根据教师ID检索学生数据
- java - 无法到达的 catch 块:InvalidFormatException 的无法到达的 catch 块
- java - 为什么 CollectionUtils.subtract 会产生 Casting 警告?
- python - 使用python工具的pip安装问题
- reactjs - 在 ChoiceGroup 中动态获取选项时如何更改选项样式?
- angular - 角度 7 路由到相同的组件但不同的参数不起作用
- python - Python 相当于 Ruby 的 .find
- postgresql - SQL DB中动态排序查询性能优化设计模式
- php - PHP测验数组随机显示