0

Hi Im using infnispan subsytem from wildfly 10 to have cache configuration. with local cache it is working fine . now i got a scenario to cluster cache between servers. this is my subssytem configuration

 <cache-container name="myCache" default-cache="default">
<transport lock-timeout="60000" stack="tcp"/>
                <replicated-cache name="default" mode="SYNC">
                    <locking isolation="REPEATABLE_READ"/>
                </replicated-cache>
            </cache-container>

and this is my jgroups subsystem configuration in standalone-ha.xml

 <subsystem xmlns="urn:jboss:domain:jgroups:4.0">
            <channels default="ee">
                <channel name="ee" stack="udp"/>
            </channels>
            <stacks>
                <stack name="udp">
                    <transport type="UDP" socket-binding="jgroups-udp"/>
                    <protocol type="PING"/>
                    <protocol type="MERGE3"/>
                    <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
                    <protocol type="FD_ALL"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="UFC"/>
                    <protocol type="MFC"/>
                    <protocol type="FRAG2"/>
                </stack>
                <stack name="tcp">
                    <transport type="TCP" socket-binding="jgroups-tcp"/>
                    <protocol type="MPING" socket-binding="jgroups-mping"/>
                    <protocol type="MERGE3"/>
                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
                    <protocol type="FD"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="MFC"/>
                    <protocol type="FRAG2"/>
                </stack>
            </stacks>
        </subsystem>

cache will get initialized if im not using transport in cachecontainer. as suggested in document trasnport tag is mandatory to have clustered cache. upon using transport tag in cachecontainer im facing following error.

19:26:14,244 ERROR [stderr] (ServerService Thread Pool -- 70) javax.naming.NameNotFoundException: infinispan/container/myCache [Root exception is java.lang.IllegalStateException]
19:26:14,244 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:153)
19:26:14,244 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:83)
19:26:14,244 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
19:26:14,244 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
19:26:14,245 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:237)
19:26:14,245 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
19:26:14,245 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
19:26:14,245 ERROR [stderr] (ServerService Thread Pool -- 70)   at javax.naming.InitialContext.lookup(InitialContext.java:417)
19:26:14,246 ERROR [stderr] (ServerService Thread Pool -- 70)   at javax.naming.InitialContext.lookup(InitialContext.java:417)
19:26:14,246 ERROR [stderr] (ServerService Thread Pool -- 70)   at com.sixdee.infinispan.cluster.Initialiser.initialiseCache(Initialiser.java:35)
19:26:14,246 ERROR [stderr] (ServerService Thread Pool -- 70)   at com.sixdee.infinispan.cluster.Initialiser.init(Initialiser.java:26)
19:26:14,247 ERROR [stderr] (ServerService Thread Pool -- 70)   at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
19:26:14,247 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
19:26:14,247 ERROR [stderr] (ServerService Thread Pool -- 70)   at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
19:26:14,247 ERROR [stderr] (ServerService Thread Pool -- 70)   at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:231)
19:26:14,248 ERROR [stderr] (ServerService Thread Pool -- 70)   at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
19:26:14,248 ERROR [stderr] (ServerService Thread Pool -- 70)   at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
19:26:14,248 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
19:26:14,249 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
19:26:14,249 ERROR [stderr] (ServerService Thread Pool -- 70)   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
19:26:14,249 ERROR [stderr] (ServerService Thread Pool -- 70)   at java.util.concurrent.FutureTask.run(FutureTask.java:266)
19:26:14,249 ERROR [stderr] (ServerService Thread Pool -- 70)   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
19:26:14,250 ERROR [stderr] (ServerService Thread Pool -- 70)   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
19:26:14,250 ERROR [stderr] (ServerService Thread Pool -- 70)   at java.lang.Thread.run(Thread.java:745)
19:26:14,251 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.threads.JBossThread.run(JBossThread.java:320)
19:26:14,251 ERROR [stderr] (ServerService Thread Pool -- 70) Caused by: java.lang.IllegalStateException
19:26:14,252 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.msc.value.InjectedValue.getValue(InjectedValue.java:47)
19:26:14,252 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.service.BinderService.getValue(BinderService.java:138)
19:26:14,252 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.service.BinderService.getValue(BinderService.java:46)
19:26:14,252 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.msc.service.ServiceControllerImpl.getValue(ServiceControllerImpl.java:1158)
19:26:14,253 ERROR [stderr] (ServerService Thread Pool -- 70)   at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:131)
19:26:14,253 ERROR [stderr] (ServerService Thread Pool -- 70)   ... 24 more

initializing cache in my code as follows

Context initContext = new InitialContext();
initContext.lookup("java:jboss/infinispan/container/myCache")).getCache());

following is my jboss-deployment-structure.xml

<jboss-deployment-structure>
    <deployment>
        <exclusions>
        </exclusions>
        <dependencies>
            <module name="org.infinispan" export="true" />
        </dependencies>
    </deployment>
</jboss-deployment-structure>

starting application using standalone-ha.xml

any suggestion on where im wrong?

0 Answers0