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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -

php - Accessing static methods using newly created $obj or using class Name -