[JBoss JIRA] Created: (ISPN-1228) Support properties placeholders on infinispan configuration files
by Raúl Raja Martínez (JIRA)
Support properties placeholders on infinispan configuration files
-----------------------------------------------------------------
Key: ISPN-1228
URL: https://issues.jboss.org/browse/ISPN-1228
Project: Infinispan
Issue Type: Feature Request
Components: Configuration
Affects Versions: 5.0.0.CR7
Reporter: Raúl Raja Martínez
Assignee: Manik Surtani
Fix For: 5.0.0.FINAL
Currently all values configured in infinispan.xml need to be hardcoded in the file as System property placeholders are not supported.
There are many cases when it's not ideal to have the values there for example when configuring a jdbc cache store, the db, user, pass, etc... need to be hardcoded for the configuration to work.
Ideally infinispan would resolve placeholders such as ${jdbc.user} to a predefined system property or a property file, with that name in the same way other frameworks like spring, ant, maven, etc... do.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Created: (ISPN-1232) Infinispan module loader doesn't work in OSGi environments
by Craig Ching (JIRA)
Infinispan module loader doesn't work in OSGi environments
----------------------------------------------------------
Key: ISPN-1232
URL: https://issues.jboss.org/browse/ISPN-1232
Project: Infinispan
Issue Type: Bug
Components: Core API
Affects Versions: 5.0.0.CR7
Environment: $ uname -ovr
2.6.32-131.4.1.el6.x86_64 #1 SMP Fri Jun 10 10:54:26 EDT 2011 GNU/Linux
Reporter: Craig Ching
Assignee: Manik Surtani
We're trying to upgrade from 4.2.0.Final to 5.0.0.CR7. We run Infinispan in an Equinox OSGi environment and are having problems loading the query module (and maybe others, I haven't gotten beyond query at this point). What I've found in my digging is documented in the "Forum Reference", but, in essence, it appears that Infinispan 5.0.0.x included it's own module loader that doesn't work in OSGi environments. The crux of the problem is that Infinispan needs to find "infinispan-module.properties" in the query jar file, but it can't do that by trying to load it from the system class loader as it's currently doing. I'm a bit rusty on loading resources in OSGi, so I'm not exactly sure how to resolve it. I would have thought that you would include the resource in a package (not the default package) that you could export from the query module and optionally import in the core module, but maybe there's a better way.
To get you on the right track, in:
core/src/main/java/org/infinispan/factories/AbstractComponentRegistry.java
this comment:
// Modules must be on the same classloader as Infinispan
// TODO revise this assumption
protected static List<ModuleLifecycle> moduleLifecycles = ModuleProperties.resolveModuleLifecycles(null);
(null could be a user-specified CL if there were a way to set it)
indicates that modules must be on the same CL as infinispan core. That isn't 100% true, since this is how it looks up the CL(s) to use (in infinsipan.util.FileLookup):
protected Collection<URL> getAsURLsFromClassLoader(String filename, ClassLoader userClassLoader) throws IOException {
ClassLoader[] cls = new ClassLoader[] {
userClassLoader, // User defined classes
Util.class.getClassLoader(), // Infinispan classes (not always on TCCL [modular env])
ClassLoader.getSystemClassLoader() // Used when load time instrumentation is in effect
};
Collection<URL> urls = new HashSet<URL>();
for (ClassLoader cl : cls) {
if (cl == null)
continue;
try {
urls.addAll(new EnumerationList<URL>(cl.getResources(filename)));
} catch (RuntimeException e) {
// Ignore this as the classloader may throw exceptions for a valid path on Windows
}
}
return urls;
}
Also as an FYI, this code in ModuleProperties.loadModuleProperties():
Collection<URL> resources = new FileLookup().lookupFileLocations(MODULE_PROPERTIES_FILENAME, cl);
if (resources == null)
throw new IOException("Could not find " + MODULE_PROPERTIES_FILENAME
+ " files on classpath for module " + moduleName);
The if (resources == null) condition will never be true because of:
Collection<URL> urls = new HashSet<URL>();
...
return urls;
in FileLookup.getAsURLsFromClassLoader(). If it had, it might have been easier to figure out what was going wrong.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Created: (ISPN-1247) StoreAsBinary configuration
by Mathieu Lachance (JIRA)
StoreAsBinary configuration
---------------------------
Key: ISPN-1247
URL: https://issues.jboss.org/browse/ISPN-1247
Project: Infinispan
Issue Type: Bug
Components: Configuration
Affects Versions: 5.0.0.CR7
Reporter: Mathieu Lachance
Assignee: Manik Surtani
Priority: Minor
Fix For: 5.0.0.FINAL
When enabling storeAsBinary with the xml configuration you cannot specify value for xml attribute storeKeysAsBinary nor storeValuesAsBinary.
<storeAsBinary enabled="true" storeKeysAsBinary="true" storeValuesAsBinary="true"/> will fail on runtime with this stack trace :
java.io.IOException: The property has a getter "public java.lang.Boolean org.infinispan.config.Configuration$StoreAsBinary.isStoreKeysAsBinary()" but no setter. For unmarshalling, please define setters. (Or if this is a collection property, make sure that the getter returns a collection instance.)
at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:262)
at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:280)
at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:132)
at org.infinispan.config.InfinispanConfiguration.newInfinispanConfiguration(InfinispanConfiguration.java:108)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:253)
at org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:239)
at com.frimastudio.commons.infinispan.Infinispan.<clinit>(Infinispan.java:37)
at com.frimastudio.snowstorm.core.AbstractBll.start(AbstractBll.java:159)
at com.frimastudio.snowstorm.core.ModuleLoader$2.call(ModuleLoader.java:581)
at com.frimastudio.snowstorm.core.ModuleLoader$2.call(ModuleLoader.java:1)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
<storeAsBinary enabled="true" /> will pass and default value (true) will be applied over storeKeysAsBinary and storeValuesAsBinary properties.
But does it really make sense to store keys while not value as binary or vice versa ?
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Created: (ISPN-1243) JdbcStringBasedCacheStore closes the StateTransferManagerImpl marshaller while state transfer is in progress
by Dan Berindei (JIRA)
JdbcStringBasedCacheStore closes the StateTransferManagerImpl marshaller while state transfer is in progress
------------------------------------------------------------------------------------------------------------
Key: ISPN-1243
URL: https://issues.jboss.org/browse/ISPN-1243
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores, Marshalling
Affects Versions: 5.0.0.CR7
Reporter: Dan Berindei
Assignee: Dan Berindei
Fix For: 5.1.0.BETA1, 5.1.0.Final
We use the same marshaller instance both in StateTransferManagerImpl and in JdbcStringBasedCacheStore, but RiverMarshaller is not reentrant, so when JdbcStringBasedCacheStore starts unmarshalling its entry it invalidates the marshaller for StateTransferManagerImpl:
Incoming-2,Infinispan-Cluster,NodeB-1353@2229, prio=5, in group 'Thread Pools', status: 'runnable'
java.lang.Thread.State: RUNNABLE
at org.jboss.marshalling.AbstractUnmarshaller.start(AbstractUnmarshaller.java:91)
at org.jboss.marshalling.river.RiverUnmarshaller.start(RiverUnmarshaller.java:1181)
at org.infinispan.marshall.jboss.GenericJBossMarshaller.startObjectInput(GenericJBossMarshaller.java:189)
at org.infinispan.marshall.VersionAwareMarshaller.startObjectInput(VersionAwareMarshaller.java:162)
at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:119)
at org.infinispan.marshall.AbstractMarshaller.objectFromInputStream(AbstractMarshaller.java:112)
at org.infinispan.loaders.jdbc.JdbcUtil.unmarshall(JdbcUtil.java:88)
at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.readStoredEntry(JdbcStringBasedCacheStore.java:384)
at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.loadLockSafe(JdbcStringBasedCacheStore.java:316)
at org.infinispan.loaders.jdbc.stringbased.JdbcStringBasedCacheStore.loadLockSafe(JdbcStringBasedCacheStore.java:87)
at org.infinispan.loaders.LockSupportCacheStore.load(LockSupportCacheStore.java:130)
at org.infinispan.interceptors.CacheLoaderInterceptor.loadIfNeeded(CacheLoaderInterceptor.java:149)
at org.infinispan.interceptors.CacheLoaderInterceptor.visitPutKeyValueCommand(CacheLoaderInterceptor.java:80)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:133)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:60)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:214)
at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:162)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:119)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:104)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:64)
at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:60)
at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:274)
at org.infinispan.CacheImpl.put(CacheImpl.java:513)
at org.infinispan.statetransfer.StateTransferManagerImpl.applyInMemoryState(StateTransferManagerImpl.java:308)
at org.infinispan.statetransfer.StateTransferManagerImpl.applyState(StateTransferManagerImpl.java:280)
at org.infinispan.remoting.InboundInvocationHandlerImpl.applyState(InboundInvocationHandlerImpl.java:230)
at org.infinispan.remoting.transport.jgroups.JGroupsTransport.setState(JGroupsTransport.java:615)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.handleUpEvent(MessageDispatcher.java:711)
at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:771)
at org.jgroups.JChannel.up(JChannel.java:1441)
...
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Created: (ISPN-1242) Add dynamic grouping capabilities for immutable key classes.
by Erik Salter (JIRA)
Add dynamic grouping capabilities for immutable key classes.
------------------------------------------------------------
Key: ISPN-1242
URL: https://issues.jboss.org/browse/ISPN-1242
Project: Infinispan
Issue Type: Feature Request
Reporter: Erik Salter
Assignee: Manik Surtani
The grouping API should be enhanced to add grouping capabilities to a a cache's put() or replace() methods.
This encompasses the following scenario:
Cache A uses a custom key class where the group is dynamically generated. Cache B's key is an unmodifiable String that needs to be grouped with the dynamic value of a key from Cache A. (Cache B's key can't be encapsulated in a custom key class since it needs to be queried from external entities that will not know the group context).
And in pseudo-code:
{code}
Group class InternalResourceKey {
String group;
...
@Group
String getGroup() {
return group;
}
}
InternalResourceKey key = new InternalResourceKey();
{code}
...
{code}
resourceCache.lock( key );
// Get the previous result.
ResourceResult result = resourceCache.get( key );
ResourceResult newResult = doWork( key, result );
resourceCache.put( key, newResult );
// I also want to group an external identifier that an external client knows about with the result so they will be on the same node
employeeCache.put( "111-111-1111", newResult, key.getGroup() );
{code}
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Created: (ISPN-1244) Cache loses data when another CacheManager joins a cluster
by Alex Heneveld (JIRA)
Cache loses data when another CacheManager joins a cluster
----------------------------------------------------------
Key: ISPN-1244
URL: https://issues.jboss.org/browse/ISPN-1244
Project: Infinispan
Issue Type: Bug
Components: Distributed Cache
Affects Versions: 5.0.0.CR7
Environment: single machine (Mac is my case)
Reporter: Alex Heneveld
Assignee: Manik Surtani
I have a test (below) which creates a CacheManager and Cache, sets a value, waits a bit, creates another CacheManager and Cache, then tries to get the value from the first cache. Only it gets null instead -- from both caches!
Am new to Infinispan but discussed with Sanne who recommended to file as a bug.
Originally discussed in community forum [here|http://community.jboss.org/message/615497].
{code}
public void bug() throws InterruptedException {
EmbeddedCacheManager cm1 = newCM();
Cache c1 = cm1.getCache("x");
c1.put("key", "value");
Thread.sleep(3000);
EmbeddedCacheManager cm2 = newCM();
System.out.println(c1.get("key")); //always says "value"
Cache c2 = cm2.getCache("x");
System.out.println(c1.get("key")); //says null sometimes
assert c1.get("key") != null : "value at cache 1 was lost";
cm1.stop();
cm2.stop();
}
public EmbeddedCacheManager newCM() {
GlobalConfiguration gc = GlobalConfiguration.getClusteredDefault();
Configuration cfg = new Configuration().fluent()
.mode(Configuration.CacheMode.DIST_SYNC)
.hash().numOwners(1)
.clustering().l1().disable()
.build();
return new DefaultCacheManager(gc, cfg);
}
{code}
(BTW changing to REPL_SYNC, or numOwners(2), it works fine.)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months