You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Tom Watson (Jira)" <ji...@apache.org> on 2020/01/30 13:49:00 UTC

[jira] [Resolved] (FELIX-6215) Cannot run scr unit tests on Java 11

     [ https://issues.apache.org/jira/browse/FELIX-6215?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tom Watson resolved FELIX-6215.
-------------------------------
    Fix Version/s: scr-2.1.18
       Resolution: Fixed

> Cannot run scr unit tests on Java 11
> ------------------------------------
>
>                 Key: FELIX-6215
>                 URL: https://issues.apache.org/jira/browse/FELIX-6215
>             Project: Felix
>          Issue Type: Improvement
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-2.1.16
>            Reporter: Mat Booth
>            Priority: Major
>             Fix For: scr-2.1.18
>
>
> When trying to run unit tests for Felix SCR on a Java 11 VM, it fails with this sort of error:
>  
> {code:java}
> [ERROR] test_packageT1SSI(org.apache.felix.scr.impl.inject.BindMethodTest)  Time elapsed: 0.009 s  <<< ERROR!
> org.mockito.exceptions.base.MockitoException: Mockito cannot mock this class: interface org.osgi.framework.ServiceReference.Mockito can only mock non-private & non-final classes.
> If you're not sure why you're getting this error, please report to the mailing list.
> Java               : 11
> JVM vendor name    : Oracle Corporation
> JVM vendor version : 11.0.6+10
> JVM name           : OpenJDK 64-Bit Server VM
> JVM version        : 11.0.6+10
> JVM info           : mixed mode
> OS name            : Linux
> OS version         : 5.4.12-100.fc30.x86_64
> Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
> 	at org.apache.felix.scr.impl.inject.BindMethodTest.setUp(BindMethodTest.java:59)
> Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
> 	at org.apache.felix.scr.impl.inject.BindMethodTest.setUp(BindMethodTest.java:59)
> Caused by: java.lang.IllegalStateException: Could not find sun.misc.Unsafe
> 	at org.apache.felix.scr.impl.inject.BindMethodTest.setUp(BindMethodTest.java:59)
> Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
> 	at org.apache.felix.scr.impl.inject.BindMethodTest.setUp(BindMethodTest.java:59)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)