You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Alexandre Roman (JIRA)" <ji...@apache.org> on 2018/08/13 08:31:00 UTC

[jira] [Created] (FELIX-5905) SCR cannot access method getLogger from LogService R7

Alexandre Roman created FELIX-5905:
--------------------------------------

             Summary: SCR cannot access method getLogger from LogService R7
                 Key: FELIX-5905
                 URL: https://issues.apache.org/jira/browse/FELIX-5905
             Project: Felix
          Issue Type: Bug
          Components: Declarative Services (SCR)
    Affects Versions: scr-2.1.2
            Reporter: Alexandre Roman


I'm using SCR 2.1.5-SNAPSHOT with Felix LogService R7 and Felix Log-Extension.

The LogService bundle is installed in the boot classpath (with Felix Logback & SLF4J APIs), and I'm using Log-Extension to expose LogService services to the OSGi environment.

When using SCR, the method ValueUtils#getLogger cannot get access to the method LogService#getLogger using reflection for unknown reason: IllegalAccessException.

The LogService implementation used as argument (coming from Felix LogService) owns the right method, but the reflection code failed with this exception.

I tried a "workaround", using "setAccessible(true)" to the method handle, before invoking the method on the LogService implementation: now it works as expected.

I'm not sure if it's related to my setup, meanwhile I need this call to "setAccessible" in order to get the expected behaviour. Without it, SCR failed to get a logger instance, and my components fail with a NPE.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)