3 Replies Latest reply on Feb 4, 2013 7:25 PM by internet user

    Not able to deploy infinispan cache - error ModuleLoadFailed for Application war file

    internet user Newbie

      Hi,

       

      We have a application war file which starts fine in Jboss 7.0. we are using infinispan for the caching application owned objects. NOTE that the application classes are currently part of WEB-INF/classes folder. Current setup is as explained below:

       

      1. the cache is defined in standalone-ha.xml using:

       

                  <cache-container name="xxxx" default-cache="yyyy" jndi-name="java:jboss/infinispan/xxxx">

                      <transport lock-timeout="60000"/>

                      <replicated-cache name="yyyyy" mode="ASYNC" start="EAGER" batching="true">

                          <locking isolation="REPEATABLE_READ"/>

                          <eviction strategy="LRU" max-entries="1"/>

                          <file-store/>

                      </replicated-cache>

                  </cache-container>

       

      2. There is a startup servlet whose initialize method lookup this jndi infinispan service and loads the cache with initial data (the cache is having single key and value of that key is a application specific AppDataBean object)

       

        container = (org.infinispan.manager.CacheContainer)jndiCntx.lookup("java:jboss/infinispan/xxxx");

                                    CacheService.cache = container.getCache( "yyyyy" );

       

      3. Since this is startup servlet, when we start first server in cluster, the cache gets loaded fine

       

      4. the issue comes when we start the sercond server. When the second server is starting up, both servers start receiving errors:

       

      ERROR [org.infinispan.cacheviews.CacheViewsManagerImpl] (CacheViewInstaller-1,FIRST_SERVER/myapp) ISPN000172: Failed to prepare view CacheView{viewId=2, members=[FIRST_SERVER/myapp, SECOND_SERVER/myapp]} for cache  myappcache, rolling back to view CacheView{viewId=1, members=[FIRST_SERVER/myapp]}: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: org.infinispan.CacheException: Problems invoking command.

      .....

      Caused by: java.util.concurrent.ExecutionException: org.infinispan.CacheException: Problems invoking command.

      .....

      Caused by: org.infinispan.CacheException: Problems invoking command.

      .....

      Caused by: java.io.InvalidClassException: com.mycompany.myproject.AppDataBean; Module load failed

      .....

      Caused by: org.jboss.modules.ModuleNotFoundException: deployment.myapp.war:main

       

       

      We tried to create a separate module for application classes, but in that case the jndi lookup fails every time and we get nullpointer exception.

       

      We are testing this in JBoss 7.1.2 build by us.

       

      please help