harryk
07/20/2023, 3:13 PM// create java objects to read bundle
var oI18N = CreateObject("java", "java.util.PropertyResourceBundle");
var oFis = CreateObject("java", "java.io.FileInputStream");
sResourceFilePath = arguments.sBundlePath & arguments.sBundle & "_" & variables.sLang & ".properties";
if (fileExists(sResourceFilePath)) {
bIsOk=true;
oFis.init(sResourceFilePath);
oI18N.init(oFis);
*** keys=oI18N.getKeys();
...
}
Error: java.lang.reflect.InaccessibleObjectException: Unable to make public sun.util.ResourceBundleEnumeration(java.util.Set,java.util.Enumeration) accessible: module java.base does not "exports sun.util" to unnamed module @62b6c045
I checked also @bdw429s https://www.forgebox.io/view/propertyFile which has another issue:
Object Instantiation Exception.
Class not found: org.apache.commons.io.input.BOMInputStream The error occurred in D/projekte cf/PropertyFile.cfc line 28
Called from D/projekte cf/test propertyfile.cfm line 2
Called from D/projekte cf/PropertyFile.cfc line 28
Called from D/projekte cf/test propertyfile.cfm line 2
26 : setPath( arguments.path );
27 : var fis = CreateObject( 'java', 'java.io.FileInputStream' ).init( path );
28 : var BOMfis = CreateObject( 'java', 'org.apache.commons.io.input.BOMInputStream' ).init( fis );
29 : var propertyFile = getJavaPropertyFile();
30 : propertyFile.load( BOMfis );
An ugly alternative would be to use ColdFusion, see
https://cflib.org/udf/readPropertiesFile
But I guess there must be a better way to load properties files with Adobe ColdFusion 2023 and Java 17?bdw429s
07/20/2023, 3:15 PMbdw429s
07/20/2023, 3:16 PMharryk
07/20/2023, 3:37 PMseancorfield
bdw429s
07/20/2023, 4:10 PMbdw429s
07/20/2023, 4:10 PMbdw429s
07/20/2023, 4:11 PMbdw429s
07/20/2023, 4:13 PM--add-exports java.base/sun.util=ALL-UNNAMED
as a JVM argbdw429s
07/20/2023, 4:15 PMbdw429s
07/20/2023, 4:16 PMbdw429s
07/20/2023, 4:17 PMJim Priest
07/20/2023, 5:02 PM