User 764dd4e021
01-05-2012 14:49:17
Using Marvin latest version 5.9.3, my old code for SMILE conversion is giving me exception :
Code :
String aSmileString = "CC";
byte[] byteSmiles = aSmileString.getBytes();
java.io.ByteArrayInputStream theInputStream = new java.io.ByteArrayInputStream(byteSmiles);
java.io.ByteArrayOutputStream theOutputStream = new java.io.ByteArrayOutputStream();
try
{
MolConverter theConverter = new MolConverter(theInputStream, theOutputStream, "mol:-a", false);
theConverter.convert();
mol = theOutputStream.toString();
mol = mol.replace('\n','|');
}
catch(MolFormatException MFE)
{
theDto.setMolString("");
return theDto;
}
catch(Exception e)
{
System.out.println("Error in getMolFromSmiles: " + e.getMessage());
theDto.setMolString("");
return theDto;
}
Exception is ClassCastException :
chemaxon.marvin.io.formats.mdl.MolExport cannot be cast to chemaxon.marvin.io.MolExportModule.
Please share any idea on the above problem; whether it is a portability issue or coding one.
Regards.