Search code examples
javasonarqubewindows-server-2012sonarqube-scan

Why am I seeing "An illegal reflective access operation has occurred" from Sonarqube on Windows Server 2012?


I am running Sonarqube on Windows Server 2012 without a SQL database, but I am getting this error:

SonarQube installed.
--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
2018.08.21 16:01:49 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\temp
2018.08.21 16:01:49 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2018.08.21 16:01:49 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from 
[C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\elasticsearch]: 
C:\Program Files\Java\jre-10.0.2\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\temp\conf\es
2018.08.21 16:01:49 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Java HotSpot(TM) 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2018.08.21 16:01:49 INFO  app[][o.e.p.PluginsService] no modules loaded
2018.08.21 16:01:49 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/C:/Users/teamcityuser/Desktop/sonarqube/sonarqube-7.3/lib/common/netty-common-4.1.13.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2018.08.21 16:01:58 INFO  app[][o.s.a.SchedulerImpl] Process[es] is up
2018.08.21 16:01:58 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='web', ipcIndex=2, logFilenamePrefix=web]] from [C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3]: C:\Program Files\Java\jre-10.0.2\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*;C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\lib\jdbc\h2\h2-1.3.176.jar org.sonar.server.app.WebServer C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\temp\sq-process1965346097759412139properties
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/C:/Users/teamcityuser/Desktop/sonarqube/sonarqube-7.3/lib/common/netty-common-4.1.13.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2018.08.21 16:02:36 INFO  app[][o.s.a.SchedulerImpl] Process[web] is up
2018.08.21 16:02:36 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='ce', ipcIndex=3, logFilenamePrefix=ce]] from [C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3]: C:\Program Files\Java\jre-10.0.2\bin\java -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djava.io.tmpdir=C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\temp -Xmx512m -Xms128m -XX:+HeapDumpOnOutOfMemoryError -cp ./lib/common/*;C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\lib\jdbc\h2\h2-1.3.176.jar org.sonar.ce.app.CeServer C:\Users\teamcityuser\Desktop\sonarqube\sonarqube-7.3\temp\sq-process9239565289637734744properties
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/C:/Users/teamcityuser/Desktop/sonarqube/sonarqube-7.3/lib/common/netty-common-4.1.13.Final.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2018.08.21 16:02:42 INFO  app[][o.s.a.SchedulerImpl] Process[ce] is up
2018.08.21 16:02:42 INFO  app[][o.s.a.SchedulerImpl] SonarQube is up

Solution

  • This is only a warning. And you see it because you use Java 9 or higher which introduced concept of modules. That concept also provides possibilities to limit access event to methods annotated as public. And in your case you use Java 9 or higher with SonarQube version which doesn't support Java modules. Your SonarQube version uses reflection to access java.nio.DirectByteBuffer which was made internal JVM class and not directly accessible for other modules. But because such access restriction due to Java modules introduction was a big change Java 9 only shows warnings in case of illegal reflection accesses. So if SonarQube works OK in your case you may continue to work but upgrade to next Java version may break it. You may try to upgrade SonarQube version to version compatible with Java 9 and higher if you do not want those warnings to appear in logs.