Hi, when importing a dxl file I get this error:"DXLImporter input object is invalid, uninitialized, or not explicitly declared and strongly typed. "
Anyone can help, please?
Thanks in advance.
Here a portion of my java code:
…
Stream stream = s.createStream();
stream.open(fDXL)
importer = s.createDxlImporter();
importer.importDxl(stream, db);
…
And here the fDXL file content:
<?xml version="1.0" encoding="UTF-8"?>
US
…
Subject: DXLImporter input object is invalid, uninitialized, or …
There is (was?) a glitch in the DXLImporter in the Java API that only allows you to create one instance of the DXLImporter per session.
Instead of creating multiple instances of the DxlImporter, you should create only one instance, and reuse that for all imports. This can be easily accomplished using a singleton pattern.
cheers,
Bram
Subject: RE: DXLImporter input object is invalid, uninitialized, or …
Hi Bram,not sure what you mean, as I execute an agent each time I receive a XML file, I instanciate the importer object at the beginning then the XML data it’s transformed with a XSL and finally the import is processed and the agent finished.
Could you, please, give me more details about your suggestion?
And thanks a lot for your input.
Sofia.
Subject: RE: DXLImporter input object is invalid, uninitialized, or …
“importer” is not declared/typed in the snippet you posted. Should it not have been:
DxlImporter importer = s.createDxlImporter();
Subject: RE: DXLImporter input object is invalid, uninitialized, or …
Stan,I defined the importer object at the beginning just to get the importer.getLog() in case of errors.
…
DxlImporter importer = null;
try {
…
importer = s.createDxlImporter();
…
} catch {
… importer.getLog();
}