7 Replies Latest reply on Mar 11, 2010 2:37 PM by Mircea Markus

    java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore

    Sprightee s Newbie

      cacheManager =

      new DefaultCacheManager("C:\\MyWorkspace\\Infinispan\\conf\\sample-configuration.xml");

       

      Cache cache = cacheManager.getCache(

      "CacheStore");

       

      I'm getting a

      org.infinispan.config.ConfigurationException

       

       

      : Unable to instantiate cache loader or configuration

      at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(

       

      InfinispanConfiguration.java:225)

      at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(

       

      InfinispanConfiguration.java:135)

      at org.infinispan.manager.DefaultCacheManager.<init>(

       

      DefaultCacheManager.java:272)

      at org.infinispan.manager.DefaultCacheManager.<init>(

       

      DefaultCacheManager.java:253)

      at TestInfinispan.main(

       

      TestInfinispan.java:20)

      Caused by:

       

      javax.xml.bind.UnmarshalException: org.infinispan.config.ConfigurationException: Unable to instantiate cache loader or configuration

      - with linked exception:

      [

       

      com.sun.xml.internal.bind.api.AccessorException: org.infinispan.config.ConfigurationException: Unable to instantiate cache loader or configuration]

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(

       

      UnmarshallingContext.java:556)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(

       

      Loader.java:199)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.handleGenericException(

       

      Loader.java:189)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Scope.add(

       

      Scope.java:83)

      at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty$ReceiverImpl.receive(

       

      ArrayERProperty.java:170)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(

       

      UnmarshallingContext.java:439)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.endElement(

       

      ValidatingUnmarshaller.java:79)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(

       

      SAXConnector.java:109)

      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(

       

      AbstractSAXParser.java:601)

      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(

       

      XMLDocumentFragmentScannerImpl.java:1774)

      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(

       

      XMLDocumentFragmentScannerImpl.java:2930)

      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(

       

      XMLDocumentScannerImpl.java:648)

      at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(

       

      XMLNSDocumentScannerImpl.java:140)

      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(

       

      XMLDocumentFragmentScannerImpl.java:510)

      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(

       

      XML11Configuration.java:807)

      at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(

       

      XML11Configuration.java:737)

      at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(

       

      XMLParser.java:107)

      at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(

       

      AbstractSAXParser.java:1205)

      at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(

       

      SAXParserImpl.java:522)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(

       

      UnmarshallerImpl.java:195)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(

       

      UnmarshallerImpl.java:168)

      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(

       

      AbstractUnmarshallerImpl.java:137)

      at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(

       

      AbstractUnmarshallerImpl.java:105)

      at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(

       

      InfinispanConfiguration.java:217)

      ... 4 more

      Caused by:

       

      com.sun.xml.internal.bind.api.AccessorException: org.infinispan.config.ConfigurationException: Unable to instantiate cache loader or configuration

      at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedLister.addToPack(

       

      AdaptedLister.java:44)

      at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Scope.add(

       

      Scope.java:81)

      ... 24 more

      Caused by:

       

      org.infinispan.config.ConfigurationException: Unable to instantiate cache loader or configuration

      at org.infinispan.loaders.CacheLoaderConfigAdapter.unmarshal(

       

      CacheLoaderConfig.java:73)

      at org.infinispan.loaders.CacheLoaderConfigAdapter.unmarshal(

       

      CacheLoaderConfig.java:54)

      at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedLister.addToPack(

       

      AdaptedLister.java:42)

      ... 25 more

      Caused by:

       

      java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore

      at java.net.URLClassLoader$1.run(

       

      URLClassLoader.java:200)

      at java.security.AccessController.doPrivileged(

       

      Native Method)

      at java.net.URLClassLoader.findClass(

       

      URLClassLoader.java:188)

      at java.lang.ClassLoader.loadClass(

       

      ClassLoader.java:307)

      at sun.misc.Launcher$AppClassLoader.loadClass(

       

      Launcher.java:301)

      at java.lang.ClassLoader.loadClass(

       

      ClassLoader.java:252)

      at org.infinispan.util.Util.loadClass(

       

      Util.java:56)

      at org.infinispan.util.Util.getInstance(

       

      Util.java:86)

      at org.infinispan.loaders.CacheLoaderConfigAdapter.unmarshal(

       

      CacheLoaderConfig.java:70)

      ... 27 more

        • 1. Re: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore
          Manik Surtani Master
          What jars have you got in your classpath?  Have you got the relevant JDBC cache store jars?
          • 2. Re: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore
            Sprightee s Newbie
            Hi,
            I've the following jars in my classpath.
            1.       infinispan-core.jar
            2.       jboss-transaction-api-1.0.1.GA.jar
            3.       jcip-annotations-1.0.jar
            4.       jgroups-2.8.0.CR7.jar
            5.       marshalling-api-1.2.0.GA.jar
            6.       rhq-pluginAnnotations-1.4.0.B01.jar
            7.       river-1.2.0.GA.jar
            8.       jboss-common-core-2.2.14.GA.jar
            Am i missing out any jar?
            Thanks in advance.
            Cheers,
            Sprightee
            • 3. Re: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore
              Manik Surtani Master

              Yes - infinispan-cachestore-jdbc.jar and all of its dependencies.

               

              If you are using Maven, include

               

              <dependency>
                <groupId>org.infinispan</dependency>
                <artifactId>infinispan-cachestore-jdbc</artifactId>
                <version>4.0.0.FINAL</version>
              </dependency>
              

               

              in your pom.xml.

               

              If you have downloaded the zip distribution, add all of the jars in infinispan-4.0.0.FINAL/modules/jdbc and infinispan-4.0.0.FINAL/modules/jdbc/lib

               

              HTH

              Manik

              • 4. Re: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore
                Sprightee s Newbie

                Hi Manik,

                 

                    Thanks for your quick reply.

                I've added the jars in the classpath and the problem is resolved now.

                 

                I've another question(Not sure if i can post it in the same thread).

                I'm a newbie to Infinispan and trying to persist data into database during server start up and shutdown.

                 

                As the first step, i'm trying to create a cache entry.

                 

                The code is :

                 

                import

                 

                 

                import

                 

                 

                import

                 

                 

                import

                 

                 

                public

                 

                 

                /**

                 

                * @param args

                 

                */

                 

                 

                public static void main(String[] args)

                {

                CacheManager cacheManager =

                null ;

                 

                try {

                 

                cacheManager =

                new DefaultCacheManager("C:\\MyWorkspace\\Infinispan\\conf\\sample-configuration.xml");

                 

                Cache cache = cacheManager.getCache(

                "CacheStore");

                 

                cache.put(

                "name1", "aaa");

                System.

                out.println(cache.get("name1"));

                 

                }

                catch (IOException e) {

                 

                // TODO Auto-generated catch block

                e.printStackTrace();

                }

                 

                 

                 

                }

                 

                }

                 

                 

                 

                The configuration i use is :

                <namedCache name="CacheStore">
                  <loaders passivation="false" shared="false" preload="true">
                     <loader class="org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore" fetchPersistentState="false" ignoreModifications="false"
                       purgeOnStartup="false">
                             <properties>
                                <property name="stringsTableNamePrefix" value="ISPN_STRING_TABLE"/>
                                <property name="idColumnName" value="ID_COLUMN"/>
                                <property name="dataColumnName" value="DATA_COLUMN"/>
                                <property name="timestampColumnName" value="TIMESTAMP_COLUMN"/>
                                <property name="timestampColumnType" value="BIGINT"/>
                                <property name="connectionFactoryClass" value="org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory"/>
                                <property name="connectionUrl" value="jdbc:oracle:thin:@<<ipconfig>>:1521:DB;DB_CLOSE_DELAY=-1"/>
                                <property name="userName" value="user"/>
                                <property name="driverClass" value="oracle.jdbc.driver.OracleDriver"/>
                                <property name="idColumnType" value="VARCHAR(255)"/>
                                <property name="dataColumnType" value="BINARY"/>
                                <property name="dropTableOnExit" value="false"/>
                                <property name="createTableOnStart" value="true"/>
                             </properties>
                     </loader>
                  </loaders>
                    </namedCache>

                 

                 

                I'm getting the following exception:

                java.io.IOException

                :rg.infinispan.config.ConfigurationException

                 

                :rg.infinispan.config.ConfigurationException

                :rg.infinispan.config.ConfigurationException

                 

                : Couldn't find a setter named [setTimestampColumnType] which takes a single parameter, for parameter timestampColumnType on class [class org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStoreConfig]

                at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(

                 

                InfinispanConfiguration.java:225)

                at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(

                 

                InfinispanConfiguration.java:135)

                at org.infinispan.manager.DefaultCacheManager.<init>(

                 

                DefaultCacheManager.java:272)

                at org.infinispan.manager.DefaultCacheManager.<init>(

                 

                DefaultCacheManager.java:253)

                at TestInfinispan.main(

                 

                TestInfinispan.java:20)

                Caused by:

                 

                javax.xml.bind.UnmarshalException: org.infinispan.config.ConfigurationException: Couldn't find a setter named [setTimestampColumnType] which takes a single parameter, for parameter timestampColumnType on class [class org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStoreConfig]

                - with linked exception:

                [

                 

                com.sun.xml.internal.bind.api.AccessorException: org.infinispan.config.ConfigurationException: Couldn't find a setter named [setTimestampColumnType] which takes a single parameter, for parameter timestampColumnType on class [class org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStoreConfig]]

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(

                 

                UnmarshallingContext.java:556)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(

                 

                Loader.java:199)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.handleGenericException(

                 

                Loader.java:189)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Scope.add(

                 

                Scope.java:83)

                at com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty$ReceiverImpl.receive(

                 

                ArrayERProperty.java:170)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.endElement(

                 

                UnmarshallingContext.java:439)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.ValidatingUnmarshaller.endElement(

                 

                ValidatingUnmarshaller.java:79)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.SAXConnector.endElement(

                 

                SAXConnector.java:109)

                at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(

                 

                AbstractSAXParser.java:601)

                at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(

                 

                XMLDocumentFragmentScannerImpl.java:1774)

                at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(

                 

                XMLDocumentFragmentScannerImpl.java:2930)

                at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(

                 

                XMLDocumentScannerImpl.java:648)

                at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(

                 

                XMLNSDocumentScannerImpl.java:140)

                at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(

                 

                XMLDocumentFragmentScannerImpl.java:510)

                at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(

                 

                XML11Configuration.java:807)

                at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(

                 

                XML11Configuration.java:737)

                at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(

                 

                XMLParser.java:107)

                at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(

                 

                AbstractSAXParser.java:1205)

                at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(

                 

                SAXParserImpl.java:522)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(

                 

                UnmarshallerImpl.java:195)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(

                 

                UnmarshallerImpl.java:168)

                at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(

                 

                AbstractUnmarshallerImpl.java:137)

                at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(

                 

                AbstractUnmarshallerImpl.java:105)

                at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(

                 

                InfinispanConfiguration.java:217)

                ... 4 more

                Caused by:

                 

                com.sun.xml.internal.bind.api.AccessorException: org.infinispan.config.ConfigurationException: Couldn't find a setter named [setTimestampColumnType] which takes a single parameter, for parameter timestampColumnType on class [class org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStoreConfig]

                at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedLister.addToPack(

                 

                AdaptedLister.java:44)

                at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Scope.add(

                 

                Scope.java:81)

                ... 24 more

                Caused by:

                 

                org.infinispan.config.ConfigurationException: Couldn't find a setter named [setTimestampColumnType] which takes a single parameter, for parameter timestampColumnType on class [class org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStoreConfig]

                at org.infinispan.config.parsing.XmlConfigHelper.setValues(

                 

                XmlConfigHelper.java:471)

                at org.infinispan.loaders.CacheLoaderConfigAdapter.unmarshal(

                 

                CacheLoaderConfig.java:79)

                at org.infinispan.loaders.CacheLoaderConfigAdapter.unmarshal(

                 

                CacheLoaderConfig.java:54)

                at com.sun.xml.internal.bind.v2.runtime.reflect.AdaptedLister.addToPack(

                 

                AdaptedLister.java:42)

                ... 25 more

                 

                 

                class TestInfinispan {

                 

                 

                org.infinispan.manager.DefaultCacheManager;

                 

                 

                org.infinispan.manager.CacheManager;
                org.infinispan.Cache;
                java.io.IOException;

                 

                • 5. Re: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore
                  Manik Surtani Master

                  Hi - I can't really read your post very clearly.  When pasting code, use the Syntax Highlighting -> Java option, and don't paste as HTML from your IDE.  Also it may make sense to do this as a separate thread.

                   

                  - Manik

                  • 6. Re: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore
                    Mircea Markus Master
                    wiered. Can you please enable trace on org.infinispan.config.parsing.XmlConfigHelper and post the logs? That should give me some more details.