Bug 745890 (EDG-3) - Bundle cache store implementations with EDG by default
Summary: Bundle cache store implementations with EDG by default
Keywords:
Status: CLOSED NEXTRELEASE
Alias: EDG-3
Product: JBoss Data Grid 6
Classification: JBoss
Component: Build
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 6.0.0
Assignee: Tristan Tarrant
QA Contact:
URL: http://jira.jboss.org/jira/browse/EDG-3
Whiteboard:
Depends On:
Blocks: EDG-1
TreeView+ depends on / blocked
 
Reported: 2011-06-14 11:05 UTC by Martin Gencur
Modified: 2012-08-15 16:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-25 14:16:46 UTC
Type: Feature Request
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker EDG-3 0 Major Closed Bundle cache store implementations with EDG by default 2017-09-07 08:36:42 UTC

Description Martin Gencur 2011-06-14 11:05:14 UTC
project_key: EDG

Currently, it is possible to configure and use easily only FileCacheStore which is bundled
with the distribution in org/infinispan module under $EDG_HOME/modules.

It should be also possible to easily use other cache store implementations like:
* BdbjeCacheStore
* JdbmCacheStore
* JdbcBinaryCacheStore
* JdbcStringBasedCacheStore
* JdbcMixedCacheStore 

and possibly:
* CloudCacheStore
* RemoteCacheStore
* CassandraCacheStore
* ClusterCacheLoader

The jar files with implementations of these cache store should be bundled in the distribution as e.g.
submodules under $EDG_HOME/modules so that it's easy to configure and use them. In the event of not
bundling them in the distribution, please provide a guide that will clearly describe how to use/bundle
these implementations into EDG.

Comment 1 Martin Gencur 2011-06-14 11:21:08 UTC
Link: Added: This issue is a dependency of JBPAPP-6719


Comment 2 Prabhat Jha 2011-06-15 02:43:32 UTC
As far as other cache store mechanisms are concerned, the list of those will be provided in ERD once PRD is complete but I think JDBC store should be part of EDG6 alpha.

Comment 3 Trustin Lee 2011-07-13 11:20:56 UTC
To make this happen, the current infinispan subsystem needs to be modified, which is unlikely to happen in AS 7.0.  Deferring to 6.0.0 Beta.

Comment 4 Paul Ferraro 2011-08-03 18:59:11 UTC
This doesn't actually require any infinispan subsystem code changes.  All you need to do is add the relevant maven artifacts to the parent pom.xml, and add the maven resources to the module-def within $JBOSS_HOME/build/build.xml

The infinispan subsystem already supports generic cache loaders.
See schema here:
https://github.com/jbossas/jboss-as/blob/7.0.0.Final/build/src/main/resources/docs/schema/jboss-infinispan.xsd

Comment 5 Galder Zamarreño 2011-08-11 14:25:35 UTC
Added JDBC and Remote cache stores.

Comment 6 Galder Zamarreño 2011-08-12 07:35:01 UTC
According to https://docspace.corp.redhat.com/docs/DOC-71303 - the cloud one, Cassandra and JDBM are expected to be in. Reopening to get those in.

Comment 7 Galder Zamarreño 2011-08-12 10:29:39 UTC
Added cloud cache store but left Cassandra and JDBM out.

Comment 8 Martin Gencur 2011-08-15 08:54:49 UTC
Galder, it seems the cache stores integration is not complete yet. I tried to run our functional test with the latest EDG snapshot and I got the following exception:

Caused by: java.lang.ClassNotFoundException: org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore from [Module "org.jboss.as.clustering.infinispan:main" from local module loader @2b0a3b24 (roots: /home/mgencur/Java/infinispan/EDG6/jboss-datagrid-6.0.0.Alpha1-2011-08-12/modules)]
	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
	at java.lang.Class.forName0(Native Method) [:1.6.0_21]
	at java.lang.Class.forName(Class.java:169) [:1.6.0_21]
	at org.jboss.as.clustering.infinispan.subsystem.CacheContainerAdd.buildCacheStore(CacheContainerAdd.java:381)
	... 758 more

10:49:01,441 INFO  [org.jboss.as.logging] Restored bootstrap log handlers
10:49:01,458 INFO  [org.jboss.as.controller] Service status report
   New missing/unsatisfied dependencies:
      service jboss.jndi-view.extension.registry (missing)
      service jboss.naming.context.java.jboss (missing)
      service jboss.txn.TransactionManager (missing)
      service jboss.txn.TransactionSynchronizationRegistry (missing)
      service jboss.txn.UserTransaction (missing)


after adding <module name="org.infinispan.loaders.jdbc"/> to modules/org/jboss/as/clustering/infinispan/main/module.xml I got:

