]
Jens Reimann commented on JBLOGGING-126:
----------------------------------------
I just looked into the package import declaration:
{code:xml}
<Import-Package>
*;resolution:=optional
</Import-Package>
{code}
This won't catch any calls to {{Class.formName(…)}}. So an explicit import is required
here.
log4j detection broken in OSGi
------------------------------
Key: JBLOGGING-126
URL:
https://issues.jboss.org/browse/JBLOGGING-126
Project: JBoss Logging
Issue Type: Bug
Components: jboss-logging-log4j
Affects Versions: 3.3.0.Final
Environment: OSGi, tested on Equinox 3.11.1
Reporter: Jens Reimann
Assignee: James Perkins
This was introduced by a change in JBLOGGING-94
The test for log4j was changed from:
{code:java}
Class.forName("org.apache.log4j.Hierarchy", true, cl);
{code}
to:
{code:java}
Class.forName("org.apache.log4j.config.PropertySetter", true, cl);
{code}
However the OSGi package imports where not updated to also include
"{{org.apache.log4j.config}}". And this the latter test for
"{{PropertySetter}}" will always fail in OSGi.
The fix should be pretty simple. Simply import "{{org.apache.log4j.config}}" as
optional in addition.