jeecgboot / JeecgBoot

🔥「企业级低代码平台」前后端分离架构SpringBoot 2.x/3.x,SpringCloud,Ant Design&Vue3,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式,引入AI模型能力 OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。
http://www.jeecg.com
Apache License 2.0
40.65k stars 14.84k forks source link

Consider defining a bean of type 'org.jeecg.config.JeecgBaseConfig' in your configuration. #5913

Closed xiamaocheng closed 8 months ago

xiamaocheng commented 8 months ago
版本号:

v3.6.2

前端版本:vue3版?还是 vue2版?

vue3

问题描述:

demo 工程 升级微服务

截图&代码:

Description:

A component required a bean of type 'org.jeecg.config.JeecgBaseConfig' that could not be found.

Consider defining a bean of type 'org.jeecg.config.JeecgBaseConfig' in your configuration.

Action: 工程clean 不行

zhangdaiscott commented 8 months ago

改了什么?默认不应该出这个问题

xiamaocheng commented 8 months ago

低版本的jeecg-module-demo 升级为微服务遇到的: 参考文档:https://blog.csdn.net/zhangdaiscott/article/details/108094170,按照这个步骤报上述异常,多谢

xiamaocheng commented 8 months ago

已经注释了base-core的依赖, 如下:

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

jeecg-boot-parent org.jeecgframework.boot 3.6.1
<modelVersion>4.0.0</modelVersion>
<artifactId>jeecg-module-em</artifactId>

<dependencies>
    <dependency>
        <groupId>net.sf.dozer</groupId>
        <artifactId>dozer</artifactId>
        <version>5.5.1</version>
    </dependency>

    <dependency>
        <groupId>com.jcraft</groupId>
        <artifactId>jsch</artifactId>
        <version>0.1.55</version> <!-- 或者是最新的版本 -->
    </dependency>
    <!-- 其他依赖项 -->

    <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>1.5.3.Final</version>
    </dependency>
    <dependency>
        <groupId>org.projectlombok</groupId>
        <artifactId>lombok</artifactId>
        <version>1.18.24</version>
    </dependency>
    <dependency>
        <groupId>org.eclipse.paho</groupId>
        <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
        <version>1.2.5</version>
    </dependency>
    <!--mapStruct依赖 高性能对象映射-->
    <!--mapstruct核心-->
    <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct</artifactId>
        <version>1.5.0.Beta1</version>
    </dependency>
    <!--mapstruct编译-->
    <dependency>
        <groupId>org.mapstruct</groupId>
        <artifactId>mapstruct-processor</artifactId>
        <version>1.5.0.Beta1</version>
    </dependency>

    <!-- https://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.3.3</version>
    </dependency>

    <!-- 获取系统信息 -->
    <dependency>
        <groupId>com.github.oshi</groupId>
        <artifactId>oshi-core</artifactId>
        <version>5.8.2</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <!-- 避免excel文件压缩破坏 -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>3.2.0</version>
            <configuration>
                <encoding>UTF-8</encoding>
                <nonFilteredFileExtensions>
                    <nonFilteredFileExtension>xls</nonFilteredFileExtension>
                </nonFilteredFileExtensions>
            </configuration>
        </plugin>
    </plugins>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
        </resource>
        <resource>
            <directory>src/main/java</directory>
            <includes>
                <include>**/*.xml</include>
                <include>**/*.json</include>
                <include>**/*.ftl</include>
                <include>template/**</include>
            </includes>
        </resource>
    </resources>
</build>

但是依然报错:

Description:

A component required a bean of type 'org.jeecg.config.JeecgBaseConfig' that could not be found.

Action:

Consider defining a bean of type 'org.jeecg.config.JeecgBaseConfig' in your configuration.

zhangdaiscott commented 8 months ago

jeecgboot默认支持单体和微服务自有切换,具体参考文档 https://help.jeecg.com/java/springcloud/switchcloud/monomer.html