Roland Weiglhofer (JIRA)
2013-08-27 07:19:53 UTC
Roland Weiglhofer created LOG4J2-373:
----------------------------------------
Summary: Classloader issue in OSGi-environment
Key: LOG4J2-373
URL: https://issues.apache.org/jira/browse/LOG4J2-373
Project: Log4j 2
Issue Type: Bug
Components: API, Core
Affects Versions: 2.0-beta9
Environment: OSGi R5 / R4 (Apache Felix 4.x)
Reporter: Roland Weiglhofer
Priority: Critical
Using Log4j2 in a bundle causes following error:
ERROR StatusLogger org.apache.logging.log4j.core.impl.Log4jContextFactory does not implement org.apache.logging.log4j.spi.LoggerContextFactory
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
printing the ClassLoaders in LogManager gives me following output:
org.apache.logging.log4j.spi.LoggerContextFactory loaded by org.apache.logging.log4j-api [13]
org.apache.logging.log4j.core.impl.Log4jContextFactory loaded by sun.misc.Launcher$***@35a16869
We have two different ClassLoaders. That's why the implementation is not assignable. The core uses the bootstrap-classloader and the api uses the bundle-classloader.
Workaround needed. Thx
--
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: http://www.atlassian.com/software/jira
----------------------------------------
Summary: Classloader issue in OSGi-environment
Key: LOG4J2-373
URL: https://issues.apache.org/jira/browse/LOG4J2-373
Project: Log4j 2
Issue Type: Bug
Components: API, Core
Affects Versions: 2.0-beta9
Environment: OSGi R5 / R4 (Apache Felix 4.x)
Reporter: Roland Weiglhofer
Priority: Critical
Using Log4j2 in a bundle causes following error:
ERROR StatusLogger org.apache.logging.log4j.core.impl.Log4jContextFactory does not implement org.apache.logging.log4j.spi.LoggerContextFactory
ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
printing the ClassLoaders in LogManager gives me following output:
org.apache.logging.log4j.spi.LoggerContextFactory loaded by org.apache.logging.log4j-api [13]
org.apache.logging.log4j.core.impl.Log4jContextFactory loaded by sun.misc.Launcher$***@35a16869
We have two different ClassLoaders. That's why the implementation is not assignable. The core uses the bootstrap-classloader and the api uses the bundle-classloader.
Workaround needed. Thx
--
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: http://www.atlassian.com/software/jira