2017-10-26 5 views
0

클라이언트 측에서 모든 작업이 정상적으로 처리되었습니다. 개체를 저장하고 클라이언트 측에서 개체를 다시 검색 할 수 있습니다. 내가 데이터를 볼 gfsh 또는 데이터 브라우저를 사용하려고하면Geode : 직렬화 예외 및 서버에 클래스 인스턴스를 만들 수 없습니다.

그러나, 나는 gfsh

Message : Could not create an instance of a class com.room.backend.soa.spring.cache.geode.test.domain.Book 
Result : false 

에 데이터 브라우저에서이 예외를 가지고 내 코드는 다음과 같다

javalangException- Query could not be executed due to - orgapachegeodepdxPdxSerializationException- Could not create an instance of a class comroombackendsoaspringcachegeodetestdomainBook 

ClientCacheFactoryBean gemfireCache = new ClientCacheFactoryBean(); 
    gemfireCache.setClose(true); 
    gemfireCache.setProperties(gemfireProperties); 
    gemfireCache.setPdxSerializer(pdxSerializer); 

pdxSerializer는

입니다
ReflectionBasedAutoSerializer serializer = 
      new ReflectionBasedAutoSerializer(
        "com.room.backend.soa.spring.cache.geode.test.domain.*", 
        "com.room.backend.soa.spring.cache.geode.test.domain.Book", 
        "com.room.backend.soa.spring.cache.geode.test.domain.Book#identity=id.*", 
        "com.room.backend.soa.spring.cache.geode.test.domain.#identity=id.*" 

        ); 
+0

필자는 [여기]와 같이 캐시에 pdx 형식을 등록해야한다고 생각합니다 (https://stackoverflow.com/questions/45793610/registering-pdx-type-in-type-registry-with-geode- C-sharp-native-client) – rupweb

답변

1

gfsh>configure pdx --read-serialized=true 명령을 실행해야합니다. 이 작업은 로케이터를 시작한 후 서버를 시작하기 전에 수행해야합니다. 자세한 내용은 this docs page을 참조하십시오.

+0

정확하게 나는 또한 알아 냈다. 감사. 호기심에서, 왜 configure가 디폴트로 켜지지 않는지 알 것입니다. – lwpro2

+0

서버 (CacheListeners/CacheWriters 등)에 콜백을 설치 한 경우 도메인 객체보다는 콜백에서 PDXInstance를 사용해야합니다. 사용자가 작성해야하는 명시 적 결정이므로 읽기 직렬화는 기본적으로 설정되어 있지 않습니다. – Swapnil