Return-Path: Delivered-To: apmail-jackrabbit-dev-archive@www.apache.org Received: (qmail 4877 invoked from network); 16 Feb 2008 13:19:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Feb 2008 13:19:34 -0000 Received: (qmail 50624 invoked by uid 500); 16 Feb 2008 13:19:28 -0000 Delivered-To: apmail-jackrabbit-dev-archive@jackrabbit.apache.org Received: (qmail 50594 invoked by uid 500); 16 Feb 2008 13:19:28 -0000 Mailing-List: contact dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list dev@jackrabbit.apache.org Received: (qmail 50585 invoked by uid 99); 16 Feb 2008 13:19:28 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Feb 2008 05:19:28 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 16 Feb 2008 13:18:50 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id D0563714074 for ; Sat, 16 Feb 2008 05:19:10 -0800 (PST) Message-ID: <10023357.1203167950850.JavaMail.jira@brutus> Date: Sat, 16 Feb 2008 05:19:10 -0800 (PST) From: "Jukka Zitting (JIRA)" To: dev@jackrabbit.apache.org Subject: [jira] Updated: (JCR-1333) jackrabbit-jcr-rmi: Supplied javax.transaction.xa.Xid is assumed serializable, but is not on some environments. In-Reply-To: <12806751.1200916054679.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JCR-1333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jukka Zitting updated JCR-1333: ------------------------------- Component/s: jackrabbit-jcr-rmi Fix Version/s: 1.5 Assignee: Jukka Zitting > jackrabbit-jcr-rmi: Supplied javax.transaction.xa.Xid is assumed serializable, but is not on some environments. > --------------------------------------------------------------------------------------------------------------- > > Key: JCR-1333 > URL: https://issues.apache.org/jira/browse/JCR-1333 > Project: Jackrabbit > Issue Type: Bug > Components: jackrabbit-jcr-rmi > Affects Versions: 1.4 > Environment: Linux (suse9) with websphere 6.1 invoking jackrabbit client RMI > Reporter: Paul Gribben > Assignee: Jukka Zitting > Fix For: 1.5 > > > Websphere provides a non-serializable javax.transaction.xa.Xid implementation, causing ClientXAResource to fail with NotSerializableException when passing Xid over RMI. > I have worked around this by converting the supplied Xid to a local serializable Xid implementation that takes the supplied Xid parameters, and implements hashCode() and equals() correctly: > private static class SerializableXID implements javax.transaction.xa.Xid, Serializable { > /** > * Serial version ID > */ > private static final long serialVersionUID = -1390620315181450507L; > > private final byte[] branchQualifier; > private final byte[] globalTransactionId; > private final int formatId; > private final int hashCode; > > public SerializableXID(Xid xid) { > branchQualifier = xid.getBranchQualifier(); > globalTransactionId = xid.getGlobalTransactionId(); > formatId = xid.getFormatId(); > hashCode = xid.hashCode(); > } > public byte[] getBranchQualifier() { > return branchQualifier; > } > public int getFormatId() { > return formatId; > } > public byte[] getGlobalTransactionId() { > return globalTransactionId; > } > public final int hashCode() { > return hashCode; > } > > public final boolean equals(Object obj) { > if(obj == this) { > return true; > } > > if(!(obj instanceof Xid)) { > return false; > } > > Xid xidimpl = (Xid)obj; > if(formatId != xidimpl.getFormatId()) { > return false; > } > else { > return Arrays.equals(branchQualifier, xidimpl.getBranchQualifier()) > && Arrays.equals(globalTransactionId, xidimpl.getGlobalTransactionId()); > } > } > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.