About Ignite-Spring with GridService issue.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

About Ignite-Spring with GridService issue.

姜 为
Hello,

        I’m using Ignite-Spring testing GridService rpc.

        Like this example https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java <https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java>

        I made change for SimpleMapServiceImpl use @Autowired to other service.
       
        Ignite start using same SpringApplicationContext:
                IgniteSpring.start(config, context);
       
        and @Autowired is success .

        But when Ignite.compute call  IgniteCallable service.
        The @Autowired service will be null.

        Is this I configured problem or Ignite issue?

Reply | Threaded
Open this post in threaded view
|

Re: About Ignite-Spring with GridService issue.

姜 为
Hi:
        Here is example: https://github.com/wmz7year/ignite-test
       
        I think the IgniteUtils.wrapThreadLoader load the class is not the spring proxy class.

    Does I’m right?

> 在 2015年11月14日,下午10:58,姜 为 <[hidden email]> 写道:
>
> Hello,
>
> I’m using Ignite-Spring testing GridService rpc.
>
> Like this example https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java <https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java>
>
> I made change for SimpleMapServiceImpl use @Autowired to other service.
>
> Ignite start using same SpringApplicationContext:
> IgniteSpring.start(config, context);
>
> and @Autowired is success .
>
> But when Ignite.compute call  IgniteCallable service.
> The @Autowired service will be null.
>
> Is this I configured problem or Ignite issue?
>

Reply | Threaded
Open this post in threaded view
|

Re: About Ignite-Spring with GridService issue.

姜 为
I found hot to fix this, add @SpringResource to the field will work fine.

> 在 2015年11月16日,上午9:40,姜 为 <[hidden email]> 写道:
>
> Hi:
> Here is example: https://github.com/wmz7year/ignite-test <https://github.com/wmz7year/ignite-test>
>
> I think the IgniteUtils.wrapThreadLoader load the class is not the spring proxy class.
>
>     Does I’m right?
>
>> 在 2015年11月14日,下午10:58,姜 为 <[hidden email] <mailto:[hidden email]>> 写道:
>>
>> Hello,
>>
>> I’m using Ignite-Spring testing GridService rpc.
>>
>> Like this example https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java <https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java>
>>
>> I made change for SimpleMapServiceImpl use @Autowired to other service.
>>
>> Ignite start using same SpringApplicationContext:
>> IgniteSpring.start(config, context);
>>
>> and @Autowired is success .
>>
>> But when Ignite.compute call  IgniteCallable service.
>> The @Autowired service will be null.
>>
>> Is this I configured problem or Ignite issue?
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: About Ignite-Spring with GridService issue.

Denis Magda
Hi,

You have to use @SprintResource annotation if you want to inject something from a spring application context into Ignite’s compute task.
@Autowire annotation is not supported.

Best regards,
Denis

> On 16 нояб. 2015 г., at 7:03, 姜 为 <[hidden email]> wrote:
>
> I found hot to fix this, add @SpringResource to the field will work fine.
>
>> 在 2015年11月16日,上午9:40,姜 为 <[hidden email]> 写道:
>>
>> Hi:
>> Here is example: https://github.com/wmz7year/ignite-test <https://github.com/wmz7year/ignite-test>
>>
>> I think the IgniteUtils.wrapThreadLoader load the class is not the spring proxy class.
>>
>>    Does I’m right?
>>
>>> 在 2015年11月14日,下午10:58,姜 为 <[hidden email] <mailto:[hidden email]>> 写道:
>>>
>>> Hello,
>>>
>>> I’m using Ignite-Spring testing GridService rpc.
>>>
>>> Like this example https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java <https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/servicegrid/ServicesExample.java>
>>>
>>> I made change for SimpleMapServiceImpl use @Autowired to other service.
>>>
>>> Ignite start using same SpringApplicationContext:
>>> IgniteSpring.start(config, context);
>>>
>>> and @Autowired is success .
>>>
>>> But when Ignite.compute call  IgniteCallable service.
>>> The @Autowired service will be null.
>>>
>>> Is this I configured problem or Ignite issue?
>>>
>>
>