]
Sebastian Łaskawiec updated ISPN-5193:
--------------------------------------
Fix Version/s: 8.2.5.Final
infinispan-embedded and infinispan-cli-interpreter don't work
together
----------------------------------------------------------------------
Key: ISPN-5193
URL:
https://issues.jboss.org/browse/ISPN-5193
Project: Infinispan
Issue Type: Bug
Components: CLI
Affects Versions: 7.1.0.CR2, 8.0.0.Beta2
Reporter: Jakub Markos
Assignee: Sebastian Łaskawiec
Priority: Blocker
Fix For: 8.2.5.Final
Creating a java application (no container) with both infinispan-embedded and
infinispan-cli-interpreter dependencies results in this error when starting a cache
manager:
{code}Exception in thread "main" java.util.ServiceConfigurationError:
org.infinispan.lifecycle.ModuleLifecycle: Provider
org.infinispan.cli.interpreter.LifecycleCallbacks could not be instantiated:
java.lang.ExceptionInInitializerError
at java.util.ServiceLoader.fail(ServiceLoader.java:224)
at java.util.ServiceLoader.access$100(ServiceLoader.java:181)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:377)
at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
at org.infinispan.commons.util.ServiceFinder.addServices(ServiceFinder.java:60)
at org.infinispan.commons.util.ServiceFinder.load(ServiceFinder.java:42)
at
org.infinispan.util.ModuleProperties.resolveModuleLifecycles(ModuleProperties.java:41)
at
org.infinispan.factories.GlobalComponentRegistry.<init>(GlobalComponentRegistry.java:94)
at
org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:292)
at
org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:271)
at
org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:244)
at
org.infinispan.manager.DefaultCacheManager.<init>(DefaultCacheManager.java:231)
at Main64.main(Main64.java:17)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:373)
... 15 more
Caused by: java.lang.IllegalArgumentException: Logger implementation class
org.infinispan.cli.interpreter.logging.Log_$logger has no matching constructor
at infinispan.org.jboss.logging.Logger.getMessageLogger(Logger.java:2255)
at infinispan.org.jboss.logging.Logger.getMessageLogger(Logger.java:2211)
at org.infinispan.util.logging.LogFactory.getLog(LogFactory.java:21)
at
org.infinispan.cli.interpreter.LifecycleCallbacks.<clinit>(LifecycleCallbacks.java:20)
... 21 more
{code}
Tried with 7.1.0.CR2, config:
{code}
<?xml version="1.0" encoding="UTF-8"?>
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:infinispan:config:7.1">
<cache-container default-cache="localcache">
<local-cache name="localcache"/>
</cache-container>
</infinispan>
{code}
application:
{code}
public static void main(String[] args) throws Exception {
EmbeddedCacheManager manager = new DefaultCacheManager("config.xml");
Cache defaultCache = manager.getCache("localcache");
for (int i = 0; i < 10; i++) {
defaultCache.put("key"+i, "value"+i);
}
Thread.sleep(5000000);
}
{code}
Using infinispan-core dependency instead of infinispan-embedded works.