2012-01-17 2 views
2

JRockit VM에서 hessian을 실행할 때이 예외가 발생합니까?JRockit 호환 Hessian

Caused by: java.lang.ArrayIndexOutOfBoundsException: -418 
     at com.caucho.hessian.util.IdentityIntMap.put(IdentityIntMap.java:141) 
     at com.caucho.hessian.io.Hessian2Output.addRef(Hessian2Output.java:1285) 
     at com.caucho.hessian.io.UnsafeSerializer.writeObject(UnsafeSerializer.java:157) 
     at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:421) 
     at com.caucho.hessian.io.CollectionSerializer.writeObject(CollectionSerializer.java:102) 
     at com.caucho.hessian.io.Hessian2Output.writeObject(Hessian2Output.java:421) 
     at com.caucho.hessian.io.UnsafeSerializer$ObjectFieldSerializer.serialize(UnsafeSerializer.java:293) 
     ... 34 more 

나는 헤센 핫스팟 VM과 함께 잘 작동하는지 알아에만이 문제를 해결 일주일 이상 소요되지만 일관하는 JRockit VM을 사용하여 특정 개체를 직렬화 실패합니다. 사실 간단한 수정이 필요했지만 IdentityIntMap.java 코드를 수정하고 hessian jar 파일을 업데이트해야했습니다.

+0

수정 사항이있는 경우 여기 (답변)에 게시하여 사람들이 찾을 수 있도록 할 수 있습니까? – nfechner

답변

1

다음은 내가 고친 수정 프로그램입니다. 나는 Hessian 코드의 관리자에게 어떻게 통지 할지를 알 수 없으므로 여기에 게시하고있다.

com.caucho.hessian.util.IdentityIntMap.java 라인 (112)에서 시작 : 파일 수정

public final int get(Object key) 
{ 
    int prime = _prime; 
    // int hash = System.identityHashCode(key) % prime; 
    int hash = System.identityHashCode(key); 
    // JRockit VMs can return a negative number which will cause this method to throw an exception 
    if (hash < 0) 
    hash = -hash; 
    hash = hash % prime; 
    ... 

는 또한 라인에서 시작하여 다음 방법에 코드를 변경 135 :

public final int put(Object key, int value, boolean isReplace) 
{ 
    int prime = _prime; 
    // int hash = System.identityHashCode(key) % prime; 
    int hash = System.identityHashCode(key); 
    // JRockit VMs can return a negative number which will cause this method to throw an exception 
    if (hash < 0) 
    hash = -hash; 
    hash = hash % prime; 
    ... 
관련 문제