Return-Path: Delivered-To: apmail-openjpa-dev-archive@www.apache.org Received: (qmail 20935 invoked from network); 27 Jul 2007 20:01:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jul 2007 20:01:55 -0000 Received: (qmail 94018 invoked by uid 500); 27 Jul 2007 20:01:56 -0000 Delivered-To: apmail-openjpa-dev-archive@openjpa.apache.org Received: (qmail 93981 invoked by uid 500); 27 Jul 2007 20:01:56 -0000 Mailing-List: contact dev-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list dev@openjpa.apache.org Received: (qmail 93972 invoked by uid 99); 27 Jul 2007 20:01:56 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 13:01:56 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of mprudhomapache@gmail.com designates 209.85.198.191 as permitted sender) Received: from [209.85.198.191] (HELO rv-out-0910.google.com) (209.85.198.191) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2007 20:01:50 +0000 Received: by rv-out-0910.google.com with SMTP id k20so117932rvb for ; Fri, 27 Jul 2007 13:01:30 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=pRTJx29/FucGKHR4KetwK3H5FMEqgEzMsGhJyCwJXRclW6Luq9LCtpI97hWTE+dOMhvxgdjkJeACbToXjycGN99SOKtx9WlpFTfixoC5FfrDW1IXM2htqx8YWIHeEA6lE0e56LOmJZayIW0X3p+g7xRF8Oq/BEb7SJ9Dn9YwL2s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:content-transfer-encoding:from:subject:date:to:x-mailer:sender; b=En+P4oTSKM/3/Iux9nrmd9VqYxrPU7LtUKN6fXK/tSB0d4t2piZZPL8P9EUnE2iSCuNVA8pAxFu7RXCqIWnKzEc2rkLQEEfbFFOKa6N2UgGOST8grOIG2sDsgtkRLhJSXPkgthRhaEux31FPe8iVds4Oj88HGn6BzhJzUAqM4rc= Received: by 10.140.203.9 with SMTP id a9mr1034050rvg.1185566490490; Fri, 27 Jul 2007 13:01:30 -0700 (PDT) Received: from ?192.168.1.10? ( [66.248.222.34]) by mx.google.com with ESMTPS id l31sm139055rvb.2007.07.27.13.01.29 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 27 Jul 2007 13:01:29 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <8e68c8e90707270948r7263f317n3e59cb8f8aa96413@mail.gmail.com> References: <8e68c8e90707270948r7263f317n3e59cb8f8aa96413@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5A088184-2B6D-45DA-A015-46B8A5C5D931@apache.org> Content-Transfer-Encoding: 7bit From: Marc Prud'hommeaux Subject: Re: openjpa.Configuration Logging Channel Problem Date: Fri, 27 Jul 2007 13:01:06 -0700 To: dev@openjpa.apache.org X-Mailer: Apple Mail (2.752.3) Sender: Marc Prud'hommeaux X-Virus-Checked: Checked by ClamAV on apache.org Albert- You are correct: there is no actual openjpa.Configuration log. Sorry you had to go through all the trouble to track that down! I've gone ahead and updated the docs for the next version of OpenJPA to remove mention of that channel. > 3) The logging channels section in the manual needs to add the " > openjpa.jdbc.Schema" log channel. This channel is already mentioned in http://openjpa.apache.org/docs/ latest/manual/manual.html#ref_guide_logging_channels (although it is after the example of the preceding property, so it is understandable if it isn't immediately obvious). On Jul 27, 2007, at 9:48 AM, Albert Lee wrote: > Is OpenJpa supporting "openjpa.Configuration" log channel? > According to the > manual: > 1. Logging Channels > > Logging is done over a number of *logging channels*, each of which has > a *logging > level* which controls the verbosity of log messages recorded for the > channel. OpenJPA uses the following logging channels: > > - > > openjpa.Configuration: Messages issued by the configuration > framework. > > it is supported feature, however when it is specified, e.g. > > > > the following exception is thrown at runtime: > > Exception in thread "main" <0.0.0 fatal general error> > org.apache.openjpa.persistence.PersistenceException: There was an > error when > invoking the static newInstance method on the named factory class " > org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory". See the nested > exception > for details. > at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory > (Bootstrap.java > :67) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMan > agerFactory > (PersistenceProviderImpl.java:74) > at > com.ibm.websphere.persistence.PersistenceProviderImpl.createEntityMana > gerFactory > (PersistenceProviderImpl.java:42) > at > org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityMan > agerFactory > (PersistenceProviderImpl.java:82) > at javax.persistence.Persistence.createEntityManagerFactory( > Persistence.java:83) > at javax.persistence.Persistence.createEntityManagerFactory( > Persistence.java:60) > at suite.r70.jse.EntityTest.main(EntityTest.java:14) > Caused by: org.apache.openjpa.lib.util.ParseException: > org.apache.openjpa.lib.log.LogFactoryImpl@6ac66ac6.Configuration = > TRACE > at org.apache.openjpa.lib.util.Options.setInto(Options.java:237) > at org.apache.openjpa.lib.util.Options.setInto(Options.java:190) > at org.apache.openjpa.lib.conf.Configurations.configureInstance( > Configurations.java:436) > at org.apache.openjpa.lib.conf.Configurations.configureInstance( > Configurations.java:390) > at org.apache.openjpa.lib.conf.PluginValue.instantiate > (PluginValue.java > :102) > at org.apache.openjpa.lib.conf.ObjectValue.instantiate > (ObjectValue.java > :82) > at org.apache.openjpa.lib.conf.ConfigurationImpl.getLogFactory( > ConfigurationImpl.java:204) > at org.apache.openjpa.lib.conf.ConfigurationImpl.getLog( > ConfigurationImpl.java:223) > at > org.apache.openjpa.conf.OpenJPAConfigurationImpl.getConfigurationLog( > OpenJPAConfigurationImpl.java:1432) > at > org.apache.openjpa.persistence.PersistenceProductDerivation > $ConfigurationProviderImpl.setInto > (PersistenceProductDerivation.java:424) > at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance( > JDBCBrokerFactory.java:59) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke( > NativeMethodAccessorImpl.java:64) > at sun.reflect.DelegatingMethodAccessorImpl.invoke( > DelegatingMethodAccessorImpl.java:43) > at java.lang.reflect.Method.invoke(Method.java:615) > at org.apache.openjpa.kernel.Bootstrap.invokeFactory > (Bootstrap.java:124) > at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory > (Bootstrap.java > :62) > ... 6 more > Caused by: java.lang.NoSuchMethodException: > org.apache.openjpa.lib.conf.Configuration.(java.lang.String) > at java.lang.Class.throwNoSuchMethodException(Class.java:275) > at java.lang.Class.getConstructor(Class.java:320) > at org.apache.openjpa.lib.util.Options.stringToObject > (Options.java:436) > at org.apache.openjpa.lib.util.Options.setInto(Options.java:229) > ... 22 more > > One can work around the problem by using "openjpa.Configuration" > instead of > "Configuration". > > A few other observations: > 1) I grep for "openjpa.Configuration" from all the java files and > nowhere > this string is found. I can found the other log channel names (e.g. > openjpa.Runtime, openjpa.Enhance) in either > OpenJPAConfiguration.java or > JDBCConfiguration.java > 2) When I debug the problem and stop in LogFactoryImpl.getLog() > method and > no one is calling this method with "openjpa.Configuration" channel. > So it > seems no "configuration" information is being logged. > 3) The exception is caused by the Options class trying to reflect > and find > the constructor from the Configuration.java interface with a String > argument. The reason it gets to this path is because > Options.matchOpetionToMember() found a setConfiguration() method in > LogFactoryImpl. > 4) There is a "openjpa.jdbc.Schema" log channel defined in > JDBCConfiguration.java but not document in the manual. > 5) The same scenario works in the 0.9.7 level, so something was > changed > since then. > > From the investigation: > 1) It looks like "openjpa.Configuration" is not being used at all. > If so, > the manual need to remove the openjpa.Configuration in the Logging > Channels > section. > 2) If it is still supported, then there is a bug somewhere. > 3) The logging channels section in the manual needs to add the " > openjpa.jdbc.Schema" log channel. > 4) If user uses the incorrect logging channel name, a warning/error > message > should be posted instead of the observed exception. > > Are these valid observations and interpretations? > > Albert Lee.