问题描述
我在骆驼以下路线:
<route>
<from uri="servlet:///user?matchOnUriPrefix=true"/>
<setHeader headerName="cachename">
<simple>${header.CamelHttpPath.split("/")[1]}</simple>
</setHeader>
<setHeader headerName="key1">
<simple>${header.CamelHttpPath.split("/")[2]}</simple>
</setHeader>
<to uri="direct:put"/>
</route>
<route>
<from uri="direct:put" />
<!-- If using version 2.8 and above set headerName to "CamelHazelcastOperationType" -->
<setHeader headerName="CamelHazelcastOperationType">
<constant>put</constant>
</setHeader>
<setHeader headerName="CamelHazelcastObjectId">
<simple>${header.key1}</simple>
</setHeader>
<process ref="requestTimeProc"/>
<to uri="hazelcast:map:default" />
</route>
,我试图把一个字符串值到缓存中。
And i am trying to put a string as value into the cache.
我HazelCast配置是:
My HazelCast Configuration is :
<map name="default">
<in-memory-format>OBJECT</in-memory-format>
<backup-count>1</backup-count>
<async-backup-count>0</async-backup-count>
<time-to-live-seconds>0</time-to-live-seconds>
<max-idle-seconds>0</max-idle-seconds>
<eviction-policy>NONE</eviction-policy>
<max-size policy="PER_NODE">0</max-size>
<eviction-percentage>25</eviction-percentage>
<merge-policy>com.hazelcast.map.merge.PassThroughMergePolicy</merge-policy>
</map>
<serialization>
<portable-version>0</portable-version>
</serialization>
和我gettign以下异常:
And i Am gettign the following exception:
2013-12-10 22:47:08,288 [tp-1763826860-0] ERROR DefaultErrorHandler - Failed delivery for (MessageId: ID-DJD7W4R1-54721-1386740808850-0-1 on ExchangeId: ID-DJD7W4R1-54721-1386740808850-0-2). Exhausted after delivery attempt: 1 caught: com.hazelcast.nio.serialization.HazelcastSerializationException: There is no suitable serializer for class org.apache.camel.converter.stream.InputStreamCache
com.hazelcast.nio.serialization.HazelcastSerializationException: There is no suitable serializer for class org.apache.camel.converter.stream.InputStreamCache
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:172)[hazelcast-3.1.2.jar:3.1.2]
at com.hazelcast.nio.serialization.SerializationServiceImpl.toData(SerializationServiceImpl.java:157)[hazelcast-3.1.2.jar:3.1.2]
at com.hazelcast.map.MapService.toData(MapService.java:666)[hazelcast-3.1.2.jar:3.1.2]
at com.hazelcast.map.proxy.MapProxyImpl.put(MapProxyImpl.java:72)[hazelcast-3.1.2.jar:3.1.2]
at com.hazelcast.map.proxy.MapProxyImpl.put(MapProxyImpl.java:60)[hazelcast-3.1.2.jar:3.1.2]
at org.apache.camel.component.hazelcast.map.HazelcastMapProducer.put(HazelcastMapProducer.java:136)[camel-hazelcast-2.11.2.jar:2.11.2]
at org.apache.camel.component.hazelcast.map.HazelcastMapProducer.process(HazelcastMapProducer.java:71)[camel-hazelcast-2.11.2.jar:2.11.2]
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)[camel-core-2.11.2.jar:2.11.2]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)[camel-core-2.11.2.jar:2.11.2]
at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:122)[camel-core-2.11.2.jar:2.11.2]
请让我知道如果我错过anythign在矿井配置。我使用的诠释,他提供Hazelcast罐子默认Hazelcast配置。任何帮助将是非常美联社preciated
Please let me know if i am missing anythign inthe configuration . I am using the default Hazelcast configuration provided int he Hazelcast jar. Any help will be highly appreciated
推荐答案
一个几点意见:
我不会改变默认的地图。这意味着任何地图中的系统,该系统不具有明确的结构,现在将使用这种配置。因此,找出哪些地图的使用和明确该地图配置。
I would not change the 'default' map. This means that any map in the system, which doesn't have an explicit configuration, will now use this configuration. So figure out which map is used and configure explicitly for that map.
<map name="explicitName">
<in-memory-format>OBJECT</in-memory-format>
....
</map>
有关异常:
com.hazelcast.nio.serialization.HazelcastSerializationException:对于类org.apache.camel.converter.stream.InputStreamCache没有合适的串行
com.hazelcast.nio.serialization.HazelcastSerializationException: There is no suitable serializer for class org.apache.camel.converter.stream.InputStreamCache
这意味着,InputStreamCache放在地图,但Hazelcast不知道如何将其CONVER到字节流。您可以在串行插上这个类,请参见下面的博文怎么做:
It means that the InputStreamCache is put in the map, but Hazelcast doesn't know how to conver it to a stream of bytes. You can plug in a serializer for this class, see the following blogpost how to do so:
对我来说,最大的问题是:你为什么trynig把一个InputStreamCache在地图吗?我的直觉说,这个类是不是要放在一个distribured Hazelcast地图所有的东西。
The big question for me is: why are you trynig to put an InputStreamCache in a map? My gut feeling says that this class is not something you want to put in a distribured Hazelcast map at all.
这篇关于骆驼HazelCast组件投掷HazelcastSerializationException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!