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 721177156 for ; Sun, 4 Sep 2011 20:30:13 +0000 (UTC) Received: (qmail 79206 invoked by uid 500); 4 Sep 2011 20:30:12 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 79140 invoked by uid 500); 4 Sep 2011 20:30:12 -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 79132 invoked by uid 99); 4 Sep 2011 20:30:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Sep 2011 20:30:11 +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 (athena.apache.org: domain of bengt.rodehav@gmail.com designates 209.85.210.41 as permitted sender) Received: from [209.85.210.41] (HELO mail-pz0-f41.google.com) (209.85.210.41) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Sep 2011 20:30:06 +0000 Received: by pzk4 with SMTP id 4so9645117pzk.14 for ; Sun, 04 Sep 2011 13:29:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=44sNmjYCM+AExc9GQnJeQTVg/45bXrzGUtdyay/Geq0=; b=NtafxUu4p8QznejJG4h3quh4Elg8Lac26GMYiGyPmLQdNuSn6Cx3qaV4C3htogEPIh BqFOUNiSp8h/CZuLxnSGBxYpCN9xXwYMz9I2huwoOs1evm0UBdc/SWh2bnJr90eGyG4O qfNX8f5knKGSx8pGQL4ElgyXDB518fxQ4BynA= MIME-Version: 1.0 Received: by 10.68.9.231 with SMTP id d7mr6509986pbb.300.1315168185892; Sun, 04 Sep 2011 13:29:45 -0700 (PDT) Sender: bengt.rodehav@gmail.com Received: by 10.68.66.133 with HTTP; Sun, 4 Sep 2011 13:29:45 -0700 (PDT) Date: Sun, 4 Sep 2011 22:29:45 +0200 X-Google-Sender-Auth: 9LM2uzKJeuL7d28BHjG7EfRCUjw Message-ID: Subject: Auditor and OSGi From: Bengt Rodehav To: users@openjpa.apache.org Content-Type: multipart/alternative; boundary=bcaec5215a3f8a3de604ac2374ca --bcaec5215a3f8a3de604ac2374ca Content-Type: text/plain; charset=ISO-8859-1 Hello everyone, After a long discussion about audit logging on this mailing list, Pinaki developed an audit logging facility that he describes on: http://openjpa.208410.n2.nabble.com/OpenJPA-Audit-Facility-tc6722915.html It provides very interesting functionality and I've tried it in simple JUnit scenarios using RESOURCE_LOCAL and it seems to work fine. However, my production environment nowadays is OSGi using Karaf+Felix. I use Aries for transaction support and also for it's JPA support. In that environment, OpenJPA doesn't seem to be able to find my auditor implementation (se.digia.maia.common.auditlog.impl.MaiaAuditor) that I specify in my persistence.xml. Has anyone else tried OpenJPA's new audit log facility? How can I make OpenJPA find classes specified in the persistence.xml? I have double-checked that the se.digia.maia.common.auditlog.impl is exported from my implementing bundle. I get the following exception: *ERROR: Bundle org.apache.aries.jpa.container [21] EventDispatcher: Error > during dispatch. ( > org.apache.openjpa.persistence.ArgumentException: Could not invoke the > static newInstance method on the named factory class > "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory".) > > org.apache.openjpa.persistence.ArgumentException: Could not invoke the > static newInstance method on the named factory class > "org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". > at > org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:76) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.getBrokerFactory(PersistenceProviderImpl.java:147) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:185) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.createContainerEntityManagerFactory(PersistenceProviderImpl.java:62) > at > org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.createEntityManagerFactories(EntityManagerFactoryManager.java:263) > at > org.apache.aries.jpa.container.impl.EntityManagerFactoryManager.bundleStateChange(EntityManagerFactoryManager.java:153) > at > org.apache.aries.jpa.container.impl.PersistenceBundleManager.modifiedBundle(PersistenceBundleManager.java:283) > at > org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:453) > at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:237) > at > org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:413) > at > org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:807) > at > org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:729) > at > org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:610) > at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3879) > at org.apache.felix.framework.Felix.access$800(Felix.java:79) > at > org.apache.felix.framework.Felix$StatefulResolver.fireResolvedEvents(Felix.java:4491) > at > org.apache.felix.framework.Felix$StatefulResolver.resolve(Felix.java:4162) > at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3557) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1797) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1192) > at org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:266) > at java.lang.Thread.run(Thread.java:662) > Caused by: org.apache.openjpa.lib.util.ParseException: Instantiation of > plugin "Auditor" with value "se.digia.maia.common.auditlog.impl.MaiaAuditor" > caused an error "java.lang.IllegalArgumentException: > java.lang.ClassNotFoundException: > se.digia.maia.common.auditlog.impl.MaiaAuditor". The alias or class name may > have been misspelled, or the class may not have be available in the class > path. Valid aliases for this plugin are: [default] > at > org.apache.openjpa.lib.conf.Configurations.getCreateException(Configurations.java:409) > at > org.apache.openjpa.lib.conf.Configurations.newInstance(Configurations.java:219) > at > org.apache.openjpa.lib.conf.ObjectValue.newInstance(ObjectValue.java:124) > at > org.apache.openjpa.lib.conf.PluginValue.instantiate(PluginValue.java:103) > at > org.apache.openjpa.lib.conf.ObjectValue.instantiate(ObjectValue.java:83) > at > org.apache.openjpa.conf.OpenJPAConfigurationImpl.getAuditorInstance(OpenJPAConfigurationImpl.java:1822) > at > org.apache.openjpa.kernel.AbstractBrokerFactory.postCreationCallback(AbstractBrokerFactory.java:854) > at > org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.postCreationCallback(JDBCBrokerFactory.java:105) > at > org.apache.openjpa.kernel.Bootstrap.newBrokerFactory(Bootstrap.java:67) > ... 21 more > Caused by: java.lang.IllegalArgumentException: > java.lang.ClassNotFoundException: > se.digia.maia.common.auditlog.impl.MaiaAuditor > at serp.util.Strings.toClass(Strings.java:164) > at serp.util.Strings.toClass(Strings.java:108) > at > org.apache.openjpa.lib.conf.Configurations.newInstance(Configurations.java:211) > ... 28 more* /Bengt --bcaec5215a3f8a3de604ac2374ca--