Roman jakubco created CAMEL-7730:
------------------------------------
Summary: URI option "command" is not working in camel-infinispan
component
Key: CAMEL-7730
URL: https://issues.apache.org/jira/browse/CAMEL-7730
Project: Camel
Issue Type: Bug
Affects Versions: 2.13.2
Reporter: Roman jakubco
Documentation for the component states that "command" URI option can be used in
producer for setting operations for infinispan. But is seems only the default
value is working because commands REMOVE, CLEAR and GET fail with
NullPointerException:
{code}
Message History
---------------------------------------------------------------------------------------------------------------------------------------
RouteId ProcessorId Processor
Elapsed (ms)
[route7 ] [route7 ] [direct://commandGet
] [ 3]
[route7 ] [setHeader11 ] [setHeader[CamelInfinispanKey]
] [ 0]
[route7 ] [to7 ]
[infinispan://localhost?cacheContainer=#container1&command=GET
] [ 1]
Exchange
---------------------------------------------------------------------------------------------------------------------------------------
Exchange[
Id ID-roman-ThinkPad-T430s-46536-1408612528972-0-4
ExchangePattern InOnly
Headers
{breadcrumbId=ID-roman-ThinkPad-T430s-46536-1408612528972-0-3,
CamelInfinispanKey=commandKey1, CamelRedelivered=false,
CamelRedeliveryCounter=0}
BodyType null
Body [Body is null]
]
Stacktrace
---------------------------------------------------------------------------------------------------------------------------------------
java.lang.NullPointerException: Null values are not supported!
at org.infinispan.CacheImpl.assertKeyValueNotNull(CacheImpl.java:187)
at org.infinispan.CacheImpl.putInternal(CacheImpl.java:876)
at org.infinispan.CacheImpl.put(CacheImpl.java:870)
at org.infinispan.CacheImpl.put(CacheImpl.java:1351)
at org.infinispan.CacheImpl.put(CacheImpl.java:215)
at
org.apache.camel.component.infinispan.InfinispanOperation$Operation$1.execute(InfinispanOperation.java:50)
at
org.apache.camel.component.infinispan.InfinispanOperation.process(InfinispanOperation.java:34)
at
org.apache.camel.component.infinispan.InfinispanProducer.process(InfinispanProducer.java:42)
at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:110)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:378)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:346)
at
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:242)
at
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:346)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:110)
at
org.jboss.fuse.qa.infinispan.component.test.InfinispanComponentTest.testUriCommandOption(InfinispanComponentTest.java:158)
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
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at
org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
{code}
Looking at the code it seems there is a missing test if the operation is not
specified in the URI and default operation PUT is always used( that is why
there is NullPointerException). I will correct it later in the evening or
tomorrow a make a pullrequest to the git.
--
This message was sent by Atlassian JIRA
(v6.2#6252)