Generator-jhipster: An illegal reflective access operation

Created on 24 Aug 2019  ·  12Comments  ·  Source: jhipster/generator-jhipster

Overview of the issue

After a fresh install (without any entity or controler) of mononlythic application on jdk 11, i got error

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/home/morgan/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.EPollSelectorProvider()
WARNING: Please consider reporting this to the maintainers of org.xnio.nio.NioXnio$2
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
##### **JHipster Version(s)** 6.2 ##### **JHipster Version(s)**
[email protected] /home/morgan/git/qualishop
└── [email protected] 

##### **JHipster configuration, a `.yo-rc.json` file generated in the root folder**
.yo-rc.json file
{
  "generator-jhipster": {
    "promptValues": {
      "packageName": "com.qualihub.shop",
      "nativeLanguage": "en"
    },
    "jhipsterVersion": "6.2.0",
    "applicationType": "monolith",
    "baseName": "qualiShop",
    "packageName": "com.qualihub.shop",
    "packageFolder": "com/qualihub/shop",
    "serverPort": "8080",
    "authenticationType": "session",
    "cacheProvider": "ehcache",
    "enableHibernateCache": true,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mariadb",
    "searchEngine": false,
    "messageBroker": false,
    "serviceDiscoveryType": false,
    "buildTool": "maven",
    "enableSwaggerCodegen": false,
    "rememberMeKey": "YourJWTSecretKeyWasReplacedByThisMeaninglessTextByTheJHipsterInfoCommandForObviousSecurityReasons",
    "useSass": true,
    "clientPackageManager": "npm",
    "clientFramework": "angularX",
    "clientTheme": "flatly",
    "clientThemeVariant": "light",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "entitySuffix": "",
    "dtoSuffix": "DTO",
    "otherModules": [],
    "enableTranslation": true,
    "nativeLanguage": "en",
    "languages": ["en", "fr"],
    "blueprints": []
  }
}

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory


JDL entity definitions


Environment and Tools

openjdk version "11.0.4" 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mode, sharing)

git version 2.17.1

node: v8.11.3

npm: 5.6.0

yeoman: 3.1.0

yarn: 1.9.2

Docker version 18.06.0-ce, build 0ffa825

docker-compose version 1.18.0, build 8dd22a9

INFO! Congratulations, JHipster execution is complete!

Browsers and Operating System

Ubuntu 18.04 LTS

area java

All 12 comments

Guessing it's related to https://issues.jboss.org/browse/UNDERTOW-1355 since JHipster uses Undertow and the stacktraces match.

If I understand well, the issue say the problem is fixed since version 2.3.2.Final.
Maybe it is just a library update ?

@Nymerea : Don't think it's resolved yet. I believe what you are referring to is the jboss-threads version. The fix for the problem is to update Undertow's XNIO library to some version which in turn has jboss-threads version 2.3.2.Final or higher. But this seems to have other problems....

