Ignite Spring Integration 似乎在 2.4 中被破坏了(从 2.3 升级) [英] Ignite Spring Integration seems broken with 2.4 (upgrading from 2.3)

查看:26
本文介绍了Ignite Spring Integration 似乎在 2.4 中被破坏了(从 2.3 升级)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从 2.3 升级到 2.4 &意识到在 IgniteSpringBean 中所做的更改(在其 javadoc 的此添加行中引用)导致我们将 PostConstruct 中的大量引用移动到 handleContextRefresh.

We are upgrading from 2.3 to 2.4 & realized that a change made in IgniteSpringBean which is referenced in this added line in its javadoc resulted in us moving lots of references in PostConstruct to handleContextRefresh.

"需要注意该 Ignite 实例在所有其他 Spring bean 初始化之后和 Spring 上下文刷新之前启动.这意味着从任何类型的 Spring bean 初始化方法(如 PostConstruct)引用 IgniteSpringBean 都是无效的.如果需要为其他 bean 引用 IgniteSpringBean初始化目的,它应该通过在该 bean 中声明的 ContextRefreshedEvent 侦听器方法来完成."

但是,这破坏了按照那里的建议配置的 ignite spring 事务配置,我不知道如何解决.基本上我们在 spring 应用程序 xml 中有以下内容,其中 IgniteSpringBean &SpringTransactionManager 配置为在 2.3 中工作,但无法启动引用上述 2.4 更改(当我的机器突然停机时,我将添加异常),

However this breaks ignite spring transaction configuration configured as per the suggestion there which i am not sure how to resolve. Basically we have the below in the spring application xml where both IgniteSpringBean & SpringTransactionManager are configured which was working in 2.3 but fails to start up referencing the above change with 2.4 (i will add the exception in a bit as my machine went down suddenly),

<bean id="igniteSpringBean" class="org.apache.ignite.IgniteSpringBean">
    <property name="configuration">
        <bean id="grid.cfg" class="org.apache.ignite.configuration.IgniteConfiguration">
            <property name="igniteInstanceName" value="ObjectManagerGrid"/>
            <property name="clientMode" value="true"/>
            ...
            ...
        </bean>
    </property>
</bean>

<!-- Enable Spring transaction abstraction for Ignite transactions -->
<bean id="transactionManager" class="org.apache.ignite.transactions.spring.SpringTransactionManager">
    <property name="igniteInstanceName" value="ObjectManagerGrid"/>
    <property name="transactionConcurrency" value="PESSIMISTIC"/>
</bean>

<!-- Enable annotation-driven transaction configuration/demarcation -->
<tx:annotation-driven/>

有关如何解决此问题的任何线索?

Any clue on how to work around this problem?

谢谢!

更新:以下是例外,

ignite-object-manager - [ERROR] 2018-05-24 18:36:45.133 [main] org.springframework.boot.SpringApplication - 应用程序启动失败org.springframework.beans.factory.BeanCreationException:在类路径资源[applicationContext.xml]中定义名称为transactionManager"的bean创建错误:init方法调用失败;嵌套异常是类 org.apache.ignite.IgniteIllegalStateException:提供名称的 Ignite 实例不存在.您是否调用 Ignition.start(..) 来启动 Ignite 实例?[名称=对象管理器网格]在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628)在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)在 org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)在 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)在 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)在 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)在 org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)在 org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)在 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)在 org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)在 org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737)在 org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370)在 org.springframework.boot.SpringApplication.run(SpringApplication.java:314)在 com.brocade.dcm.Application.main(Application.java:63)在 sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)在 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)在 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)在 java.lang.reflect.Method.invoke(Method.java:498)在 org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)在 org.springframework.boot.loader.Launcher.launch(Launcher.java:87)在 org.springframework.boot.loader.Launcher.launch(Launcher.java:50)在 org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)引起:org.apache.ignite.IgniteIllegalStateException:提供名称的 Ignite 实例不存在.您是否调用 Ignition.start(..) 来启动 Ignite 实例?[名称=对象管理器网格]在 org.apache.ignite.internal.IgnitionEx.grid(IgnitionEx.java:1376)在 org.apache.ignite.Ignition.ignite(Ignition.java:530)在 org.apache.ignite.transactions.spring.SpringTransactionManager.afterPropertiesSet(SpringTransactionManager.java:357)在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687)在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624)...省略了22个常用帧

ignite-object-manager - [ERROR] 2018-05-24 18:36:45.133 [main] org.springframework.boot.SpringApplication - Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is class org.apache.ignite.IgniteIllegalStateException: Ignite instance with provided name doesn't exist. Did you call Ignition.start(..) to start an Ignite instance? [name=ObjectManagerGrid] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) at com.brocade.dcm.Application.main(Application.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: org.apache.ignite.IgniteIllegalStateException: Ignite instance with provided name doesn't exist. Did you call Ignition.start(..) to start an Ignite instance? [name=ObjectManagerGrid] at org.apache.ignite.internal.IgnitionEx.grid(IgnitionEx.java:1376) at org.apache.ignite.Ignition.ignite(Ignition.java:530) at org.apache.ignite.transactions.spring.SpringTransactionManager.afterPropertiesSet(SpringTransactionManager.java:357) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ... 22 common frames omitted

推荐答案

它没有被破坏,而是在 IGNITE-6555.

It was not broken, but rather fixed in IGNITE-6555.

不幸的是,这也意味着您必须找到一种方法来暂时推迟 SpringTransactionManager 的创建/初始化.

Unfortunately it also means that you will have to find a way to defer SpringTransactionManager creation/initialization for now.

有关用户列表.

这篇关于Ignite Spring Integration 似乎在 2.4 中被破坏了(从 2.3 升级)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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