User 715e498bfb
31-05-2010 07:06:25
Hi, All
Today my customer to edit a compound and to save it, but it throws a exception as following:
chemaxon.formats.MolFormatException: Cannot recognize format (base64 or chime?)
Unrecognized file contents:
null
at chemaxon.formats.recognizer.RecognitionSubsystem.getFormat(RecognitionSubsystem.java:203)
at chemaxon.formats.MolInputStream.initTextFormat(MolInputStream.java:235)
at chemaxon.formats.MolInputStream.init(MolInputStream.java:134)
at chemaxon.formats.MolInputStream.<init>(MolInputStream.java:116)
at chemaxon.formats.MolInputStream.<init>(MolInputStream.java:58)
at chemaxon.util.MolHandler.importMol(MolHandler.java:652)
at chemaxon.util.MolHandler.setMolecule(MolHandler.java:176)
at chemaxon.util.MolHandler.<init>(MolHandler.java:125)
at chemaxon.jchem.db.UpdateHandler.readMolecule(UpdateHandler.java:1318)
at chemaxon.jchem.db.UpdateHandler.init(UpdateHandler.java:1107)
at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:2200)
please see attachments.
save function as:
Connection conn = this.getConnection();
String structureTableName = Constants.STRUCTURE_TABLE_NAME;
ConnectionHandler ch = new ConnectionHandler();
UpdateHandler uh = null;
try {
ch.setConnection(conn);
uh = new UpdateHandler(ch, isInsert ? UpdateHandler.INSERT : UpdateHandler.UPDATE,structureTableName, "");
uh.setDuplicateFiltering(true);
uh.setStructure(molfile);
uh.setEmptyStructuresAllowed(true);
uh.setDuplicateFiltering(false);
if (!isInsert) { uh.setID(cdId); }
return uh.execute(true);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
uh.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Any suggestions? thanks in advance.