-
1. Re: Unable to lookup Infinispan cache in EJB
amanukyan Feb 12, 2013 9:44 AM (in response to mylos78)Hi Mylos,
for getting Infinispan cache manager being injected you need to do the following:
e.g. assume you have some container defined in your EAP or JBoss AS standalone-*.xml defined and you want to inject it. The important thing that should be done is - you need to define jndi-name attribute for that container so that you can get it later via injection.
<subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="cluster">
....
<cache-container name="cluster" aliases="ha-partition" default-cache="default" jndi-name="java:jboss/infinispan/cluster">
<transport lock-timeout="60000"/>
<replicated-cache name="default" mode="SYNC" batching="true">
<locking isolation="REPEATABLE_READ"/>
</replicated-cache>
</cache-container>
</synsystem>
Then in your code, the following line will inject the cache manager properly.
@Resource(lookup="java:jboss/infinispan/cluster")
private org.infinispan.manager.CacheContainer container;
Hope this will help.
Regards,
Anna.