Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal reflection warnings when building with Java 11 #27

Open
krystofNovotny opened this issue Feb 9, 2021 · 0 comments
Open

Illegal reflection warnings when building with Java 11 #27

krystofNovotny opened this issue Feb 9, 2021 · 0 comments
Assignees

Comments

@krystofNovotny
Copy link

Affected version: 22.1.0

When building the commons project - 2 error warnings pops up (see below).

They are caused by:

  • forgerock-guice depending on deprecated mockito-all which causes illegal Reflective operation.
  • JndiJmsContextManagerTest using Reflections to reset NamingManager::initialContextFactoryBuilder after each unit test

The goal of this issue is to propose clean solution for those problems, spawning another issue for each of them.

INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ chf-http-servlet ---
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.forgerock.http.servlet.ServletTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[ERROR] WARNING: An illegal reflective access operation has occurred
[ERROR] WARNING: Illegal reflective access by org.mockito.cglib.core.ReflectUtils$2 (file:/home/krystof/.m2/repository/org/mockito/mockito-all/1.10.19/mockito-all-1.10.19.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
[ERROR] WARNING: Please consider reporting this to the maintainers of org.mockito.cglib.core.ReflectUtils$2
[ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ERROR] WARNING: All illegal access operations will be denied in a future release
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.109 s - in org.forgerock.http.servlet.ServletTest

[ESC[1;34mINFOESC[m]  T E S T S
[ESC[1;34mINFOESC[m] -------------------------------------------------------
[ESC[1;34mINFOESC[m] Running ESC[1mTestSuiteESC[m
[ESC[1;31mERRORESC[m] WARNING: An illegal reflective access operation has occurred
[ESC[1;31mERRORESC[m] WARNING: Illegal reflective access by org.forgerock.audit.handlers.jms.JndiJmsContextManagerTest (file:/home/krystof/orchi/wren/wrensec-commons/audit/forgerock-audit-handler-jms/target/test-classes/) to method javax.naming.spi.NamingManager.getInitialContextFactoryBuilder()
[ESC[1;31mERRORESC[m] WARNING: Please consider reporting this to the maintainers of org.forgerock.audit.handlers.jms.JndiJmsContextManagerTest
[ESC[1;31mERRORESC[m] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ESC[1;31mERRORESC[m] WARNING: All illegal access operations will be denied in a future release
[ESC[1;34mINFOESC[m] ESC[1;32mTests run: ESC[0;1;32m8ESC[m, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.803 s - in ESC[1mTestSuiteESC[m
[ESC[1;34mINFOESC[m] 
[ESC[1;34mINFOESC[m] Results:
[ESC[1;34mINFOESC[m] 
[ESC[1;34mINFOESC[m] ESC[1;32mTests run: 8, Failures: 0, Errors: 0, Skipped: 0ESC[m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants