java - Using Infinispan's EmbeddedCacheManager with Openshift -
i trying use infinispan cache java application hosted jboss 7 on openshift.
i have following cluster configuration in standalone.xml.
<cache-container name="cluster" aliases="ha-partition" default-cache="default"> <transport lock-timeout="60000"/> <replicated-cache name="default" mode="sync" batching="true" start="eager"> <locking isolation="repeatable_read"/> </replicated-cache> </cache-container> i tried accessing cache following code snippet.
@resource(lookup = "java:jboss/infinispan/container/cluster") embeddedcachemanager container; private cache<string, integer> foo = container.getcache("foo", true); however, nullpointerexception thrown on line container.getcache. presumably because lookup failed find value container.
what doing wrong?
you can use getcache call in @postconstuct method
Comments
Post a Comment