Spring Boot Geode 通过方法“sessionRegion”表达不满足的依赖关系

2024-02-28

我的 gradle.build 的正确依赖关系让我发疯!

为了访问 Apache Geode 1.10 服务器,我使用:

// Geode client dependency
implementation 'org.springframework.geode:spring-geode-starter:1.2.13.RELEASE'    
implementation 'org.springframework.data:spring-data-geode:2.2.12.RELEASE' 
implementation 'org.springframework.boot:spring-boot-starter-tomcat:2.2.13.RELEASE' 

此操作失败并出现以下错误:

org.springframework.context.support.AbstractApplicationContext 596 refresh: 
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException: 
Error creating bean with name 'ClusteredSpringSessions' defined in class path resource 
[org/springframework/session/data/gemfire/config/annotation/web/http/GemFireHttpSessionConfiguration.class]: 
Unsatisfied dependency expressed through method 'sessionRegion' parameter 0; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.springframework.data.gemfire.config.annotation.ClientCacheConfiguration': 
Initialization of bean failed; nested exception is java.lang.IllegalAccessError: 
class org.springframework.data.gemfire.config.annotation.AbstractCacheConfiguration$$Lambda$703/0x0000000801025d10 
tried to access protected method 'boolean org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport.hasValue(java.lang.Number)' 
(org.springframework.data.gemfire.config.annotation.AbstractCacheConfiguration$$Lambda$703/0x0000000801025d10 
and org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport are in unnamed module of loader 'app')

有什么可以告诉我缺少的依赖项UnsatisfiedDependencyException for 'ClusteredSpringSessions'?

如果我删除@EnableGemFireHttpSession注释然后我得到错误

2021-02-02T19:29:49,011 WARN  [main] org.springframework.context.support.AbstractApplicationContext 596 refresh: 
Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'cacheManager' defined in class path resource [org/springframework/data/gemfire/cache/config/GemfireCachingConfiguration.class]:
Unsatisfied dependency expressed through method 'cacheManager' parameter 0; 
nested exception is org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'org.springframework.data.gemfire.config.annotation.ClientCacheConfiguration': 
Initialization of bean failed; nested exception is java.lang.IllegalAccessError: 
class org.springframework.data.gemfire.config.annotation.AbstractCacheConfiguration$$Lambda$679/0x00000008010306b8 
tried to access protected method 'boolean org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport.hasValue(java.lang.Number)'
(org.springframework.data.gemfire.config.annotation.AbstractCacheConfiguration$$Lambda$679/0x00000008010306b8 
and org.springframework.data.gemfire.config.annotation.support.AbstractAnnotationConfigSupport are in unnamed module of loader 'app')

有什么可以告诉我缺少的依赖项UnsatisfiedDependencyException for 'cacheManager'?

Thanks

UPDATE该应用程序的运行方式如下Spring Boot @ComponentScan 找到候选组件类但不注入@Configuration bean https://stackoverflow.com/questions/60209591/spring-boot-componentscan-finds-candidate-component-class-but-does-not-inject但更具体地说

@SpringBootApplication
@ComponentScan({"api", "rsocket", "pricing", "listeners", "dealing", "web"}) // scans packages for @ components
@EnableLogging(logLevel="debug", logFile="geodeApi.log")
public class Api {
    
    private static final Logger log = LogManager.getLogger(Api.class);

    public static void main(String[] args) {
        log.info("In Main");
        
        SpringApplication app = new SpringApplication(Api.class);
        app.setWebApplicationType(WebApplicationType.REACTIVE);
        SpringApplication.run(Api.class, args);
        
        log.info("Out Main");
    }
}

组件扫描发现各种@Component例如带注释的类

@Component
@EnableClusterDefinedRegions(clientRegionShortcut=ClientRegionShortcut.PROXY)
public class ClientCache {
    
    private static final Logger log = LogManager.getLogger(ClientCache.class);
    
    @Resource
    private Region<String, String> admin;
    
    @Autowired
    LQuote lQuote;
    
    @Autowired
    LReject lReject;    
    
    @Autowired
    LDeal lDeal;
    
    @Autowired
    DealNumber dealNumber;
    
    @Autowired
    PriceService priceService;
    
    @PreDestroy
    public void onDestroy() throws Exception {
        
        log.info("onDestroy");
        
        String guid = UUID.randomUUID().toString().substring(0, 8).toUpperCase();           
        admin.put(guid, "API Shutdown");
        
        // TODO: Cancel all open quote streams
        
        log.traceExit();
    }
    
    @Bean
    ApplicationRunner StartedUp(){      
        log.traceEntry("StartedUp");
            
        return args -> {            
        String guid = UUID.randomUUID().toString().substring(0, 8).toUpperCase();       
        admin.put(guid, "API Started");
        
        lQuote.addListener();
        lReject.addListener();
        lDeal.addListener();
        
        // Get latest deal number
        int currentId = dealNumber.readCurrentId();
        
        // Set it + 1 in case the web server was reboot on the fly
        priceService.setCurrentId(currentId + 1);

        log.traceExit();
    };
}

很多问题都出在使用 Java JDK 版本 15。 正确的版本需要 Java 11。

// Geode client dependency
implementation 'org.springframework.geode:spring-geode-starter:1.2.8.RELEASE'    
implementation 'org.springframework.data:spring-data-geode:2.2.8.RELEASE' 
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Spring Boot Geode 通过方法“sessionRegion”表达不满足的依赖关系 的相关文章

