Bug 745890 (EDG-3)
| Summary: | Bundle cache store implementations with EDG by default | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Data Grid 6 | Reporter: | Martin Gencur <mgencur> |
| Component: | Build | Assignee: | Tristan Tarrant <ttarrant> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | |
| Severity: | high | Docs Contact: | |
| Priority: | high | ||
| Version: | 6.0.0 | CC: | galder.zamarreno, jdg-bugs, mgencur, mlinhard, paul.ferraro, prabhat.jha |
| Target Milestone: | --- | ||
| Target Release: | 6.0.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://jira.jboss.org/jira/browse/EDG-3 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2011-11-25 14:16:46 UTC | Type: | Feature Request |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 745891 | ||
|
Description
Martin Gencur
2011-06-14 11:05:14 UTC
Link: Added: This issue is a dependency of JBPAPP-6719 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. 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. 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 Added JDBC and Remote cache stores. 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. Added cloud cache store but left Cassandra and JDBM out. 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
Reopening because it is not working correctly. 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.
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. 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. Started a new dev thread to discuss this in http://lists.jboss.org/pipermail/infinispan-dev/2011-September/008992.html Docs QE Status: Removed: NEW |