10:39:42,187 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.infinispan.default.default: org.jboss.msc.service.StartException in service jboss.infinispan.default.default: Failed to start service
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1786)
	at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_21]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_21]
	at java.lang.Thread.run(Thread.java:619) [:1.6.0_21]
Caused by: org.infinispan.CacheException: Unable to invoke method public void org.infinispan.loaders.CacheLoaderManagerImpl.start() on object 
	at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:173)
	at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:890)
	at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:683)
	at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:581)
	at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:180)
	at org.infinispan.CacheImpl.start(CacheImpl.java:368)
	at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:560)
	at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:454)
	at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:478)
	at org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager.getCache(DefaultEmbeddedCacheManager.java:83)
	at org.jboss.as.clustering.infinispan.DefaultEmbeddedCacheManager.getCache(DefaultEmbeddedCacheManager.java:72)
	at org.jboss.as.clustering.infinispan.subsystem.CacheService.start(CacheService.java:73)
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
	... 4 more
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_21]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_21]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_21]
	at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_21]
	at org.infinispan.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:170)
	... 16 more
Caused by: org.infinispan.CacheException: Unable to start cache loaders
	at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:129)
	... 21 more
Caused by: java.lang.IllegalArgumentException: Cannot load null class!
	at org.infinispan.util.Util.getInstance(Util.java:206)
	at org.infinispan.loaders.jdbc.connectionfactory.ConnectionFactory.getConnectionFactory(ConnectionFactory.java:42)
	at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.start(JdbcStringBasedCacheStore.java:119)
	at org.infinispan.loaders.CacheLoaderManagerImpl.start(CacheLoaderManagerImpl.java:126)
	... 21 more

this is weird because the configuration says: use <property name="connectionFactoryClass">org.infinispan.loaders.jdbc.connectionfactory.PooledConnectionFactory</property> which is bundled in the jdbc's jar.

I guess we'll get a similar problem for remote cache store (the first exception).

You can find the test at https://svn.devel.redhat.com/repos/jboss-qa/edg/edg-functional-tests/trunk/jdbc-cache-store

run it: "mvn clean verify -Dnode0.edghome=/path/to/edg"

The configuration file is located at src/test/resources/standalone.xml





Comment 9 Martin Gencur 2011-08-15 08:55:54 UTC
Reopening because it is not working correctly.

Comment 10 Martin Gencur 2011-08-16 14:47:20 UTC
Hmm, it seems that Infinispan does not take properties set in standalone.xml file into account. 

When I set
{code:xml} 
   <store class="org.infinispan.loaders.remote.RemoteCacheStore"               passivation="true">
      <property name="remoteCacheName">___defaultcache</property>
      <property name="useDefaultRemoteCache">true</property>
      <property name="hotRodClientPropertiesFile">${basedir}/target/test-classes/hotrod-client.properties</property>
   </store>
{code}
none of the properties specified via <property> tags is reflected in RemoteCacheStoreConfig class. These properties are stored (via Infinispan subsystem inside JBossAS 7) in a "properties" variable inherited by RemoteCacheStoreConfig from AbstractCacheLoaderConfig. The problem is that Infinispan does not try to retrieve these properties from this variable. RemoteCacheStore simply calls getHotRodClientProperties() but this doesn't read the "properties" variable. And *set*HotRodClientProperties() method is never called, AFAIK.

A similar problem is with Jdbc-based cache stores, since all properties are again stored in "properties" but are not read from here anymore. That's why I was getting "Cannot load null class" exception - because the setConnectionFactoryClass() method never got called and the name of the class was stored in "properties" variable.

Comment 11 Martin Gencur 2011-08-17 10:43:10 UTC
I was debugging both EDG6 and standalone Infinispan server 5.0.0.FINAL and my predictions were right. For standalone Inf. methods like setHotRodClientProperties, setRemoteCacheName in RemoteCacheStoreConfig are called which leads to setting proper values based on xml properties. For EDG, though, they are not called and these values are not set. (the same applies for class AbstractJdbcCacheStoreConfig and its methods like setConnectionFactoryClass etc.). These methods should be either called directly from infinispan subsystem inside EDG or (more likely) the properties variable, which I mentioned earlier, should be parsed by Infinispan itself when it is incorporated in EDG.

Comment 12 Galder Zamarreño 2011-09-01 10:46:29 UTC
Ok, I think this is something that needs to be solved with the AS Infinispan subsystem and we need to check with Paul to see which way he wants to parse this. We probably don't wanna leave those properties like that. I'll send an email to the dev list.

Comment 13 Galder Zamarreño 2011-09-01 11:14:01 UTC
Started a new dev thread to discuss this in http://lists.jboss.org/pipermail/infinispan-dev/2011-September/008992.html

Comment 14 Anne-Louise Tangring 2011-09-26 19:10:35 UTC
Docs QE Status: Removed: NEW 



Note You need to log in before you can comment on or make changes to this bug.