sixhours-team / memcached-spring-boot

Library that provides support for auto-configuration of Memcached cache in a Spring Boot application.
Apache License 2.0
71 stars 33 forks source link

AutoConfiguration failed in version 2.4.1 with spring boot version 2.1.18.RELEASE #128

Closed Mr-LiuDC closed 3 years ago

Mr-LiuDC commented 3 years ago

pom.xml

<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>spring-boot-memcached-example</artifactId>
    <version>1.0-SNAPSHOT</version>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.18.RELEASE</version>
        <relativePath/>
    </parent>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.sixhours</groupId>
            <artifactId>memcached-spring-boot-starter</artifactId>
            <version>2.4.1</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.simple-spring-memcached</groupId>
            <artifactId>spring-cache</artifactId>
            <version>4.1.3</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

main class

@EnableCaching
@SpringBootApplication
public class SpringbootCacheMemcachedApp {

    public static void main(String[] args) {
        SpringApplication.run(SpringbootCacheMemcachedApp.class, args);
    }

}

cache layer

@Service
@CacheConfig(cacheNames = "memcached_demo")
public class MemcachedDemoServiceImpl implements IMemcachedDemoService {

    private final MemcachedDemoRepository repository;

    public MemcachedDemoServiceImpl(MemcachedDemoRepository repository) {
        this.repository = repository;
    }

    @Override
    @CachePut(key = "#memcachedDemo.id")
    public MemcachedDemo create(MemcachedDemo memcachedDemo) {
        MemcachedDemo demo = MemcachedDemo.create(memcachedDemo);
        return repository.save(demo);
    }

    @Override
    @Cacheable(key = "#id")
    public MemcachedDemo findById(String id) {
        return repository.findById(id).orElse(null);
    }

    @Override
    @CachePut(key = "#memcachedDemo.id")
    public MemcachedDemo updateById(MemcachedDemo memcachedDemo) {
        AtomicReference<MemcachedDemo> reference = new AtomicReference<>();
        repository.findById(memcachedDemo.getId()).ifPresent(demo -> {
            demo.modified(memcachedDemo);
            repository.save(demo);
            reference.set(demo);
        });
        return reference.get();
    }

    @Override
    @CacheEvict(key = "#id")
    public void deleteById(String id) {
        repository.findById(id).ifPresent(repository::delete);
    }

    @Override
    public Page<MemcachedDemo> pageQuery(Pageable pageable) {
        return repository.findAll(pageable);
    }

}

error logs here

