Access WildFly Infinispan Cache Container from Web Application
andreap1 Sep 28, 2017 3:48 AMHi all,
we are trying to access Infinispan CacheManager in order to use it from a Web Application
Is there a way to do this ?
We followed some examples found around on SO and other sites but up to now no luck.
This is how we are proceeding:
The servlet code:
@WebServlet("/InfinispanWeb")
public class InfinispanWeb extends HttpServlet {
private static final long serialVersionUID = 1L;
@Resource(lookup = "java:jboss/infinispan/mycache")
private CacheContainer cc;
/* NOTE: up to now, no code is using CacheContainer cc .... */
META-INF/MANIFEST.MF
Dependencies: org.infinispan export
The configuration of mycache container in WildFly domain.xml (full profile)
<cache-container name="mycache" default-cache="default" module="org.wildfly.clustering.server" jndi-name="infinispan/mycache">
<transport lock-timeout="60000"/>
<replicated-cache name="default" jndi-name="infinispan/mycache/default" mode="SYNC"/>
</cache-container>
We use WildFly web console to deploy the war, resulting in a deployment failure and the following error in the log file
2017-09-28 09:41:37,456 INFO [org.jboss.as.repository] (ServerService Thread Pool -- 90) WFLYDR0002: Content removed from location C:\wildfly-10.1.0.Final\domain\servers\server-one\data\content\6b\6737b6192d9a71fa7acfb262e5928bf922b8ff\content
2017-09-28 09:41:44,743 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) WFLYSRV0027: Starting deployment of "InfinispanWeb.war" (runtime-name: "InfinispanWeb.war")
2017-09-28 09:41:44,783 WARN [org.jboss.as.dependency.private] (MSC service thread 1-8) WFLYSRV0018: Deployment "deployment.InfinispanWeb.war" is using a private module ("org.infinispan:main") which may be changed or removed in future versions without notice.
2017-09-28 09:41:44,870 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 90) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "InfinispanWeb.war")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}
2017-09-28 09:41:44,870 ERROR [org.jboss.as.server] (ServerService Thread Pool -- 90) WFLYSRV0021: Deploy of deployment "InfinispanWeb.war" was rolled back with the following failure message: {"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}
2017-09-28 09:41:45,110 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) WFLYSRV0028: Stopped deployment InfinispanWeb.war (runtime-name: InfinispanWeb.war) in 238ms
Can someone point us to what are we doing wrong ?
Is this a feasible way for using Infinispan data grid ?
Thanks a lot for your support....
-------------------------------------------------
Andrea