Geode/GemFire无法创建gemfireCache bean错误:Spring Boot v2.1.3-GemFire启动器1.1.0.RELEASE [英] Geode/GemFire Cannot create gemfireCache bean error: Spring Boot v2.1.3 - GemFire starter 1.1.0.RELEASE

查看:112
本文介绍了Geode/GemFire无法创建gemfireCache bean错误:Spring Boot v2.1.3-GemFire启动器1.1.0.RELEASE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用Springboot v.2.1.3连接到PCC w/ gemfire v9.6.1.基于SBDG兼容性矩阵,我尝试使用SBDG v1.1.0.RELEASE,我看到了以下问题.

I'm currently using Springboot v.2.1.3 to connect to PCC w/ gemfire v9.6.1. Based on the SBDG compatibility matrix, I tried to use SBDG v1.1.0.RELEASE and I see the below issue.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quoteService' defined in file [C:\Users\madhu\Downloads\pcctest\pcctest\target\classes\com\example\pcctest\QuoteService.class]: Initialization of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.geode.cache.Region]: Failed to create Region for cache [Quotes]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache' defined in class path resource [org/springframework/data/gemfire/config/annotation/ClientCacheConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
    at com.example.pcctest.PcctestApplication.main(PcctestApplication.java:15) [classes/:na]
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.geode.cache.Region]: Failed to create Region for cache [Quotes]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache' defined in class path resource [org/springframework/data/gemfire/config/annotation/ClientCacheConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError
    at org.springframework.data.gemfire.config.annotation.CachingDefinedRegionsConfiguration.lambda$registerRegionBeans$3(CachingDefinedRegionsConfiguration.java:322) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at java.lang.Iterable.forEach(Iterable.java:75) ~[na:1.8.0_191]
    at org.springframework.data.gemfire.config.annotation.CachingDefinedRegionsConfiguration.registerRegionBeans(CachingDefinedRegionsConfiguration.java:295) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.data.gemfire.config.annotation.CachingDefinedRegionsConfiguration.access$100(CachingDefinedRegionsConfiguration.java:107) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.data.gemfire.config.annotation.CachingDefinedRegionsConfiguration$1.postProcessBeforeInitialization(CachingDefinedRegionsConfiguration.java:285) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1754) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    ... 14 common frames omitted
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'gemfireCache' defined in class path resource [org/springframework/data/gemfire/config/annotation/ClientCacheConfiguration.class]: Invocation of init method failed; nested exception is java.lang.AbstractMethodError
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1762) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:224) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveNamedBean(DefaultListableBeanFactory.java:1115) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveBean(DefaultListableBeanFactory.java:407) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:341) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBean(DefaultListableBeanFactory.java:335) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.data.gemfire.config.annotation.CachingDefinedRegionsConfiguration.lambda$registerRegionBeans$3(CachingDefinedRegionsConfiguration.java:302) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    ... 21 common frames omitted
Caused by: java.lang.AbstractMethodError: null
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.lambda$null$0(ClientCacheFactoryBean.java:118) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_191]
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.lambda$new$1(ClientCacheFactoryBean.java:117) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.lambda$applyClientCacheConfigurers$2(ClientCacheFactoryBean.java:156) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948) ~[na:1.8.0_191]
    at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:580) ~[na:1.8.0_191]
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.applyClientCacheConfigurers(ClientCacheFactoryBean.java:156) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.applyClientCacheConfigurers(ClientCacheFactoryBean.java:142) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.applyCacheConfigurers(ClientCacheFactoryBean.java:129) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.data.gemfire.CacheFactoryBean.afterPropertiesSet(CacheFactoryBean.java:177) ~[spring-data-gemfire-2.1.5.RELEASE.jar:2.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1821) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
    ... 32 common frames omitted```

这是我的pom和配置.

Here's my pom and config.

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.3.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>
    <groupId>com.example</groupId>
    <artifactId>pcctest</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>pcctest</name>
    <description>Demo project for Spring Boot</description>
    <dependencies>
        <dependency>
            <groupId>org.springframework.geode</groupId>
            <artifactId>spring-gemfire-starter</artifactId>
            <version>1.1.0.RELEASE</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-to-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-to-slf4j</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

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

@Configuration
@EnableCachingDefinedRegions
@EnableClusterConfiguration
public class TestConfig {
}```

@SpringBootApplication
public class PcctestApplication {

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

