Compatibility Between WildFly and JDK17

1,214 views
Skip to first unread message

Ming Qiu

unread,
Nov 2, 2022, 8:51:41 PM11/2/22
to WildFly
Hi WildFly team, 

We are running  26.1.2.Final WildFly with Open JDK17, and hit an "IllegalAccessException",

class org.jboss.as.naming.InitialContext cannot access class com.sun.jndi.ldap.LdapCtxFactory (in module java.naming) because module java.naming does not export com.sun.jndi.ldap

The above issue seemed resolved by add this "--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED" JVM argument.

We use WildFly script for launching, and according to the WildFly document - Running WildFly with SE17, we don't seem need to explicitly add the "JPMS" setting (com.sun.jndi.ldap is on the list), but when testing the LDAP feature, we did hit the issue without explicitly adding it. 

Is this a defect or? 

Also, during investigation, we noticed that, in terms of JVM argument setting, there are some difference between running on Window  and Linux. The main diff is that in Windows the "$DEFAULT_MODULAR_JVM_OPTIONS" is always loaded/set, whereas in Linux it doesn't.

Is this expected? Or what is the cause of it? 

Any help is appreciated and thanks in advance!

Regards,

Ming






Chao Wang

unread,
Nov 3, 2022, 12:18:38 AM11/3/22
to WildFly
Hi Ming,

--add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED is configured in the default modular JVM options. You can check DEFAULT_MODULAR_JVM_OPTIONS in both common.sh and common.bat.

If you explicitly pass command line argument with "--add-modules",  $DEFAULT_MODULAR_JVM_OPTIONS will be empty. You can check it in setDefaultModularJvmOptions function before the end of the common.sh/bat script.

Regards,

Chao
Reply all
Reply to author
Forward
0 new messages