3 Replies Latest reply on Aug 4, 2011 6:04 AM by mircea.markus

    problem configuring cluster

    dmitry123

      Hi,

       

      I have been evaluating Infinispan 5.0.0CR8 for my app. Currently I'm stuck on the cluster configuration. Here's my code, classpath and the stack trace. Can somebody please tell why the error happens? Seems like either my config is wrong or a jar incompatibility. Thanks.

       

      ********************************************************************************************

          private EmbeddedCacheManager cacheManager = null;

          private static final String CACHE_CONFIG = "ispn_cache.xml";   

          public static Cache<CacheKey, UserModels> userModelCache;

          public static Cache<String, List<Controller>> controllerCache;

          public WSCache2() {

               try {     

               logger.info("ISPNCache starting");

               try {

                       this.cacheManager = new DefaultCacheManager(CACHE_CONFIG);  // <-error here

               } catch (IOException e) {

                       // TODO Auto-generated catch block

                       e.printStackTrace();

                       System.exit(1);

               }

                  this.userModelCache = this.cacheManager.getCache("userData");

                  this.controllerCache = this.cacheManager.getCache("controllerCache");

       

              } catch (Exception e) {

                  e.printStackTrace();

              }

          }

       

       

      *********************************************************************************

      <?xml version="1.0" encoding="UTF-8"?>

      <infinispan

            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

            xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"

            xmlns="urn:infinispan:config:5.0">

       

         <global>

       

            <transport

                  clusterName="infinispan-cluster"

                  machineId="m1"

                  rackId="r1" nodeName="Node-A">

               <properties>

                  <property name="configurationFile" value="jgroups-tcp.xml" />

               </properties>

       

            </transport>

       

         </global>

       

         <default>

            <locking

               isolationLevel="READ_COMMITTED"

               lockAcquisitionTimeout="20000"

               writeSkewCheck="false"

               concurrencyLevel="5000"

               useLockStriping="false"

            />

            <jmxStatistics enabled="false"/>

       

            <clustering mode="replication">

            </clustering>

         </default>

         <namedCache name="userData">

            <clustering mode="replication">

               <async asyncMarshalling="true"/>

            </clustering>

         </namedCache>  

         <namedCache name="controllerCache">

               <clustering mode="replication">

                  <async asyncMarshalling="true"/>

               </clustering>

         </namedCache>  

      </infinispan>

      *******************************************************************************

       

      /usr/global/sunjava-1.6/bin/java -classpath .:cache_test.jar:ispn/jboss-logging-3.0.0.GA.jar:ispn/jboss-marshalling-1.3.0.GA.jar:ispn/jboss-transaction-api-1.0.1.GA.jar:ispn/jcip-annotations-1.0.jar:ispn/jgroups-2.12.1.1.Final.jar:ispn/rhq-pluginAnnotations-3.0.1.jar:ispn/rhq-pluginAnnotations-3.0.1.jar:ispn/org.osgi.core-4.3.0.jar:ispn/infinispan-core.jar:workspace.service/jar/slf4j-api-1.5.10.jar:workspace.service/jar/slf4j-log4j12-1.5.10.jar:ispn/log4j-1.2.16.jar:workspace.service/config:workspace.service/config/workspaceservice/resource/ispn_cache.xml:workspace.service/config/workspaceservice/resource/jgroups-tcp.xml WSCache2

      **********************************************************************************


      java.io.IOException: 4 counts of IllegalAnnotationExceptions

              at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:263)

              at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:281)

              at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:133)

              at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:109)

              at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:252)

              at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:238)

              at WSCache2.<init>(WSCache2.java:34)

              at WSCache2.main(WSCache2.java:54)

      Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 4 counts of IllegalAnnotationExceptions

      The type of the getter is java.lang.String but that of the setter is org.infinispan.jmx.MBeanServerLookup. They have to be the same.

              this problem is related to the following location:

                      at public java.lang.String org.infinispan.config.GlobalConfiguration.getMBeanServerLookup()

                      at org.infinispan.config.GlobalConfiguration

                      at private final org.infinispan.config.GlobalConfiguration org.infinispan.config.InfinispanConfiguration.global

                      at org.infinispan.config.InfinispanConfiguration

              this problem is related to the following location:

                      at public void org.infinispan.config.GlobalConfiguration.setMBeanServerLookup(org.infinispan.jmx.MBeanServerLookup)

                      at org.infinispan.config.GlobalConfiguration

                      at private final org.infinispan.config.GlobalConfiguration org.infinispan.config.InfinispanConfiguration.global

                      at org.infinispan.config.InfinispanConfiguration

      org.infinispan.loaders.CacheLoaderConfig is an interface, and JAXB can't handle interfaces.

              this problem is related to the following location:

                      at org.infinispan.loaders.CacheLoaderConfig

                      at private java.util.List org.infinispan.config.CacheLoaderManagerConfig.getCacheLoaders()

                      at org.infinispan.config.CacheLoaderManagerConfig

                      at org.infinispan.config.CacheLoaderManagerConfig org.infinispan.config.Configuration.loaders

                      at org.infinispan.config.Configuration

                      at private final org.infinispan.config.Configuration org.infinispan.config.InfinispanConfiguration.defaultConfiguration

                      at org.infinispan.config.InfinispanConfiguration

      The type of the getter is java.lang.String but that of the setter is java.lang.Class<? extends org.infinispan.interceptors.base.CommandInterceptor>. They have           to be the same.

              this problem is related to the following location:

                      at public java.lang.String org.infinispan.config.CustomInterceptorConfig.getAfterInterceptor()

                      at org.infinispan.config.CustomInterceptorConfig

                      at private java.util.List org.infinispan.config.Configuration$CustomInterceptorsType.customInterceptors

                      at org.infinispan.config.Configuration$CustomInterceptorsType

                      at org.infinispan.config.Configuration$CustomInterceptorsType org.infinispan.config.Configuration.customInterceptors

                      at org.infinispan.config.Configuration

                      at private final org.infinispan.config.Configuration org.infinispan.config.InfinispanConfiguration.defaultConfiguration

                      at org.infinispan.config.InfinispanConfiguration

              this problem is related to the following location:

                      at public void org.infinispan.config.CustomInterceptorConfig.setAfterInterceptor(java.lang.Class)

                      at org.infinispan.config.CustomInterceptorConfig

                      at private java.util.List org.infinispan.config.Configuration$CustomInterceptorsType.customInterceptors

                      at org.infinispan.config.Configuration$CustomInterceptorsType

                      at org.infinispan.config.Configuration$CustomInterceptorsType org.infinispan.config.Configuration.customInterceptors

                      at org.infinispan.config.Configuration

                      at private final org.infinispan.config.Configuration org.infinispan.config.InfinispanConfiguration.defaultConfiguration

                      at org.infinispan.config.InfinispanConfiguration

      The type of the getter is java.lang.String but that of the setter is java.lang.Class<? extends org.infinispan.interceptors.base.CommandInterceptor>. They have           to be the same.

              this problem is related to the following location:

                      at public java.lang.String org.infinispan.config.CustomInterceptorConfig.getBeforeInterceptor()

                      at org.infinispan.config.CustomInterceptorConfig

                      at private java.util.List org.infinispan.config.Configuration$CustomInterceptorsType.customInterceptors

                      at org.infinispan.config.Configuration$CustomInterceptorsType

                      at org.infinispan.config.Configuration$CustomInterceptorsType org.infinispan.config.Configuration.customInterceptors

                      at org.infinispan.config.Configuration

                      at private final org.infinispan.config.Configuration org.infinispan.config.InfinispanConfiguration.defaultConfiguration

                      at org.infinispan.config.InfinispanConfiguration

              this problem is related to the following location:

                      at public void org.infinispan.config.CustomInterceptorConfig.setBeforeInterceptor(java.lang.Class)

                      at org.infinispan.config.CustomInterceptorConfig

                      at private java.util.List org.infinispan.config.Configuration$Cu

                      at org.infinispan.config.Configuration$CustomInterceptorsType

                      at org.infinispan.config.Configuration$CustomInterceptorsType or

                      at org.infinispan.config.Configuration

                      at private final org.infinispan.config.Configuration org.infinis

                      at org.infinispan.config.InfinispanConfiguration

       

              at com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException$Buil

              at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(J

              at com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBConte

              at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFact

              at com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFact

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

              at java.lang.reflect.Method.invoke(Method.java:597)

              at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:210)

              at javax.xml.bind.ContextFinder.find(ContextFinder.java:381)

              at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)

              at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)

              at org.infinispan.config.InfinispanConfiguration.getJAXBContext(Infinisp

              at org.infinispan.config.InfinispanConfiguration.newInfinispanConfigurat

              ... 7 more

        • 1. Re: problem configuring cluster
          dmitry123

          I modified the config to have only bare bones info:

           

          <?xml version="1.0" encoding="UTF-8"?>

          <infinispan

                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="urn:infinispan:config:5.0 http://www.infinispan.org/schemas/infinispan-config-5.0.xsd"

                xmlns="urn:infinispan:config:5.0">

             <global>

                <transport/>

             </global>

             <default>

                <clustering mode="replication">

                </clustering>

             </default>

             <namedCache name="userData">

             </namedCache>  

             <namedCache name="controllerCache">       

             </namedCache>  

          </infinispan>

           

          This works in Windows. Running the same code and config in Linux, with the same CLASSPATH as in Windows, still gives me the IOException. The config file is on the classpath in Linux environment. Can somebody please hint at what's causing the exception above?

          • 2. Re: problem configuring cluster
            dmitry123

            Thank you everyone for replying .

             

            Found the problem. My Windows setup was using JDK 1.6.0_20 and Linux was on 1.6.0_03. I don't remember seeing anything in the instructions about the version of Java 6 that's needed. So if somebody else runs into this problem please go with at least version 1.6.0_20. Thanks again for replying!

            • 3. Re: problem configuring cluster
              mircea.markus

              Thanks for reporting this back Dimitry.