Return-Path: Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: (qmail 59560 invoked from network); 13 Dec 2009 22:38:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Dec 2009 22:38:51 -0000 Received: (qmail 98771 invoked by uid 500); 13 Dec 2009 22:38:50 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 98683 invoked by uid 500); 13 Dec 2009 22:38:50 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Received: (qmail 98673 invoked by uid 99); 13 Dec 2009 22:38:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Dec 2009 22:38:50 +0000 X-ASF-Spam-Status: No, hits=-4.0 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [216.82.253.115] (HELO mail161.messagelabs.com) (216.82.253.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 13 Dec 2009 22:38:39 +0000 X-VirusChecked: Checked X-Env-Sender: dk068x@att.com X-Msg-Ref: server-14.tower-161.messagelabs.com!1260743896!19631352!1 X-StarScan-Version: 6.2.4; banners=-,-,- X-Originating-IP: [144.160.112.25] Received: (qmail 4197 invoked from network); 13 Dec 2009 22:38:17 -0000 Received: from sbcsmtp3.sbc.com (HELO tlph064.enaf.dadc.sbc.com) (144.160.112.25) by server-14.tower-161.messagelabs.com with DHE-RSA-AES256-SHA encrypted SMTP; 13 Dec 2009 22:38:17 -0000 Received: from enaf.dadc.sbc.com (localhost.localdomain [127.0.0.1]) by tlph064.enaf.dadc.sbc.com (8.14.3/8.14.3) with ESMTP id nBDMcGNK006778 for ; Sun, 13 Dec 2009 16:38:16 -0600 Received: from td03xsmtp008.US.Cingular.Net (intexchapp01.us.cingular.net [135.179.64.42] (may be forged)) by tlph064.enaf.dadc.sbc.com (8.14.3/8.14.3) with ESMTP id nBDMcCoj006525 for ; Sun, 13 Dec 2009 16:38:12 -0600 Received: from BD01XSMTP003.US.Cingular.Net ([135.163.18.44]) by td03xsmtp008.US.Cingular.Net with Microsoft SMTPSVC(6.0.3790.3959); Sun, 13 Dec 2009 16:38:12 -0600 Received: from BD01MSXMB018.US.Cingular.Net ([135.214.27.52]) by BD01XSMTP003.US.Cingular.Net with Microsoft SMTPSVC(6.0.3790.3959); Sun, 13 Dec 2009 14:38:11 -0800 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Issues using same domain classes in JPA and CXF/JAXB Date: Sun, 13 Dec 2009 14:38:23 -0800 Message-ID: In-Reply-To: <388A8D93-DFF4-4058-81F8-32121EBE8B18@gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Issues using same domain classes in JPA and CXF/JAXB Thread-Index: Acp8P0Dvg63X5jy1QKC9vVsp5dXqVwABXRmw References: <2C16D406-ED74-4DB1-856B-150D5E14E124@gmail.com> <388A8D93-DFF4-4058-81F8-32121EBE8B18@gmail.com> From: "KARR, DAVID (ATTCINW)" To: X-OriginalArrivalTime: 13 Dec 2009 22:38:11.0912 (UTC) FILETIME=[F38BB480:01CA7C44] X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: Rick Curtis [mailto:curtisr7@gmail.com] > Sent: Sunday, December 13, 2009 1:57 PM > To: users@openjpa.apache.org > Subject: Re: Issues using same domain classes in JPA and CXF/JAXB >=20 > I'm going to suggest you spend a few more cycles on getting buildtime > enhancement working as runtime enhanced classes has a number of known > issues... Enough issues that we have disabled this support as the > default behavior in trunk. HTH Ok, I'll work on a detailed description of my build-time enhancement problems. In short, I find that it's unable to find the fields of my class. It throws "NoSuchFieldException" errors for the fields I specify in my orm.xml, even though I have both the instance variable and public getter/setter for the field. >=20 > Thanks, > Rick >=20 > On Dec 13, 2009, at 3:53 PM, "KARR, DAVID (ATTCINW)" > wrote: >=20 > >> -----Original Message----- > >> From: Rick Curtis [mailto:curtisr7@gmail.com] > >> Sent: Sunday, December 13, 2009 10:50 AM > >> To: users@openjpa.apache.org > >> Subject: Re: Issues using same domain classes in JPA and CXF/JAXB > >> > >> Sorry I haven't followed this chain of emails, but what type of > >> enhancement are you using? > > > > Well, presently I believe I'm just using "run-time" enhancement. I > > had > > troubles with both "load-time" (javaagent) and "build-time" > > enhancement > > (enhancer task). I'll eventually try to submit a ticket, > particularly > > for the problems I had with build-time enhancement. > > > >> On Dec 13, 2009, at 12:04 PM, "KARR, DAVID (ATTCINW)" > >> > >> wrote: > >> > >>>> -----Original Message----- > >>>> From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] > >>>> Sent: Saturday, December 12, 2009 6:18 PM > >>>> To: users@openjpa.apache.org > >>>> Subject: Re: Issues using same domain classes in JPA and CXF/JAXB > >>>> > >>>> Hi KARR, DAVID, > >>>> > >>>> I'd say that not copying annotations over to enhanced classes is a > >>>> deficiency, if not a bug in OpenJPA. > >>>> > >>>> OpenJPA is not the only consumer of runtime annotations. > >>>> > >>>> Can you please file a JIRA for this issue? > >>> > >>> Done: . > >>> > >>> In the meantime, I have a workaround using a generic method that > >>> basically creates an instance of my class, then uses > >>> "BeanUtils.copyProperties()" to copy over everything. That object > >>> then > >>> serializes fine, because its class has the annotations. > >>> > >>>> On Dec 12, 2009, at 2:19 PM, KARR, DAVID (ATTCINW) wrote: > >>>> > >>>>> I'm building an app that retrieves data with OpenJPA and tries to > >>>>> serialize it in xml or json with CXF/JAXB. I'm using annotations > >> on > >>>>> the > >>>>> domain class to specify both the logical JPA (not physical) and > >> JAXB > >>>>> behavior (with the physical JPA in XML config). In theory I > would > >>>>> think > >>>>> this should work, but in my first test I found that CXF didn't > >>>>> serialize > >>>>> the object that I retrieved from JPA. > >>>>> > >>>>> After some thinking, I thought to write some debug code that > > prints > >>>>> out > >>>>> the runtime annotations on the class, both for the class of the > >>>>> returned > >>>>> instance, and the class that it's declared as. What I found > >>>>> (because I > >>>>> realized I should have expected this) is that the runtime class > >>>> didn't > >>>>> have the required annotations that the declared class did. When > >> JPA > >>>>> enhanced the classes, it didn't copy the annotations. > >>>>> > >>>>> My app currently doesn't use build-time enhancement or the > >>>>> javaagent. I > >>>>> can't remember exactly what OpenJPA does in that situation. I > >> think > >>>>> it's still enhancing the class, but on demand. > >>>>> > >>>>> Is this issue with non-copied annotations really an issue, or > >> should > >>>> I > >>>>> look elsewhere for why CXF isn't serializing my data (I'm asking > a > >>>>> similar question on the CXF list)? > >>>> > >>>> Craig L Russell > >>>> Architect, Sun Java Enterprise System http://db.apache.org/jdo > >>>> 408 276-5638 mailto:Craig.Russell@sun.com > >>>> P.S. A good JDO? O, Gasp! > >>>