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 17CFB10FE3 for ; Thu, 26 Sep 2013 12:58:12 +0000 (UTC) Received: (qmail 79997 invoked by uid 500); 26 Sep 2013 12:58:11 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 79663 invoked by uid 500); 26 Sep 2013 12:58:08 -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 79654 invoked by uid 99); 26 Sep 2013 12:58:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 12:58:06 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kwsutter@gmail.com designates 209.85.215.50 as permitted sender) Received: from [209.85.215.50] (HELO mail-la0-f50.google.com) (209.85.215.50) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 12:58:01 +0000 Received: by mail-la0-f50.google.com with SMTP id gx14so883871lab.23 for ; Thu, 26 Sep 2013 05:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=/t4Y+Zed/8tXJ34m05Tq9T+09FcFYWkYeImLnPoK1MU=; b=CjbNZL2u2EMfvPyqXGsIacq0D7q/n3aSGy6La34BrKCddo4EMWxHGtc5rGhiCw29bE QdxbFvut6QwvC5ZbpYxpqVzPHL50Rma6n6VX8XXv4c5qmHpfWoNM5gnu3QoDPhJXbbcH bAoew/FkaOYzt9lUP03qkDIt6LRBWctsNwYucd+TDZN5X+N3HG4NJU6u5zdVw/6Kgv1U 1t96rIymee2cWyqC2c/VNpV8z5ZmLwjc7aY49ATCJDLAsiQ1VExatAixHVlwWHvvZh9x ExMZFu/foKbW0Tprz0L27ZPpvYZ3HmhHqfvzauaM+mleh/mjr/fXv/ldusU54p0ZDpps Zy9w== X-Received: by 10.152.120.228 with SMTP id lf4mr610736lab.44.1380200260286; Thu, 26 Sep 2013 05:57:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.112.97.227 with HTTP; Thu, 26 Sep 2013 05:57:20 -0700 (PDT) In-Reply-To: References: From: Kevin Sutter Date: Thu, 26 Sep 2013 07:57:20 -0500 Message-ID: Subject: Re: ClassNotFoundExceptions for Entity classes after bundle redeployment To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=089e011769153bbc5204e748eac9 X-Virus-Checked: Checked by ClamAV on apache.org --089e011769153bbc5204e748eac9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Dirk, Are you using container-managed persistence or application-managed persistence? That is, who is controlling the lifecycle of your EMFs and EMs? If the PCRegistry is continuing to grow and grow and grow, this sounds like an EMF or EM leak where they are not getting properly closed. What version of OpenJPA is in use? In 2.2.0, OpenJPA put a feature in place [1] that helps with resolving memory issues when failing to close EMFs. Another thing to look at is how you are enhancing your Entities for OpenJPA monitoring. Are you doing build-time enhancement or some type of runtime enhancement? Posting your persistence.xml would also be good. -- Kevin [1] https://issues.apache.org/jira/browse/OPENJPA-2042 On Thu, Sep 26, 2013 at 3:52 AM, Rudolph, Dirk wrote: > Hi all, > > > > we are using OpenJPA in our osgi environment (Apache Felix) and got some > (non-deterministic ) ClassNotFoundExceptions caused by already closed jar= s. > This occurs only when the persistence bundle we are using is redeployed. > > > > We mentioned that the PCRegistry.register method is invoked when our > Entity-classes get instantiated. This works as expected. The meta data ma= p > of the Registry is filled and successfully passed through the > MetadataRepository. After a redeployment this happens again and again so > the map of registered metas in the PCRegistry grows and grows and contain= s > classes referencing already disposed classloaders. When the registered > metadata get used this can cause ClassNotFoundExceptions when an outdated > classloader is access. I assume that this happens non-deterministic becau= se > the order of the data to iterate over isn't predictable. Is this diagnost= ic > right? > > > > Should PCRegistry.deRegister be called when a bundle is stopped before > update? Can this be done by any configuration? > > > > Thank's so far, > > > > > Dirk Rudolph > > > > > T-Systems Multimedia Solutions GmbH > Organisationseinheit CCS > Dirk Rudolph > Software-Entwicklung, OCJP > > Hausanschrift: Riesaer Stra=DFe 5, 01129 Dresden > Postanschrift: Postfach 10 02 24, 01072 Dresden > +49 351 2820-5363 (Tel) > E-Mail: Dirk.Rudolph@t-systems.com > > Internet: http://www.t-systems-mms.com > > T-Systems Multimedia Solutions GmbH > > Aufsichtsrat: Klaus Werner (Vorsitzender) > Gesch=E4ftsf=FChrung: Peter Klingenburg, Dr. Jens Nebendahl > Handelsregister: Amtsgericht Dresden HRB 11433 > Sitz der Gesellschaft: Dresden > Ust-IdNr.: DE 811 807 949 > > > > > > --089e011769153bbc5204e748eac9--