openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee" <allee8...@gmail.com>
Subject Re: openjpa.Configuration Logging Channel Problem
Date Fri, 27 Jul 2007 21:33:02 GMT
Thanks for the quick validation.

Once you mention the example, I did find the reference of
openjpa.jdbc.Schema in the example 3.4 and 3.5.

For completeness, it would be nice to update "openjpa.Configuration" and "
openjpa.jdbc.Schema" in the following section:

3.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.Tool: Messages issued by the OpenJPA command line and Ant tools.
Most messages are basic statements detailing
which classes or files the tools are running on. Detailed output is only
available via the logging category the tool belongs
to, such as openjpa.Enhance for the enhancer (see Section 5.2, " Enhancement
" [219)]or openjpa.MetaData for the
mapping tool (see Section 7.1, " Forward Mapping " [245).]This logging
category is provided so that you can get a general
idea of what a tool is doing without having to manipulate logging settings
that might also affect runtime behavior.
>>>>>> DELETE Begin >>>>>>
• openjpa.Configuration: Messages issued by the configuration framework.
>>>>>> DELETE End >>>>>>
• openjpa.Enhance: Messages pertaining to enhancement and runtime class
generation.
• openjpa.MetaData: Details about the generation of metadata and
object-relational mappings.
• openjpa.Runtime: General OpenJPA runtime messages.
• openjpa.Query: Messages about queries. Query strings and any parameter
values, if applicable, will be logged to the
TRACE level at execution time. Information about possible performance
concerns will be logged to the INFO level.
• openjpa.DataCache: Messages from the L2 data cache plugins.
• openjpa.jdbc.JDBC: JDBC connection information. General JDBC information
will be logged to the TRACE level. Information
about possible performance concerns will be logged to the INFO level.
• openjpa.jdbc.SQL: This is the most common logging channel to use. Detailed
information about the execution of SQL
statements will be sent to the TRACE level. It is useful to enable this
channel if you are curious about the exact SQL that Open-
JPA issues to the datastore.
>>>>>> ADD Begin >>>>>>
• openjpa.jdbc.Schema: This is ...............
>>>>>> ADD End >>>>>>

Thanks again.
Albert Lee.

On 7/27/07, Marc Prud'hommeaux <mprudhom@apache.org> wrote:
>
> 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.
> >
> >      <property name="openjpa.Log" value="Configuration=TRACE"/>
> >
> > 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.<init>(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.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message