harryk
07/20/2023, 10:52 AM// 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?zackster
07/20/2023, 11:12 AMharryk
07/20/2023, 3:11 PMbdw429s
07/20/2023, 3:18 PM