    @Bean
    ApplicationRunner runner(QuoteService quoteService) {

        return args -> {
            Quote quote = requestQuote(quoteService, null);
            requestQuote(quoteService, quote.getId());
            requestQuote(quoteService, 10L);
        };
    }

    private Quote requestQuote(QuoteService quoteService, Long id) {

        long startTime = System.currentTimeMillis();

        Quote quote = Optional.ofNullable(id).map(quoteService::requestQuote)
                .orElseGet(quoteService::requestRandomQuote);

        long elapsedTime = System.currentTimeMillis();

        System.out.printf("\"%1$s\"%nCache Miss [%2$s] - Elapsed Time [%3$s ms]%n", quote, quoteService.isCacheMiss(),
                (elapsedTime - startTime));

        return quote;
    }
}```

jars that get downloded

org\springframework\geode\spring-gemfire-starter\1.1.0.RELEASE\spring-gemfire-starter-1.1.0.RELEASE.jar
org\springframework\boot\spring-boot-starter\2.1.3.RELEASE\spring-boot-starter-2.1.3.RELEASE.jar
org\springframework\boot\spring-boot\2.1.3.RELEASE\spring-boot-2.1.3.RELEASE.jar
org\springframework\spring-context\5.1.5.RELEASE\spring-context-5.1.5.RELEASE.jar
org\springframework\spring-aop\5.1.5.RELEASE\spring-aop-5.1.5.RELEASE.jar
org\springframework\spring-expression\5.1.5.RELEASE\spring-expression-5.1.5.RELEASE.jar
org\springframework\boot\spring-boot-autoconfigure\2.1.3.RELEASE\spring-boot-autoconfigure-2.1.3.RELEASE.jar
org\springframework\boot\spring-boot-starter-logging\2.1.3.RELEASE\spring-boot-starter-logging-2.1.3.RELEASE.jar
ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar
ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar
org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar
javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar
org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar
org\springframework\data\spring-data-gemfire\2.1.5.RELEASE\spring-data-gemfire-2.1.5.RELEASE.jar
org\springframework\spring-context-support\5.1.5.RELEASE\spring-context-support-5.1.5.RELEASE.jar
org\springframework\spring-beans\5.1.5.RELEASE\spring-beans-5.1.5.RELEASE.jar
org\springframework\spring-tx\5.1.5.RELEASE\spring-tx-5.1.5.RELEASE.jar
org\springframework\spring-web\5.1.5.RELEASE\spring-web-5.1.5.RELEASE.jar
org\springframework\data\spring-data-commons\2.1.5.RELEASE\spring-data-commons-2.1.5.RELEASE.jar
io\pivotal\gemfire\geode-core\9.5.2\geode-core-9.5.2.jar
com\github\stephenc\findbugs\findbugs-annotations\1.3.9-1\findbugs-annotations-1.3.9-1.jar
org\jgroups\jgroups\3.6.14.Final\jgroups-3.6.14.Final.jar
commons-validator\commons-validator\1.6\commons-validator-1.6.jar
commons-beanutils\commons-beanutils\1.9.2\commons-beanutils-1.9.2.jar
commons-logging\commons-logging\1.2\commons-logging-1.2.jar
commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar
commons-digester\commons-digester\2.1\commons-digester-2.1.jar
commons-lang\commons-lang\2.6\commons-lang-2.6.jar
it\unimi\dsi\fastutil\8.1.1\fastutil-8.1.1.jar
javax\resource\javax.resource-api\1.7\javax.resource-api-1.7.jar
javax\transaction\javax.transaction-api\1.3\javax.transaction-api-1.3.jar
net\java\dev\jna\jna\4.5.2\jna-4.5.2.jar
net\sf\jopt-simple\jopt-simple\5.0.4\jopt-simple-5.0.4.jar
org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar
org\apache\logging\log4j\log4j-core\2.11.2\log4j-core-2.11.2.jar
org\apache\shiro\shiro-core\1.4.0\shiro-core-1.4.0.jar
org\apache\shiro\shiro-lang\1.4.0\shiro-lang-1.4.0.jar
org\apache\shiro\shiro-cache\1.4.0\shiro-cache-1.4.0.jar
org\apache\shiro\shiro-crypto-hash\1.4.0\shiro-crypto-hash-1.4.0.jar
org\apache\shiro\shiro-crypto-core\1.4.0\shiro-crypto-core-1.4.0.jar
org\apache\shiro\shiro-crypto-cipher\1.4.0\shiro-crypto-cipher-1.4.0.jar
org\apache\shiro\shiro-config-core\1.4.0\shiro-config-core-1.4.0.jar
org\apache\shiro\shiro-config-ogdl\1.4.0\shiro-config-ogdl-1.4.0.jar
org\apache\shiro\shiro-event\1.4.0\shiro-event-1.4.0.jar
io\github\lukehutch\fast-classpath-scanner\2.18.1\fast-classpath-scanner-2.18.1.jar
com\healthmarketscience\rmiio\rmiio\2.1.2\rmiio-2.1.2.jar
io\pivotal\gemfire\geode-common\9.5.2\geode-common-9.5.2.jar
io\pivotal\gemfire\geode-json\9.5.2\geode-json-9.5.2.jar
io\pivotal\gemfire\geode-cq\9.5.2\geode-cq-9.5.2.jar
io\pivotal\gemfire\geode-lucene\9.5.2\geode-lucene-9.5.2.jar
org\apache\lucene\lucene-analyzers-common\6.6.2\lucene-analyzers-common-6.6.2.jar
org\apache\lucene\lucene-core\6.6.2\lucene-core-6.6.2.jar
org\apache\lucene\lucene-queries\6.6.2\lucene-queries-6.6.2.jar
org\apache\lucene\lucene-analyzers-phonetic\6.6.2\lucene-analyzers-phonetic-6.6.2.jar
commons-codec\commons-codec\1.11\commons-codec-1.11.jar
org\apache\lucene\lucene-queryparser\6.6.2\lucene-queryparser-6.6.2.jar
io\pivotal\gemfire\geode-wan\9.5.2\geode-wan-9.5.2.jar
antlr\antlr\2.7.7\antlr-2.7.7.jar
org\aspectj\aspectjweaver\1.9.2\aspectjweaver-1.9.2.jar
org\slf4j\jcl-over-slf4j\1.7.25\jcl-over-slf4j-1.7.25.jar
org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar
org\springframework\geode\spring-geode\1.1.0.RELEASE\spring-geode-1.1.0.RELEASE.jar
org\springframework\spring-jcl\5.1.5.RELEASE\spring-jcl-5.1.5.RELEASE.jar
org\springframework\geode\spring-geode-autoconfigure\1.1.0.RELEASE\spring-geode-autoconfigure-1.1.0.RELEASE.jar
javax\cache\cache-api\1.1.0\cache-api-1.1.0.jar
org\springframework\shell\spring-shell\1.2.0.RELEASE\spring-shell-1.2.0.RELEASE.jar
com\google\guava\guava\17.0\guava-17.0.jar
jline\jline\2.12\jline-2.12.jar
commons-io\commons-io\2.4\commons-io-2.4.jar
com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar
com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar
com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar
org\projectlombok\lombok\1.18.6\lombok-1.18.6.jar
org\springframework\boot\spring-boot-starter-test\2.1.3.RELEASE\spring-boot-starter-test-2.1.3.RELEASE.jar
org\springframework\boot\spring-boot-test\2.1.3.RELEASE\spring-boot-test-2.1.3.RELEASE.jar
org\springframework\boot\spring-boot-test-autoconfigure\2.1.3.RELEASE\spring-boot-test-autoconfigure-2.1.3.RELEASE.jar
com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar
net\minidev\json-smart\2.3\json-smart-2.3.jar
net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar
org\ow2\asm\asm\5.0.4\asm-5.0.4.jar
junit\junit\4.12\junit-4.12.jar
org\assertj\assertj-core\3.11.1\assertj-core-3.11.1.jar
org\mockito\mockito-core\2.23.4\mockito-core-2.23.4.jar
net\bytebuddy\byte-buddy\1.9.10\byte-buddy-1.9.10.jar
net\bytebuddy\byte-buddy-agent\1.9.10\byte-buddy-agent-1.9.10.jar
org\objenesis\objenesis\2.6\objenesis-2.6.jar
org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar
org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar
org\skyscreamer\jsonassert\1.5.0\jsonassert-1.5.0.jar
com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar
org\springframework\spring-core\5.1.5.RELEASE\spring-core-5.1.5.RELEASE.jar
org\springframework\spring-test\5.1.5.RELEASE\spring-test-5.1.5.RELEASE.jar
org\xmlunit\xmlunit-core\2.6.2\xmlunit-core-2.6.2.jar```

