You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by 上帝已死 <52...@qq.com> on 2016/03/14 02:09:57 UTC

How can i get the ignite instance im my code when i had config the Spring Cache?

This is my Spring Cache's configuration:


When I try to get the ignite instance in my code, I got an error:




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by vkulichenko <va...@gmail.com>.
It would be really great if you share your logs. Otherwise it's very hard to
understand the reason of your issue.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3520.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by 上帝已死 <52...@qq.com>.
It seems i can't set SpringCacheManager's configuration by "ref". The
following configuration is work ok:




--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3505.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by vkulichenko <va...@gmail.com>.
I see two possible reasons: the node doesn't start or you call
Ignition.ignite() before it starts. I would add a debug print out next to
Ignition.ignite() call and check the logs.

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3503.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by 上帝已死 <52...@qq.com>.
I want to use both IgniteCache API and SpringCacheManager.I know spring start
an ignite instance when tomcat start, so i want to use this ignite instance
when i need to use IgniteCache API. I had set the SpringCacheManager's
ignite grid name to "myGrid", why i can't get it?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3500.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by vkulichenko <va...@gmail.com>.
Hi,

The node should be automatically started and you should see that in the
logs. Most likely you called Ignition.ignite() before that somehow.

Anyway, can you clarify what are you trying to achieve? If you want to use
IgniteCache API, you don't need SpringCacheManager. It should be used only
if you intend to utilize Spring Cache Abstraction:
https://docs.spring.io/spring/docs/current/spring-framework-reference/html/cache.html

-Val



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3497.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by 上帝已死 <52...@qq.com>.
Actually, what i want to ask is why spring won't start the ignite instance(i
had config the grid name as "myGrid") when the application start?
<http://apache-ignite-users.70518.x6.nabble.com/file/n3489/E56F0F3C-9186-4C03-9119-AC95DDAEB931.png> 



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3489.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by Pavel Tupitsyn <pt...@gridgain.com>.
You have to call Ignition.start("PATH_TO_SPRING_XML") to start a grid from
Spring configuration file.

On Mon, Mar 14, 2016 at 1:08 PM, 上帝已死 <52...@qq.com> wrote:

> No, I am not call Ignition.start("myGrid") anywhere before, But I think
> spring will start it.
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3487.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by 上帝已死 <52...@qq.com>.
No, I am not call Ignition.start("myGrid") anywhere before, But I think
spring will start it.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477p3487.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: How can i get the ignite instance im my code when i had config the Spring Cache?

Posted by Pavel Tupitsyn <pt...@gridgain.com>.
Hi,

Did you call Ignition.start("myGrid") anywhere before, as the error message
suggests?

On Mon, Mar 14, 2016 at 4:09 AM, 上帝已死 <52...@qq.com> wrote:

> This is my Spring Cache's configuration:
>
>
> When I try to get the ignite instance in my code, I got an error:
>
>
>
>
> --
> View this message in context:
> http://apache-ignite-users.70518.x6.nabble.com/How-can-i-get-the-ignite-instance-im-my-code-when-i-had-config-the-Spring-Cache-tp3477.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>