Ignite Spring Integration似乎打破了2.4(从2.3升级)

时间:2018-05-24 19:50:01

标签: spring spring-boot spring-data ignite gridgain

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

" A note should be taken that Ignite instance is started after all other Spring beans have been initialized and right before Spring context is refreshed. That implies that it's not valid to reference IgniteSpringBean from any kind of Spring bean init methods like PostConstruct. If it's required to reference IgniteSpringBean for other bean initialization purposes, it should be done from a ContextRefreshedEvent listener method declared in that bean. "

然而,这会打破点击弹簧交易配置,根据我不知道如何解决的建议配置。基本上我们在spring应用程序xml中有以下内容,其中IgniteSpringBean和SpringTransactionManager配置在2.3中工作,但无法启动引用2.4的上述更改(我会稍微添加异常,因为我的机器突然停机),

<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/>

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

谢谢!

更新:以下是例外,

ignite-object-manager - [ERROR] 2018-05-24 18:36:45.133 [main] org.springframework.boot.SpringApplication - 应用程序启动失败 org.springframework.beans.factory.BeanCreationException:创建名为&#39; transactionManager&#39;的bean时出错在类路径资源[applicationContext.xml]中定义:init方法的调用失败;嵌套异常是类org.apache.ignite.IgniteIllegalStateException:提供名称的Ignite实例不存在。你有没有调用Ignition.start(..)来启动一个Ignite实例? [名称= ObjectManagerGrid]         在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)         at 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)         at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866)         在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542)         at 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)         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)         在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实例? [名称= ObjectManagerGrid]         在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个常见帧

1 个答案:

答案 0 :(得分:0)

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

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

有关user list上的问题的更多详细信息。