"C:\Program Files\Java\jdk1.8.0_291\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:13013,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -javaagent:C:\Users\decai\AppData\Local\JetBrains\IntelliJIdea2020.3\captureAgent\debugger-agent.jar -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk1.8.0_291\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_291\jre\lib\rt.jar;E:\Temp\Code\codeup.aliyun.com\aipark\aipark\spring-boot-memcached-example\target\classes;F:\dev\repository\.m2\repository\io\sixhours\memcached-spring-boot-starter\2.4.1\memcached-spring-boot-starter-2.4.1.jar;F:\dev\repository\.m2\repository\io\sixhours\memcached-spring-boot-autoconfigure\2.4.1\memcached-spring-boot-autoconfigure-2.4.1.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.18.RELEASE\spring-boot-autoconfigure-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-context-support\5.1.19.RELEASE\spring-context-support-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\com\googlecode\xmemcached\xmemcached\2.4.6\xmemcached-2.4.6.jar;F:\dev\repository\.m2\repository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;F:\dev\repository\.m2\repository\com\google\code\simple-spring-memcached\spring-cache\4.1.3\spring-cache-4.1.3.jar;F:\dev\repository\.m2\repository\com\google\code\simple-spring-memcached\simple-spring-memcached\4.1.3\simple-spring-memcached-4.1.3.jar;F:\dev\repository\.m2\repository\org\springframework\spring-beans\5.1.19.RELEASE\spring-beans-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-aop\5.1.19.RELEASE\spring-aop-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-context\5.1.19.RELEASE\spring-context-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\aspectj\aspectjweaver\1.9.6\aspectjweaver-1.9.6.jar;F:\dev\repository\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.10.6\jackson-databind-2.9.10.6.jar;F:\dev\repository\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.10\jackson-annotations-2.9.10.jar;F:\dev\repository\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.10\jackson-core-2.9.10.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.1.18.RELEASE\spring-boot-starter-web-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter\2.1.18.RELEASE\spring-boot-starter-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot\2.1.18.RELEASE\spring-boot-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.1.18.RELEASE\spring-boot-starter-logging-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;F:\dev\repository\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;F:\dev\repository\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;F:\dev\repository\.m2\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;F:\dev\repository\.m2\repository\org\slf4j\jul-to-slf4j\1.7.30\jul-to-slf4j-1.7.30.jar;F:\dev\repository\.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;F:\dev\repository\.m2\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.1.18.RELEASE\spring-boot-starter-json-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.10\jackson-datatype-jdk8-2.9.10.jar;F:\dev\repository\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.10\jackson-datatype-jsr310-2.9.10.jar;F:\dev\repository\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.10\jackson-module-parameter-names-2.9.10.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.18.RELEASE\spring-boot-starter-tomcat-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.39\tomcat-embed-core-9.0.39.jar;F:\dev\repository\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.39\tomcat-embed-el-9.0.39.jar;F:\dev\repository\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.39\tomcat-embed-websocket-9.0.39.jar;F:\dev\repository\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.21.Final\hibernate-validator-6.0.21.Final.jar;F:\dev\repository\.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;F:\dev\repository\.m2\repository\org\jboss\logging\jboss-logging\3.3.3.Final\jboss-logging-3.3.3.Final.jar;F:\dev\repository\.m2\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;F:\dev\repository\.m2\repository\org\springframework\spring-web\5.1.19.RELEASE\spring-web-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-webmvc\5.1.19.RELEASE\spring-webmvc-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-expression\5.1.19.RELEASE\spring-expression-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-data-jpa\2.1.18.RELEASE\spring-boot-starter-data-jpa-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-aop\2.1.18.RELEASE\spring-boot-starter-aop-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.18.RELEASE\spring-boot-starter-jdbc-2.1.18.RELEASE.jar;F:\dev\repository\.m2\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;F:\dev\repository\.m2\repository\org\springframework\spring-jdbc\5.1.19.RELEASE\spring-jdbc-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\javax\transaction\javax.transaction-api\1.3\javax.transaction-api-1.3.jar;F:\dev\repository\.m2\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;F:\dev\repository\.m2\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;F:\dev\repository\.m2\repository\org\hibernate\hibernate-core\5.3.18.Final\hibernate-core-5.3.18.Final.jar;F:\dev\repository\.m2\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar;F:\dev\repository\.m2\repository\org\javassist\javassist\3.23.2-GA\javassist-3.23.2-GA.jar;F:\dev\repository\.m2\repository\net\bytebuddy\byte-buddy\1.9.16\byte-buddy-1.9.16.jar;F:\dev\repository\.m2\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;F:\dev\repository\.m2\repository\org\jboss\jandex\2.0.5.Final\jandex-2.0.5.Final.jar;F:\dev\repository\.m2\repository\org\dom4j\dom4j\2.1.3\dom4j-2.1.3.jar;F:\dev\repository\.m2\repository\org\hibernate\common\hibernate-commons-annotations\5.0.4.Final\hibernate-commons-annotations-5.0.4.Final.jar;F:\dev\repository\.m2\repository\org\glassfish\jaxb\jaxb-runtime\2.3.1\jaxb-runtime-2.3.1.jar;F:\dev\repository\.m2\repository\org\glassfish\jaxb\txw2\2.3.1\txw2-2.3.1.jar;F:\dev\repository\.m2\repository\com\sun\istack\istack-commons-runtime\3.0.7\istack-commons-runtime-3.0.7.jar;F:\dev\repository\.m2\repository\org\jvnet\staxex\stax-ex\1.8\stax-ex-1.8.jar;F:\dev\repository\.m2\repository\com\sun\xml\fastinfoset\FastInfoset\1.2.15\FastInfoset-1.2.15.jar;F:\dev\repository\.m2\repository\org\springframework\data\spring-data-jpa\2.1.21.RELEASE\spring-data-jpa-2.1.21.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\data\spring-data-commons\2.1.21.RELEASE\spring-data-commons-2.1.21.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-orm\5.1.19.RELEASE\spring-orm-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-tx\5.1.19.RELEASE\spring-tx-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-aspects\5.1.19.RELEASE\spring-aspects-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\com\h2database\h2\1.4.200\h2-1.4.200.jar;F:\dev\repository\.m2\repository\org\projectlombok\lombok\1.18.16\lombok-1.18.16.jar;F:\dev\repository\.m2\repository\org\springframework\spring-core\5.1.19.RELEASE\spring-core-5.1.19.RELEASE.jar;F:\dev\repository\.m2\repository\org\springframework\spring-jcl\5.1.19.RELEASE\spring-jcl-5.1.19.RELEASE.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2020.3.4\lib\idea_rt.jar" fun.aipark.SpringbootCacheMemcachedApp
Connected to the target VM, address: '127.0.0.1:13013', transport: 'socket'

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::       (v2.1.18.RELEASE)

