Return-Path: X-Original-To: apmail-openjpa-users-archive@minotaur.apache.org Delivered-To: apmail-openjpa-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 27FF511AC1 for ; Thu, 11 Sep 2014 15:14:05 +0000 (UTC) Received: (qmail 87354 invoked by uid 500); 11 Sep 2014 15:14:04 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 87313 invoked by uid 500); 11 Sep 2014 15:14:04 -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 87298 invoked by uid 99); 11 Sep 2014 15:14:04 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2014 15:14:04 +0000 X-ASF-Spam-Status: No, hits=3.1 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of curtisr7@gmail.com designates 209.85.214.178 as permitted sender) Received: from [209.85.214.178] (HELO mail-ob0-f178.google.com) (209.85.214.178) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2014 15:13:39 +0000 Received: by mail-ob0-f178.google.com with SMTP id va2so303457obc.9 for ; Thu, 11 Sep 2014 08:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=TrWLtzl/bq08Oz3PzwJURtQd13YisdNB3TVwPsc0u00=; b=oXClVCxaVJqxGbHLpc5h5xQCZgbVmXQux/3+wD2p6zOI/nhAxJzglKZTIs8gCIdq7M cfQPv26ass4DPLADbySwTkZtCgJYR6B3hgsiFxAngPEvvf2HaQWq8uNZ85DYy2KjQ9ou YZS2kraqPC3IUdc8WkmsorHPIwE04XdoOTMTOb96hNlQ+4Z2/Axu++Ttf5B2nHiw9XBV Wz9jC+A8k8GCSQ2EUcJrE6dO+tADB28g+LAHnRmXQYIn8kCxFwa5mAxjYGaBEgINLIyw dDRpBRkVCm+85qlGkO6lJpaIMKNAu89y6bN2s/0sp21vTsuUe7B4tF6C7FGPWZ9KeWbS H9NA== MIME-Version: 1.0 X-Received: by 10.60.141.72 with SMTP id rm8mr1764515oeb.81.1410448417597; Thu, 11 Sep 2014 08:13:37 -0700 (PDT) Received: by 10.60.125.69 with HTTP; Thu, 11 Sep 2014 08:13:37 -0700 (PDT) In-Reply-To: <1410421133786-7587090.post@n2.nabble.com> References: <1410359196271-7587085.post@n2.nabble.com> <1410421133786-7587090.post@n2.nabble.com> Date: Thu, 11 Sep 2014 10:13:37 -0500 Message-ID: Subject: Re: EntityManager.find ClassCastException for wrong but existing id From: Rick Curtis To: users Content-Type: multipart/alternative; boundary=047d7b33d006e7b1280502cb9c0d X-Virus-Checked: Checked by ClamAV on apache.org --047d7b33d006e7b1280502cb9c0d Content-Type: text/plain; charset=ISO-8859-1 I looked at your test, and it looks like an OpenJPA bug. I'd suggest opening a JIRA[1] and attach your test case. Thanks, Rick [1] https://issues.apache.org/jira/browse/OPENJPA On Thu, Sep 11, 2014 at 2:38 AM, olyalikov wrote: > I did a mistake - I'm getting not ClassNotFoundException but > ClassCastException: > java.lang.ClassCastException: org.apache.openjpa.find.entities.Document > cannot be cast to org.apache.openjpa.find.entities.Person > at org.apache.openjpa.find.FindTest.testFind(FindTest.java:54) > > It's a result of executing > final Person p = em.find(Person.class, doc.getId()); > > All this can be found/reproduced in the project attached to the previous > post. > > Oleg > > > Rick Curtis wrote > > Can we see the exception? > > > > Thanks, > > Rick > > > > On Wed, Sep 10, 2014 at 9:26 AM, olyalikov < > > > oleg.lyalikov@ > > > > wrote: > > > >> Hello, > >> > >> I have base entity and 2 inheritors e.g. Person and Document. > >> If I try to find Person entity and provide id of the Document entity I > >> get > >> ClassNotFoundException but it should return either null or > >> EntityNotFoundException. > >> If I provide just some wrong non existing id I get null. > >> Here is link to the maven project with test: openjpa-find-test.zip > >> < > http://openjpa.208410.n2.nabble.com/file/n7587085/openjpa-find-test.zip> > ; > >> Should I post a bug in issue tracker? > >> > >> Thanks, > >> Oleg > >> > >> > >> > >> > >> -- > >> View this message in context: > >> > http://openjpa.208410.n2.nabble.com/EntityManager-find-ClassCastException-for-wrong-but-existing-id-tp7587085.html > >> Sent from the OpenJPA Users mailing list archive at Nabble.com. > >> > > > > > > > > -- > > *Rick Curtis* > > > > > > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/EntityManager-find-ClassCastException-for-wrong-but-existing-id-tp7587085p7587090.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > -- *Rick Curtis* --047d7b33d006e7b1280502cb9c0d--