我尝试将所有Gemfire Starter 1.1.X版本与Springboot v2.1.3一起使用,并且看到类似的gemfireCache bean创建问题. 有人可以让我知道我是否在这里遗漏任何东西,并帮助我搭配兼容的Gemfire入门程序,尤其是与Springboot v.2.1.3一起使用吗?

I've tried using all Gemfire Starter 1.1.X versions with Springboot v2.1.3 and I see similar gemfireCache bean creation issue. Can someone let me know if I'm missing anything here and help me with the compatible Gemfire starter to use with Springboot v.2.1.3 in particular?

推荐答案

@ Madmax-您要引用哪个版本的兼容性矩阵?这是官方"

@Madmax- To which version compatibility matrix do you refer? This is the "official" version compatibility matrix.

如您所见,SBDG 1.1.x的最新版本是1.1.6.RELEASE,它是

As you can see, the latest version of SBDG 1.1.x is 1.1.6.RELEASE, which is based on Spring Boot 2.1.13.RELEASE.

如果我们回到SBDG 1.1.0.RELEASE,我们会看到它是

If we go back to SBDG 1.1.0.RELEASE we see that it was based on Spring Boot 2.1.7.RELEASE. This creates a cascading effect on transitive dependencies.

由于SBDG 1.1.0.RELEASE是基于Spring Boot 2.1.7.RELEASE的,这意味着SBDG 1.1.0.RELEASE也需要Spring Data Lovelace-SR10(即包含 Apache Geode和Pivotal GemFire(SDG)2.1.10.RELEASE的Spring数据.因此,SBDG 1.1.0.RELEASE对Spring Boot 2.1.7.RELEASE和SDG 2.1.10.RELEASE的最低要求.

Since SBDG 1.1.0.RELEASE is based on Spring Boot 2.1.7.RELEASE, that means SBDG 1.1.0.RELEASE also requires Spring Data Lovelace-SR10 (which is pulled in by Boot 2.1.7.RELEASE). Spring Data Lovelace-SR10 (here) includes Spring Data for Apache Geode and Pivotal GemFire (SDG) 2.1.10.RELEASE. Therefore, SBDG 1.1.0.RELEASE has a minimum requirement of Spring Boot 2.1.7.RELEASE and SDG 2.1.10.RELEASE.

如果我们对Spring Boot 2.1.3.RELEASE重复此练习,则会看到Boot

If we repeat this exercise for Spring Boot 2.1.3.RELEASE, we see that Boot pulls in Spring Data Lovelace-SR5 (here), which includes SDG 2.1.5.RELEASE. SDG 2.1.5.RELEASE does not meet the minimum requirement for SBDG 1.1.0.RELEASE.

注意,这一直延伸到核心Spring Framework本身,因为Spring Boot也基于并引入了核心Spring Framework,并且Spring Data也基于核心Spring Framework.因此,所有版本都必须对齐.

Note, this extends all the way down to the core Spring Framework itself, since Spring Boot is based on and pulls in the core Spring Framework as well, and Spring Data is also based on the core Spring Framework. Therefore, all the versions must align.

通常,您不能将不兼容的版本串在一起.如果是版本兼容性矩阵(或更确切地说是SBDG gradle.properties文件,

In general, you cannot string together incompatible versions. If the version compatibility matrix (or more technically, the SBDG gradle.properties file, for example) states a particular version of a direct or transitive dependency, then that version of the dependency is expected and required.

话虽如此,我基于Spring Boot 2.1.3.RELEASE使用SDDG 1.1.0.RELEASE设置了一个示例/测试项目,以查看是否可以重现您的错误.我做到了!但是,我得到了更精确的错误消息:

Having said that, I setup an example/test project with SDDG 1.1.0.RELEASE based on Spring Boot 2.1.3.RELEASE to see if I could reproduce your error. I did! However, I got a more precise error message:

Caused by: java.lang.AbstractMethodError: Receiver class org.springframework.geode.boot.autoconfigure.CacheNameAutoConfiguration$$Lambda$327/0x0000000800e48c40 does not define or inherit an implementation of the resolved method 'abstract void configure(java.lang.String, org.springframework.data.gemfire.client.ClientCacheFactoryBean)' of interface org.springframework.data.gemfire.config.annotation.ClientCacheConfigurer.
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.lambda$null$0(ClientCacheFactoryBean.java:118)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.lambda$new$1(ClientCacheFactoryBean.java:117)
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.lambda$applyClientCacheConfigurers$2(ClientCacheFactoryBean.java:156)
    at java.base/java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
    at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.applyClientCacheConfigurers(ClientCacheFactoryBean.java:156)
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.applyClientCacheConfigurers(ClientCacheFactoryBean.java:142)
    at org.springframework.data.gemfire.client.ClientCacheFactoryBean.applyCacheConfigurers(ClientCacheFactoryBean.java:129)
    at org.springframework.data.gemfire.CacheFactoryBean.afterPropertiesSet(CacheFactoryBean.java:177)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1821)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1758)
    ... 29 more

