2012-01-17 11 views
2

JRockit VMでhessianを実行しているときは誰もこの例外を実行していますか?JRockit互換のヘッシアン

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 

私はヘッセはHotSpot VMのと正常に動作しますが、一貫のJRockit VMを使用して特定のオブジェクトを直列化失敗したことを見つけるために、この問題のトラブルシューティング週間以上を費やし。私は実際には単純な修正を思いついたが、IdentityIntMap.javaコードを変更してhessian jarファイルを更新する必要があった。

+0

修正がある場合は、ここに投稿して(回答として)、人々が見つけることができますか? – nfechner

答えて

1

ここに私が思いついた修正があります。私はヘッセ行列の管理者に通知する方法を理解できなかったので、ここに掲載します。また、ライン135から始まる次の方法でコードを変更

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; 
    ... 

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; 
    ... 
ライン112から始まるcom.caucho.hessian.util.IdentityIntMap.java

:ファイルを変更します