3 Replies Latest reply on Sep 5, 2012 8:37 PM by Mircea Markus

    Trouble getting started

    Ron Albury Newbie

      I am a long time Java developer - which also means I am a bit 'old' and haven't picked up Maven yet (I don't particulary like what I've seen of it).

       

      I read (didn't keep the URL) that to get started with Infinispan I could either download the Infinispan distribution or download the latest JBoss AS.  I am going to develop a J2EE application with Infinispan and Drools (among other tools), so I decided to just jump into JBoss (my previous work has been with Websphere, Glassfish, and Weblogic) - I downloaded and installed JBoss 7.1.1.Final and JBDevStudio 5.0.

       

      I started experimenting with Infinispan.  I created a Java project and imported (from the JBoss directory) infinispan-core-5.1.2.FINAL, jboss-logging-3.1.0.GA, jboss-transaction-api_1.1_spec-1.0.0.Final, jboss-marshalling-1.3.11.GA, jboss-marshalling-river-1.3.11.GA.

       

      I have experienced the following problems:

         a) Eclipse (JBDevStudio) is complaining about org.rhq.helpers.  From what I've seen this is a compile time dependancy that has somehow crept into the runtime.  I can not find any jar for rhq in the JBoss distribution - did I just miss it?  I can run without it, but my style is to address and eliminate any Eclipse warnings from my projects and I am not sure what to do with this one.

       

         b) I am particularly interested in TreeCache.  When trying to follow the example code in the Infinispan quickstart area I discovered that the code contained references to several deprecated objects/methods (i.e. Configuration, setInvocationBatchingEnabled, DefaultCacheManager).  What have they been replaced with?

       

         c) I can find no jar files in the JBoss distribution for TreeCache, TreeCacheFactory, etc.  Is the JBoss distribution incomplete or did I just miss it?  If I want to run TreeCache in a JBoss application, do I need to jump thru any special hoops?

       

       

      I apologize for these elemenatary question.  I have tried to RTFM, however TFM is incomplete and not always so clear.

       

      I appreciate any help you can provide,

          RonA

        • 1. Re: Trouble getting started
          Mircea Markus Master

          Thanks for the feedback Ron!

          I cannot answer a) as I'm not an eclipse user, but re:

          b) we've remade configuration based on a fluent API. More about it here: http://infinispan.blogspot.co.uk/2012/01/configuration-changes-in-infinispan.html

          In 6.0 we'll drop the old/deprecated configuration entirely.

          c) the classes you're looking at should be in modules/tree/infinispan-tree.jar

          1 of 1 people found this helpful
          • 2. Re: Trouble getting started
            Ron Albury Newbie

            Thanks for getting back to me Mircea.

             

            I'm afraid the jar file isn't there under JBoss.  Under modules there is an org/infinispan which has folders cachestore, main, and client.  None of those have infinispan-tree.jar.  See following terminal session:

            cd /usr/local/jboss-as-7.1.1.Final

            find . -name "infinispan*"

            ./modules/org/jboss/as/clustering/ejb3/infinispan

            ./modules/org/jboss/as/clustering/web/infinispan

            ./modules/org/jboss/as/clustering/infinispan

            ./modules/org/infinispan

            ./modules/org/infinispan/main/infinispan-core-5.1.2.FINAL.jar.index

            ./modules/org/infinispan/main/infinispan-core-5.1.2.FINAL.jar

            ./modules/org/infinispan/cachestore/remote/main/infinispan-cachestore-remote-5.1.2.FINAL.jar

            ./modules/org/infinispan/cachestore/remote/main/infinispan-cachestore-remote-5.1.2.FINAL.jar.index

            ./modules/org/infinispan/cachestore/jdbc/main/infinispan-cachestore-jdbc-5.1.2.FINAL.jar.index

            ./modules/org/infinispan/cachestore/jdbc/main/infinispan-cachestore-jdbc-5.1.2.FINAL.jar

            ./modules/org/infinispan/client/hotrod/main/infinispan-client-hotrod-5.1.2.FINAL.jar

             

            I downloaded the infinispan zip file directly and was able to find everything I needed, including rhq - but they are not coming with JBoss.

             

            With regards to configuration ... I thought I'd try doing it in xml and avoid the whole issue.  However, some of the xml examples provided are not valid.  For instance, in the User Guide, under Cache Loaders there is the following snippet:

             

            <loaders passivation="false" shared="false" preload="true">

             

               <!-- We can have multiple cache loaders, which get chained -->

               <fileStore

                       fetchPersistentState="true"

                       purgerThreads="3"

                       purgeSynchronously="true"

                       ignoreModifications="false"

                       purgeOnStartup="false"

                       location="${java.io.tmpdir}" />

                  <async enabled="true" flushLockTimeout="15000" threadPoolSize="5"/>

                  <singletonStore enabled="true" pushStateWhenCoordinator="true" pushStateTimeout="20000"/>

               </fileStore>

            </loaders>

             

            I'm assuming that was once legal, but as far as I can tell there is no fileStore element in the current infinispan xsd.  I got it to work as follows:

            <loaders passivation="false" shared="false" preload="true">

                              <loader

                                  class="org.infinispan.loaders.file.FileCacheStore"

                                  fetchPersistentState="true"

                                  purgerThreads="1"

                                  purgeSynchronously="true"

                                  ignoreModifications="false"

                                  purgeOnStartup="false">

                                  <properties>

                                      <property name="location" value="/home/eialbur/infiniCache" />

                                  </properties>

                              </loader>

                          </loaders>

             

             

            Please understand ... I know this is a community project and not a commercial product ... I'm not trying to be a b*tch.  If I decide to start using infinispan I'll try to help, even if only with the documentation.  It's just difficult to know if I'm going to use it when I'm groping in the dark trying to get started.

             

            Thank you again for your kind response.

            • 3. Re: Trouble getting started
              Mircea Markus Master

              Can you please try with a newer release, e.g. 5.1.6: http://www.jboss.org/infinispan/downloads

              Jars have been shuffeld around in between.

              re: the configuration, this (nicer) way of configuring the store was added 5.2 and hasn't been released yet. Sorry for the confusion.