The final comment points to a link (http://undertow.io/blog/2019/04/15/Undertow-3.html) that says they are going to dump XNIO in favor of Netty.

Here is another issue when running JHipster under Java 12.

WARNING: An illegal reflective access operation has occurred

`WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:/Users/mustapha/.m2/repository/org/springframework/spring-core/5.1.9.RELEASE/spring-core-5.1.9.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)

WARNING: Please consider reporting this to the maintainers of org.springframework.cglib.core.ReflectUtils

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

@maznag : >>This<< seems to be the thread relevant to your issue; could you post the full stack trace after passing --illegal-access=debug argument please? Then we might be able to get some more information on this. 😄

https://github.com/spring-projects/spring-framework/issues/20414

@SudharakaP I try to run JHipster with this option -illegal-access=debug but it doesn't work:

./mvnw --illegal-access=debug
Unable to parse command line options: Unrecognized option: --illegal-access=debug

@maznag : It needs to be passed in as a JVM argument; if you are running it through the maven wrapper try this ./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="--illegal-access=debug"

@SudharakaP thanks ! it works. here is the result:

For information, I activated Websocket option in my application.

WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils (file:/Users/mustapha/.m2/repository/org/springframework/spring-core/5.1.9.RELEASE/spring-core-5.1.9.RELEASE.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
    at org.springframework.cglib.core.ReflectUtils.defineClass(ReflectUtils.java:525)
    at org.springframework.cglib.core.AbstractClassGenerator.generate(AbstractClassGenerator.java:363)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:110)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData$3.apply(AbstractClassGenerator.java:108)
    at org.springframework.cglib.core.internal.LoadingCache$2.call(LoadingCache.java:54)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at org.springframework.cglib.core.internal.LoadingCache.createEntry(LoadingCache.java:61)
    at org.springframework.cglib.core.internal.LoadingCache.get(LoadingCache.java:34)
    at org.springframework.cglib.core.AbstractClassGenerator$ClassLoaderData.get(AbstractClassGenerator.java:134)
    at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:319)
    at org.springframework.cglib.reflect.FastClass$Generator.create(FastClass.java:65)
    at org.springframework.cglib.proxy.MethodProxy.helper(MethodProxy.java:135)
    at org.springframework.cglib.proxy.MethodProxy.init(MethodProxy.java:76)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:242)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
    at com.jhipster.config.WebsocketSecurityConfiguration$$EnhancerBySpringCGLIB$$ad387939.inboundChannelSecurity(<generated>)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:622)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:456)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1321)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1160)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.resolveBeanReference(ConfigurationClassEnhancer.java:394)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:366)
    at com.jhipster.config.WebsocketSecurityConfiguration$$EnhancerBySpringCGLIB$$ad387939.inboundChannelSecurity(<generated>)
    at org.springframework.security.config.annotation.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer.configureClientInboundChannel(AbstractSecurityWebSocketMessageBrokerConfigurer.java:106)
    at org.springframework.web.socket.config.annotation.DelegatingWebSocketMessageBrokerConfiguration.configureClientInboundChannel(DelegatingWebSocketMessageBrokerConfiguration.java:73)
2019-09-05 18:07:08.411 DEBUG 4831 --- [  restartedMain] com.hipster.config.DatabaseConfiguration  : H2 database is available on port 18080
2019-09-05 18:07:13.934 DEBUG 4831 --- [  restartedMain] i.g.j.c.apidoc.SwaggerAutoConfiguration  : Starting Swagger
2019-09-05 18:07:13.944 DEBUG 4831 --- [  restartedMain] i.g.j.c.apidoc.SwaggerAutoConfiguration  : Started Swagger in 10 ms
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/mustapha/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.KQueueSelectorProvider()
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:88)
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:71)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:310)
    at org.xnio.nio.NioXnio.<init>(NioXnio.java:70)
    at org.xnio.nio.NioXnioProvider.<clinit>(NioXnioProvider.java:30)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:781)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:723)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1395)
    at org.xnio.Xnio.doGetInstance(Xnio.java:248)
    at org.xnio.Xnio.getInstance(Xnio.java:187)
    at io.undertow.Undertow.start(Undertow.java:118)
    at org.springframework.boot.web.embedded.undertow.UndertowServletWebServer.start(UndertowServletWebServer.java:142)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
    at com.jhipster.Jhipster.main(Jhipster.java:63)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$ConstructorSelectorCreator (file:/Users/mustapha/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.PollSelectorImpl(java.nio.channels.spi.SelectorProvider)
    at org.xnio.nio.NioXnio$ConstructorSelectorCreator.<init>(NioXnio.java:264)
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:170)
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:71)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:310)
    at org.xnio.nio.NioXnio.<init>(NioXnio.java:70)
    at org.xnio.nio.NioXnioProvider.<clinit>(NioXnioProvider.java:30)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:781)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:723)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1395)
    at org.xnio.Xnio.doGetInstance(Xnio.java:248)
    at org.xnio.Xnio.getInstance(Xnio.java:187)
    at io.undertow.Undertow.start(Undertow.java:118)
    at org.springframework.boot.web.embedded.undertow.UndertowServletWebServer.start(UndertowServletWebServer.java:142)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
    at com.jhipster.JhipsterApp.main(JhipsterApp.java:63)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)

Here is the warning when I generate new project without Websocket:

WARNING: Illegal reflective access by org.xnio.nio.NioXnio$2 (file:/Users/mustapha/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.KQueueSelectorProvider()
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:88)
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:71)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:310)
    at org.xnio.nio.NioXnio.<init>(NioXnio.java:70)
    at org.xnio.nio.NioXnioProvider.<clinit>(NioXnioProvider.java:30)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:781)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:723)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1395)
    at org.xnio.Xnio.doGetInstance(Xnio.java:248)
    at org.xnio.Xnio.getInstance(Xnio.java:187)
    at io.undertow.Undertow.start(Undertow.java:118)
    at org.springframework.boot.web.embedded.undertow.UndertowServletWebServer.start(UndertowServletWebServer.java:142)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
    at com.jhipster.JhipsterApp.main(JhipsterApp.java:63)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
WARNING: Illegal reflective access by org.xnio.nio.NioXnio$ConstructorSelectorCreator (file:/Users/mustapha/.m2/repository/org/jboss/xnio/xnio-nio/3.3.8.Final/xnio-nio-3.3.8.Final.jar) to constructor sun.nio.ch.PollSelectorImpl(java.nio.channels.spi.SelectorProvider)
    at org.xnio.nio.NioXnio$ConstructorSelectorCreator.<init>(NioXnio.java:264)
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:170)
    at org.xnio.nio.NioXnio$2.run(NioXnio.java:71)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:310)
    at org.xnio.nio.NioXnio.<init>(NioXnio.java:70)
    at org.xnio.nio.NioXnioProvider.<clinit>(NioXnioProvider.java:30)
    at java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:781)
    at java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:723)
    at java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1395)
    at org.xnio.Xnio.doGetInstance(Xnio.java:248)
    at org.xnio.Xnio.getInstance(Xnio.java:187)
    at io.undertow.Undertow.start(Undertow.java:118)
    at org.springframework.boot.web.embedded.undertow.UndertowServletWebServer.start(UndertowServletWebServer.java:142)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:297)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:163)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
    at com.jhipster.JhipsterApp.main(JhipsterApp.java:63)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
2019-09-05 18:43:00.892  INFO 5800 --- [  restartedMain] com.jhipster.JhipsterApp                 : Started JhipsterApp in 19.338 seconds (JVM running for 19.858)

@maznag : For your first stack trace; WARNING: Illegal reflective access by org.springframework.cglib.core.ReflectUtils... there's a discussion in the spring-framework repo; seems it's still open and under review;

https://github.com/spring-projects/spring-framework/issues/22814

All the stack traces afterwards corresponds to our previous discussion above; https://github.com/jhipster/generator-jhipster/issues/10271#issuecomment-524613951

@pascalgrimaud @PierreBesson : Correct me if I am wrong, but from my investigation there's nothing to do in our end for these reflective access errors. So maybe we can close this issue for now. 😄

@SudharakaP thanks for these informations.

right, let's wait and close this for now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pascalgrimaud picture pascalgrimaud  ·  4Comments

Steven-Garcia picture Steven-Garcia  ·  3Comments

lsadehaan picture lsadehaan  ·  3Comments

ahmedeldeeb25 picture ahmedeldeeb25  ·  3Comments

pascalgrimaud picture pascalgrimaud  ·  3Comments