Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 49682 invoked from network); 16 Dec 2010 16:11:29 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 16 Dec 2010 16:11:29 -0000 Received: (qmail 5434 invoked by uid 500); 16 Dec 2010 16:11:29 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 4569 invoked by uid 500); 16 Dec 2010 16:11:26 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 4560 invoked by uid 99); 16 Dec 2010 16:11:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 16:11:25 +0000 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.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Dec 2010 16:11:22 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oBGGB07g007986 for ; Thu, 16 Dec 2010 16:11:01 GMT Message-ID: <21018744.159921292515860750.JavaMail.jira@thor> Date: Thu, 16 Dec 2010 11:11:00 -0500 (EST) From: "Rick Curtis (JIRA)" To: dev@openjpa.apache.org Subject: [jira] Commented: (OPENJPA-1900) ClassCastException when serializing an entity if DetachedStateField=true In-Reply-To: <30941673.21281291108871366.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/OPENJPA-1900?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972128#action_12972128 ] Rick Curtis commented on OPENJPA-1900: -------------------------------------- Mark - It looks like I should have read through all of your comments... I added @OneToOne to Annuity.getPreviousAnnuity() and things are looking better now. Thanks, Rick > ClassCastException when serializing an entity if DetachedStateField=true > ------------------------------------------------------------------------ > > Key: OPENJPA-1900 > URL: https://issues.apache.org/jira/browse/OPENJPA-1900 > Project: OpenJPA > Issue Type: Bug > Components: kernel > Affects Versions: 2.0.1, 2.1.0 > Reporter: Mark Struberg > Fix For: 2.1.0 > > Attachments: OPENJPA-1900-fix.patch, OPENJPA-1900-test-1.patch > > > When using > > serializing an entity leads to the following Exception: > java.lang.ClassCastException: org.apache.openjpa.kernel.StateManagerImpl cannot be cast to org.apache.openjpa.kernel.DetachedStateManager > at org.apache.openjpa.util.Proxies.writeReplace(Proxies.java:147) > at org.apache.openjpa.util.java$util$Date$proxy.writeReplace(Unknown Source) > at sun.reflect.GeneratedMethodAccessor176.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at java.io.ObjectStreamClass.invokeWriteReplace(ObjectStreamClass.java:1032) > at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1107) > at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326) > at org.apache.openjpa.kernel.SingleFieldManager.serialize(SingleFieldManager.java:545) > at org.apache.openjpa.kernel.StateManagerImpl.writeDetached(StateManagerImpl.java:1478) > at at.ac.tuwien.tiss.curriculum.be.entities.CurriculumVersion.writeExternal(CurriculumVersion.java) > at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1421) > This seems related to OPENJPA-1597 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.