[ 
https://issues.apache.org/jira/browse/FELIX-5905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16578509#comment-16578509
 ] 

Carsten Ziegeler commented on FELIX-5905:
-----------------------------------------

The getLogger method is public, so I fail to see why setAccessible(true) is 
required here
[~rotty3000] Do you have any idea?

> 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
>            Priority: Blocker
>
> 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)

Reply via email to