1
嘗試設置在獨立進程上啓用tcp-ip的HazelCast羣集。 我的類看起來像這樣Hazelcast沒有爲獨立進程註冊名稱空間的DataSerializerFactory:0
public class Person implements Serializable{
private static final long serialVersionUID = 1L;
int personId;
String name;
Person(){};
//getters and setters
}
Hazelcast加載爲
final Config config = createNewConfig(mapName);
HazelcastInstance node = Hazelcast.newHazelcastInstance(config);`
Config createNewConfig(mapName){
final PersonStore personStore = new PersonStore();
XmlConfigBuilder configBuilder = new XmlConfigBuilder();
Config config = configBuilder.build();
config.setClassLoader(LoadAll.class.getClassLoader());
MapConfig mapConfig = config.getMapConfig(mapName);
MapStoreConfig mapStoreConfig = new MapStoreConfig();
mapStoreConfig.setImplementation(personStore);
return config;
}
和我myhazelcast配置有這個
<tcp-ip enabled="true">
<member>machine-1</member>
<member>machine-2</member>
</tcp-ip>
我需要在我的XML來填充這個標籤?
我得到這個錯誤時,第二個實例長大
com.hazelcast.nio.serialization.HazelcastSerializationException: No DataSerializerFactory registered for namespace: 0
2275 at com.hazelcast.nio.serialization.DataSerializer.read(DataSerializer.java:98)
2276 at com.hazelcast.nio.serialization.DataSerializer.read(DataSerializer.java:39)
2277 at com.hazelcast.nio.serialization.StreamSerializerAdapter.read(StreamSerializerAdapter.java:41)
2278 at com.hazelcast.nio.serialization.SerializationServiceImpl.toObject(SerializationServiceImpl.java:276)
任何幫助高度appericiated。
我經歷了這個問題[鏈接](http://stackoverflow.com/questions/28612473/no-dataserializefactory-registered-for-namespace),但我不想使用我的自定義序列化,但想使用默認java提供了一個。 – shiv
@noctarius你會不會請進,我已經看到很多關於類似問題的其他評論。 – shiv