paho.mqtt.java icon indicating copy to clipboard operation
paho.mqtt.java copied to clipboard

llegal reflective access by org.eclipse.paho.client.mqttv3.internal.FileLock

Open sblantipodi opened this issue 5 years ago • 13 comments

Thanks for the great project.

  • [ ] Bug exists Release Version 1.2.4 ( Master Branch)

When I connect to my mqtt broker using Java 11 I get this warning:

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.paho.client.mqttv3.internal.FileLock (file:/C:/Users/sblantipodi/.m2/repository/org/eclipse/paho/org.eclipse.paho.client.mqttv3/1.2.4/org.eclipse.paho.client.mqttv3-1.2.4.jar) to method sun.nio.ch.FileLockImpl.release()
WARNING: Please consider reporting this to the maintainers of org.eclipse.paho.client.mqttv3.internal.FileLock
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

Thank you

sblantipodi avatar Jun 24 '20 22:06 sblantipodi

Can confirm this happens on Java 11 on release version 1.2.5.

mspoehr avatar Jul 29 '20 20:07 mspoehr

Yes, now it's gone. I've temporary switched to Zulu JVM 11 on my Windows system because the the HiveMQ CE MQTT broker. But then, it installed it on a Debian 9 VirtualBox VM and changed my Windows default VM (Command %PATH%, %JAVA_HOME%) back to version 8 from Oracle. Now the messages are gone on my Windows system (where i've wrote the Client that uses paho for connecting to the HivqME CE Debian 9 Server)

Maybe the paho developers know ho to suppress that message on JVM 11 usage and can fix it. (?)

jayjupdhig avatar Aug 14 '20 08:08 jayjupdhig

@martijintro if you mean that the warnings are gone on Java 8, that is to be expected--that version of java does not print these warnings, even without supressing the messages.

mspoehr avatar Aug 14 '20 14:08 mspoehr

thank you very much!!

jayjupdhig avatar Aug 14 '20 16:08 jayjupdhig

If you need more informations, so please don't hesitate to ask for. Thanks.

With best regards, Jan

jayjupdhig avatar Aug 17 '20 09:08 jayjupdhig

Same with openjdk version "13" 2019-09-17

HorstFiedler avatar Nov 09 '20 22:11 HorstFiedler

@Paho Developers: So still unfixed? Then fix it please...

That's all i have to say.

jayjupdhig avatar Nov 10 '20 08:11 jayjupdhig

Same for me on Java 11.0.9.1 (Corretto) and Java 11.0.9 (Adopt OpenJ9) using version 1.2.5 of this package.

gaycookie avatar Jan 08 '21 00:01 gaycookie

Same for me also using JDK 11.0.9.1 and paho client 1.2.5

Panayiotou-P avatar Jan 14 '21 19:01 Panayiotou-P

Same problem here (GraalVM)

java -version
openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06)
OpenJDK 64-Bit Server VM GraalVM CE 21.0.0.2 (build 11.0.10+8-jvmci-21.0-b06, mixed mode, sharing)
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.eclipse.paho.client.mqttv3.internal.FileLock (file:/home/cam/.gradle/caches/modules-2/files-2.1/org.eclipse.paho/org.eclipse.paho.client.mqttv3/1.2.5/1546cfc794449c39ad569853843a930104fdc297/org.eclipse.paho.client.mqttv3-1.2.5.jar) to method sun.nio.ch.FileLockImpl.release()
WARNING: Please consider reporting this to the maintainers of org.eclipse.paho.client.mqttv3.internal.FileLock
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

camstuart avatar Mar 15 '21 12:03 camstuart

This seems to be a duplicate von issue #507. See my comment on this topic at #507 to circumvent this problem.

rz259 avatar Apr 07 '21 07:04 rz259

OK thx

jayjupdhig avatar Jun 30 '21 10:06 jayjupdhig

I use MemoryPersistence and this WARNING is gone

String uri = "tcp://"+ConfigSubscriberMQTT.getSubscriberMqttAddress()+":"+ConfigSubscriberMQTT.getSubscriberMqttPort();
String clientID = UUID.randomUUID().toString();
MemoryPersistence persistence = new MemoryPersistence();
this.subscriber = new MqttClient(uri, clientID, persistence);

kamshory avatar Aug 18 '21 02:08 kamshory