2021-09-10 22:23:05.469  INFO 15060 --- [           main] fun.aipark.SpringbootCacheMemcachedApp   : Starting SpringbootCacheMemcachedApp on alittler-omen with PID 15060 (E:\Temp\Code\codeup.aliyun.com\aipark\aipark\spring-boot-memcached-example\target\classes started by decai in E:\Temp\Code\codeup.aliyun.com\aipark\aipark\spring-boot-memcached-example)
2021-09-10 22:23:05.474  INFO 15060 --- [           main] fun.aipark.SpringbootCacheMemcachedApp   : No active profile set, falling back to default profiles: default
2021-09-10 22:23:06.342  INFO 15060 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-09-10 22:23:06.443  INFO 15060 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 92ms. Found 1 JPA repository interfaces.
2021-09-10 22:23:06.728 ERROR 15060 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalStateException: Cannot load configuration class: io.sixhours.memcached.cache.XMemcachedCacheAutoConfiguration
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:413) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanFactory(ConfigurationClassPostProcessor.java:253) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:286) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:130) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:706) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:532) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744) [spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391) [spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.18.RELEASE.jar:2.1.18.RELEASE]
    at fun.aipark.SpringbootCacheMemcachedApp.main(SpringbootCacheMemcachedApp.java:15) [classes/:na]
Caused by: java.lang.IllegalArgumentException: No visible constructors in class io.sixhours.memcached.cache.XMemcachedCacheAutoConfiguration
    at org.springframework.cglib.proxy.Enhancer.filterConstructors(Enhancer.java:763) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.proxy.Enhancer.generateClass(Enhancer.java:662) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.transform.TransformingClassGenerator.generateClass(TransformingClassGenerator.java:33) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanFactoryAwareGeneratorStrategy.generate(ConfigurationClassEnhancer.java:252) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:358) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.proxy.Enhancer.generate(Enhancer.java:585) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_291]
    at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_291]
    at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:572) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.cglib.proxy.Enhancer.createClass(Enhancer.java:419) ~[spring-core-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer.createClass(ConfigurationClassEnhancer.java:137) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassEnhancer.enhance(ConfigurationClassEnhancer.java:109) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.enhanceConfigurationClasses(ConfigurationClassPostProcessor.java:402) ~[spring-context-5.1.19.RELEASE.jar:5.1.19.RELEASE]
    ... 12 common frames omitted
igorbolic commented 3 years ago

Thanx for the project example 👍

I was able to reproduce it with the given Spring Boot version. I'm gonna let you know when the snapshot version is ready, so that you could check if the issue is resolved for your project.

igorbolic commented 3 years ago

@Mr-LiuDC The snapshot version had been released: 2.4.2-SNAPSHOT. It's available on Sonatype's snapshot repository, which you can add to your POM file:

<repositories>
    <repository>
      <id>snapshots-repo</id>
      <name>Nexus Snapshots</name>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
      <releases>
        <enabled>false</enabled>
      </releases>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
    </repository>
  </repositories>

Let me know if this resolves the auto-configuration issue on the application startup

Mr-LiuDC commented 3 years ago

Yes, then I use version 2.4.2-SNAPSHOT, it resolves the auto-configuration issue on the application startup.

Thanks.

igorbolic commented 3 years ago

The 2.4.2 version has been released to Maven Central