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 DD2CD785E for ; Fri, 16 Sep 2011 19:57:00 +0000 (UTC) Received: (qmail 74609 invoked by uid 500); 16 Sep 2011 19:57:00 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 74580 invoked by uid 500); 16 Sep 2011 19:57:00 -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 74572 invoked by uid 99); 16 Sep 2011 19:57:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2011 19:57:00 +0000 X-ASF-Spam-Status: No, hits=2.8 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of bengt.rodehav@gmail.com designates 209.85.216.41 as permitted sender) Received: from [209.85.216.41] (HELO mail-qw0-f41.google.com) (209.85.216.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2011 19:56:54 +0000 Received: by qwa26 with SMTP id 26so2046903qwa.0 for ; Fri, 16 Sep 2011 12:56:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=PKtgEhpp/0L8xoSc+XC5ME34Z1WgnPEVKagoiN7FsR4=; b=HCMktq464aQau4purWe5wX6m3HcniRR+HbwCE2gQZl5wiwCZ+UDgTIqpBVRxjLN81l qzn8khng2Hm+Gn7MZER/JavPOKDWAeSYT1l7NOQ2+3O07LhOX5Dz86w4Hbv1BhI/dHgI 1vtPUucovzmAjK8bfCO98lD7E3aE9/sCZyhiU= MIME-Version: 1.0 Received: by 10.68.19.105 with SMTP id d9mr948432pbe.129.1316202992777; Fri, 16 Sep 2011 12:56:32 -0700 (PDT) Sender: bengt.rodehav@gmail.com Received: by 10.68.46.1 with HTTP; Fri, 16 Sep 2011 12:56:32 -0700 (PDT) In-Reply-To: References: <1315432356010-6769605.post@n2.nabble.com> Date: Fri, 16 Sep 2011 21:56:32 +0200 X-Google-Sender-Auth: MnMIkFnfUuX5r_zgPO0NuEN1_Es Message-ID: Subject: Re: Auditor and OSGi From: Bengt Rodehav To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=bcaec5215eefd6384b04ad1463e0 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec5215eefd6384b04ad1463e0 Content-Type: text/plain; charset=ISO-8859-1 I created the following JIRA: https://issues.apache.org/jira/browse/OPENJPA-2052 /Bengt 2011/9/13 Bengt Rodehav > Hello, > > Just wanted to check if you've had any chance to look at this Pinak. > > /Bengt > > > 2011/9/8 Bengt Rodehav > >> Hello again, >> >> I'm not familiar with the class resolver plugin but I did the following: >> >> - I created a resolver (code is at the end of the mail) >> - I configured my persistence.xml to use that resolver (persistence.xml at >> the end of the mail) >> >> The above does not throw any exceptions on startup. On the other hand, I'm >> not sure whether it's used. I added a System.out logging in >> the getClassLoader() method but the output never shows up in runtime but it >> does seem to show up during build time when I run the PCEnhancer ant task. >> >> I then tried to move my resolver into a package that I do not export (in >> OSGi). I thought that even if the getClassLoader() method wasn't called, >> OpenJPA might still want to find the class and then fail. But I still get no >> errors regarding the class resolver in runtime (under OSGi). Note that at >> this point I'm not really using OpenJPA in the container, I'm just loading >> and initalising it. >> >> Not sure if this proves your point Pinaki - you be the judge. >> >> /Bengt >> >> *MyClassResolver.java* >> >>> *package se.digia.maia.resolver; >>> import org.apache.openjpa.util.ClassResolver; >>> public class MyClassResolver implements ClassResolver { >>> @Override >>> public ClassLoader getClassLoader(Class theArg0, ClassLoader >>> theArg1) { >>> System.out.println("***Calling MyClassResolver***"); >>> return null; >>> } >>> }* >> >> >> *persistence.xml* >> >>> * >>> >> xsi:schemaLocation="http://java.sun.com/xml/ns/persistence >>> http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" >>> version="2.0"> >>> >>> >>> org.apache.openjpa.persistence.PersistenceProviderImpl >>> osgi:service/javax.sql.DataSource/( >>> osgi.jndi.service.name=jdbc/maiajta) >>> se.digia.maia.common.persistence.EntityBase >>> se.digia.maia.common.security.domain.User >>> se.digia.maia.common.auditlog.domain.AuditLogEntry >>> se.digia.maia.core.bu.domain.BusinessUnit >>> true >>> NONE >>> >>> >> value="se.digia.maia.resolver.MyClassResolver" /> >>> >>> >> value="buildSchema(ForeignKeys=true)" /> >>> >> value="org.apache.openjpa.jdbc.sql.MySQLDictionary" /> >>> >> /> >>> >> /> >>> >>> >>> >>> >>> >>> * >> >> >> >> >> 2011/9/7 Pinaki Poddar >> >>> The auditor is plugged-in in an unusual way than other plug-ins. So that >>> might be causing this failure. But please do the following: >>> 1. Configure any other OpenJPA plugin that takes a fully-qualified class >>> name as property value e.g. [1] >>> 2. Supply a org.acme.Foo class for it and package exactly the way you >>> have >>> packaged the Auditor implementation class. >>> 3. Verify if the plugged-in class is loaded >>> >>> We will know whether it is a generic failure with loading plug-in in OSGi >>> environment or specific to Auditor. >>> >>> [1] >>> >>> http://openjpa.apache.org/builds/latest/docs/manual/manual.html#openjpa.ClassResolver >>> >>> ----- >>> Pinaki Poddar >>> Chair, Apache OpenJPA Project >>> -- >>> View this message in context: >>> http://openjpa.208410.n2.nabble.com/Auditor-and-OSGi-tp6759170p6769605.html >>> Sent from the OpenJPA Users mailing list archive at Nabble.com. >>> >> >> > --bcaec5215eefd6384b04ad1463e0--