openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Burgazzoli (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-2345) OpenJPA logging in OSGi/Karaf
Date Sun, 10 Mar 2013 16:41:12 GMT


Luca Burgazzoli commented on OPENJPA-2345:

If I set a custom logger, OpenJPA fails to load the class whereas the class is available in
the same bundle as the persistence.xml: 

Caused by: org.apache.openjpa.lib.util.ParseException: Instantiation of plugin "Log" with
value "lb.examples.karaf.jpa.openjpa.OpenJpaLogFactory" caused an error "java.lang.IllegalArgumentException:
java.lang.ClassNotFoundException: lb.examples.karaf.jpa.openjpa.OpenJpaLogFactory". 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: [commons, false, log4j, none, openjpa, slf4j, true]
	at org.apache.openjpa.lib.conf.Configurations.getCreateException(
	at org.apache.openjpa.lib.conf.Configurations.newInstance(
	at org.apache.openjpa.lib.conf.ObjectValue.newInstance(
	at org.apache.openjpa.lib.conf.PluginValue.instantiate(
	at org.apache.openjpa.lib.conf.ObjectValue.instantiate(
	at org.apache.openjpa.lib.conf.ConfigurationImpl.getLogFactory(
	at org.apache.openjpa.lib.conf.ConfigurationImpl.getLog(
	at org.apache.openjpa.conf.OpenJPAConfigurationImpl.getConfigurationLog(
	at org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationProviderImpl.setInto(
	at org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory.newInstance(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_43]
	at sun.reflect.NativeMethodAccessorImpl.invoke([:1.6.0_43]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke([:1.6.0_43]
	at java.lang.reflect.Method.invoke([:1.6.0_43]
	at org.apache.openjpa.kernel.Bootstrap.invokeFactory([151:org.apache.openjpa:2.2.1]
	at org.apache.openjpa.kernel.Bootstrap.newBrokerFactory([151:org.apache.openjpa:2.2.1]
	... 34 more
Caused by: java.lang.IllegalArgumentException: java.lang.ClassNotFoundException: lb.examples.karaf.jpa.openjpa.OpenJpaLogFactory
	at serp.util.Strings.toClass(
	at serp.util.Strings.toClass(
	at org.apache.openjpa.lib.conf.Configurations.newInstance(
	... 48 more
> OpenJPA logging in OSGi/Karaf
> -----------------------------
>                 Key: OPENJPA-2345
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: logging, osgi
>    Affects Versions: 2.2.1
>            Reporter: Luca Burgazzoli
> lbuonline 
> I'm trying to configure OpenJPA to properly work in Apache Karaf 2.3.0 and everything
seems to work well except the logging part as if I set the following properties in the persistence.xml,
the statement are obviously logged in the console: 
> <properties>
>     <property name="openjpa.Log"                         value="DefaultLevel=TRACE"/>
>     <property name="openjpa.ConnectionFactoryProperties" value="PrintParameters=true"/>
> </properties>
> If I set the following properties in the persistence.xml, nothing is logged in karaf's
log file: 
> <properties>
>     <property name="openjpa.Log"                         value="slf4j"/>
>     <property name="openjpa.ConnectionFactoryProperties" value="PrintParameters=true"/>
> </properties>
> I've also tried to configure a custom logger or to use log4j or common as logger but
then the bundle fails to start with the following error: 
> 2013-03-01 10:00:37,360 | DEBUG | rint Extender: 1 | BlueprintEventDispatcher       
 | ntainer.BlueprintEventDispatcher  136 | 7 - org.apache.aries.blueprint.core - 1.0.1 | Sending
blueprint container event BlueprintEvent[type=GRACE_PERIOD, dependencies=[(&(&(!(org.apache.aries.jpa.proxy.factory=*))(]]
for bundle jpa-openjpa 

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message