openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert Lee" <allee8...@gmail.com>
Subject openjpa.Configuration Logging Channel Problem
Date Fri, 27 Jul 2007 16:48:43 GMT
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.createEntityManagerFactory
(PersistenceProviderImpl.java:74)
    at
com.ibm.websphere.persistence.PersistenceProviderImpl.createEntityManagerFactory
(PersistenceProviderImpl.java:42)
    at
org.apache.openjpa.persistence.PersistenceProviderImpl.createEntityManagerFactory
(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