  • Laravel 中间件单元测试

    我正在尝试在 Laravel 中为我的中间件编写单元测试 有谁知道教程 或者有这方面的例子吗 我已经写了很多代码 但是一定有更好的方法来测试handle方法 使用 Laravel 5 2 我通过向中间件传递带有输入的请求和带有断言的闭包来对
  • 如何让 Scalaz ZIO 变懒?

    我有一个严重的副作用函数 想想数据库调用 我想将其用作惰性值 以便仅在第一次使用时调用它 如果从未使用过则根本不会调用 我该如何使用 ZIO 做到这一点 如果我的程序如下所示 则该函数仅被调用一次 但甚至根本不使用结果 import sca
  • 登录页面Cognito的定制

    我知道可以在 Cognito 提供的登录页面上自定义一些值 但这对我来说还不够 是否可以完全定制 我只使用网络应用程序中的第三方联合身份验证 是否可以更改灰色背景 或者放在那里完全不同的观点 由于背景灰色无法再修改 我们可以使用一些 CSS
  • 如何分析Websphere core*.dmp 文件和Snap*.trc 文件?

    全部 我的应用程序在 websphere 应用程序服务器 7 0 上运行 我得到了一些核心转储和跟踪文件 例如 核心 20110909 164930 3828 0001 dmp and 快照 20110909 164930 3828 000
  • 使用 Flash、PHP、Red5 从浏览器录制视频

    我希望构建一个应用程序 使用它可以录制视频 以及音频 和音频 最好仅录制 mp3 格式的音频 根据我所做的一些研究 我发现我需要一个 Flash 或 Flex 客户端应用程序 一个 RTMP 服务器 RED5 最好 因为它是免费的 这是我用
  • 加载时重置缩放级别

    我没有 iPhone 所以无法自己测试这一点 但根据客户的说法 如果他放大以更轻松地单击链接 那么当下一页加载时 页面会保持放大状态 而用户必须手动缩小再次 请注意 这不是响应式网站 它没有设置元宽度 设备宽度 有什么办法可以防止这种情况发
  • 何时调用obtainPermanentIDsForObjects:?

    我目前遇到一个问题 即在后台子线程 其父级是主 UI 线程上下文 上创建新对象并保存会导致我的NSFetchedResultsController显示两个新对象 一个带有临时对象objectID 以及一个具有永久objectID 这似乎是某
  • 在 Chrome 中将焦点设置在 iframe 上

    我有一个 iframe id chat with designMode on 在 Chrome 中 在 Enter 按键事件上我调用该函数send 它获取 iframe 内容并将其写入套接字 我的问题是 当清除 iframe 时 我失去了焦
  • 开发流程、部署、GitHub

    我正在努力为我们的团队制定一个开发流程 任何时候 我们都有 3 4 分散的开发人员在我们的代码库上工作 我们已经开始使用 GIT 我们的想法是 工作不仅仅是实时修复 然后他们分叉了 master 分支 每个人在服务器上都有自己的开发环境 并
  • 函数数组和分段错误 - 无效的内存引用

    我正在尝试设置我的功能f作为数组 但我收到以下错误 Program received signal SIGSEGV Segmentation fault invalid memory reference Backtrace for this
  • C# UDP广播和接收示例

    问题 我正在尝试将 udp 套接字绑定到特定地址 我会广播一条消息 同一个套接字需要能够接收消息 当前代码 static void Main UdpClient Configuration new UdpClient new IPEndPo
  • gnuplot - 彩色刻度线

    有什么办法可以拥有gnuplot为 x 和 或 y 轴上的刻度线着色 我正在使用背景png文件非常暗 我希望内部抽动在其上显示为白色 而不是默认的黑色 The tics似乎继承了它们的颜色border set style line 50 l
  • Typescript:推断嵌套 keyof 属性的类型

    我想定义一个数组类型 它必须包含给定类型的嵌套属性名称链 假设我有一个类型 type Foo outer inner any 现在我想定义一个包含 2 个元素的数组类型 type PropertyList
  • SQL 查询的 NULL NOT IN (Empty_Relation) 在不同引擎上显示不同的行为

    我尝试在 Postrgresql Spark 上测试 NULL NOT IN Empty Relation 的查询 得到了不同的结果 select count from select 1 where null not in a empty
  • React js 输入复选框组

    是否可以在反应中创建输入复选框组 如果我映射了 3 个复选框 但只能单击其中一个 我是否只给每个状态一个状态 当选择一个状态后 然后取消选中其他状态 我已经尝试过无线电输入 但我需要能够将它们全部取消选中 就像在无线电组中一样 一旦您选择了

随机推荐