ADS 8.5 dev5.9
AQArchive -- Manifest
void manifest(String manifestFile,
Map attributeMap,
Map> sectionMap)
throws Exception
specified a attributeMap instead of a sectionMap and got the java exception..
Catch the below exception in the code when a attributeMap is used in place of a sectionMap
JavaException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
importPackage(java.util);
var test_data_dir = "c:\\archive\\";
test_manifest();
// --- manifest() ---
function test_manifest() {
var attrMap = new HashMap();
attrMap.put("m-name-1", "TARIQ");
var dest_base = test_data_dir + "manifest\\";
exec_manifest(dest_base + "manifest_none.MF",attrMap , attrMap );
}
function exec_manifest(manifestFile, attrMap, sectionMap) {
try {
aqua.println("manifest: creating [" + manifestFile + "]...");
aqua.archive.manifest(manifestFile, attrMap, sectionMap);
aqua.println("manifest: done.");
} catch(ex) {
aqua.println("manifest: failed - " + ex.toString());
}
}
I think the exception is in this line --> attrMap.put("m-name-1", "TARIQ"); and not in the aqua.archive.manifest(manifestFile, attrMap, sectionMap) statement
This this script...
importPackage(java.util);
var test_data_dir = "c:\\archive\\";
test_manifest();
// --- manifest() ---
function test_manifest() {
var attrMap = new HashMap();
var sectMap = new HashMap();
attrMap.put("m-name-1", "TARIQ");
sectMap.put("s-name-1", attrMap);
var dest_base = test_data_dir + "manifest\\";
exec_manifest(dest_base + "manifest_none.MF",attrMap , sectMap );
}
function exec_manifest(manifestFile, attrMap, sectionMap) {
try {
aqua.println("manifest: creating [" + manifestFile + "]...");
aqua.archive.manifest(manifestFile, attrMap, sectionMap);
aqua.println("manifest: done.");
} catch(ex) {
aqua.println("manifest: failed - " + ex.toString());
}
}
I basically added or changed the lines that are bold. The section map parameter need to be a hashmap of a hashmap.
This this script...
importPackage(java.util);
var test_data_dir = "c:\\archive\\";
test_manifest();
// --- manifest() ---
function test_manifest() {
var attrMap = new HashMap();
var sectMap = new HashMap();
attrMap.put("m-name-1", "TARIQ");
sectMap.put("s-name-1", attrMap);
var dest_base = test_data_dir + "manifest\\";
exec_manifest(dest_base + "manifest_none.MF",attrMap , sectMap );
}
function exec_manifest(manifestFile, attrMap, sectionMap) {
try {
aqua.println("manifest: creating [" + manifestFile + "]...");
aqua.archive.manifest(manifestFile, attrMap, sectionMap);
aqua.println("manifest: done.");
} catch(ex) {
aqua.println("manifest: failed - " + ex.toString());
}
}
I basically added or changed the lines that are bold. The section map parameter need to be a hashmap of a hashmap.
Issue #3352 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
I think the exception is in this line --> attrMap.put("m-name-1", "TARIQ"); and not in the aqua.archive.manifest(manifestFile, attrMap, sectionMap) statement