进一步调查后,我找到了问题所在.

After further investigation, I have traced down the problem.

SBDG CacheNameAutoConfiguration

The SBDG CacheNameAutoConfiguration class uses the SDG ClientCacheConfigurer interface to configure the "name" of the GemFire/Geode cache instance.

SDG ClientCacheConfigurer接口为

The SDG ClientCacheConfigurer interface was defined as this in SDG 2.1.5.RELEASE, which again is pulled in by Spring Boot 2.1.3.RELEASE. However, in SDG2.1.10.RELEASE, I [redefined][13] theClientCacheConfigurerinterface (now, an@FunctionalInterfaceas well) in terms of a baseConfigurer` interface (this). While they are the same interface logically, the (method resolution) byte code is no doubt different and therefore, the JRE cannot resolve the method.

您可以尝试从Spring Boot(自动)配置中排除CacheNameAutoConfiguration类,如下所示:

You could try excluding the CacheNameAutoConfiguration class from your Spring Boot (auto) configuration, like so:

@SpringBootApplication(exclude = CacheNameAutoConfiguration.class)
class PccTestApplication { ... }

但是,SBDG在SBDG的 auto-configuraiton 的几个区域中广泛使用ClientCacheConfigurer @FunctionalInterface,以便自定义SDG和GemFire/Geode的配置,以方便使用惯例代表用户的目的.

However, SBDG makes liberal use of the ClientCacheConfigurer @FunctionalInterface in several areas of SBDG's auto-configuraiton in order to customize the configuration of SDG, and GemFire/Geode, for conventions and convenience purposes on-behalf of the user.

实际上,我必须排除这两个SBDG 自动配置类,才能使您的示例/测试正常运行.

In fact, I had to exclude both of these SBDG auto-configuration classes to get your example/test working correctly.

@SpringBootApplication(exclude = { 
    CacheNameAutoConfiguration.class, 
    ContinuousQueryAutoConfiguration.class 
})
class PccTestApplication { ... }

有关禁用自动配置的更多详细信息,请参见

For more details on disable auto-configuration, see here and here.

但是,老实说,我不建议使用方法作为答案.

However, I don't recommend approach as the answer, honestly.

您应该使用兼容版本,即SBDG 1.1.0.RELEASE实际上应该与基准Spring Boot版本2.1.7.RELEASE配对.

It is pertinent that you use compatible versions, i.e. SBDG 1.1.0.RELEASE really ought to be paired with the baseline Spring Boot version 2.1.7.RELEASE.

更是如此,您应该强烈考虑在1.1.x行中将SBDG 1.1.6.RELEASE与Spring Boot 2.1.13.RELEASE一起使用.

Even more so, you should strongly consider using SBDG 1.1.6.RELEASE in the 1.1.x line with Spring Boot 2.1.13.RELEASE.

如另一篇SO帖子所述,带有Spring Boot 2.1.14.RELEASE的SBDG 1.1.7.RELEASE将于本周四4/30到期.有关更多信息,请参见Spring 发布日历.

As mentioned in another SO post, SBDG 1.1.7.RELEASE with Spring Boot 2.1.14.RELEASE is due this Thursday, 4/30. See the Spring release calendar for more information.

如果可能的话,我还建议进一步升级到带有SBDG 1.2.6.RELEASE的Spring Boot 2.2.x(当前为2.2.6.RELEASE).

I'd also recommend to go even further and upgrade to Spring Boot 2.2.x (currently, 2.2.6.RELEASE) with SBDG 1.2.6.RELEASE if at all possible.

希望这会有所帮助!

这篇关于Geode/GemFire无法创建gemfireCache bean错误:Spring Boot v2.1.3-GemFire启动器1.1.0.RELEASE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