MolFormatException: Cannot read molecule file

User 52a4e280f0

31-08-2012 14:29:30


Hi there,


I have been getting the following exception while I perform any search on my system using the marvin editor:


Caused by: java.lang.RuntimeException: chemaxon.formats.MolFormatException: Cannot read molecule file.


at com.wiley.fc.service.chemaxon.MoleculeFactory.create(MoleculeFactory.java:15)


at com.wiley.fc.service.chemaxon.JChemBaseChemistryService.findCsids(JChemBaseChemistryService.java:294)


... 44 more


Caused by: chemaxon.formats.MolFormatException: Cannot read molecule file.


at chemaxon.formats.MolInputStream.init(MolInputStream.java:144)


at chemaxon.formats.MolInputStream.<init>(MolInputStream.java:113)


at chemaxon.formats.MolImporter.init(MolImporter.java:569)


at chemaxon.formats.MolImporter.<init>(MolImporter.java:200)


at chemaxon.formats.MolImporter.importMol(MolImporter.java:1289)


at chemaxon.formats.MolImporter.importMol(MolImporter.java:1263)


at com.wiley.fc.service.chemaxon.MoleculeFactory.create(MoleculeFactory.java:13)


... 45 more


Caused by: chemaxon.formats.MolFormatException: Cannot recognize format (?)


Unrecognized file contents:


%3C%3Fxml+version%3D%221.0%22+%3F%3E%0A%3Ccml%3E%0A%3CMDocument%3E%0A++%3CMChemicalStruct%3E%0A++++%3Cmolecule+molID%3D%22m1%22%3E%0A++++++%3CatomArray%0A++++++++++atomID%3D%22a1+a2+a3+a4+a5+a6%22%0A++++++++++elementType%3D%22C+C+C+C+C+C%22%0A++++++++++...


at chemaxon.formats.recognizer.RecognitionSubsystem.getFormat(RecognitionSubsystem.java:219)


at chemaxon.formats.MolInputStream.initTextFormat(MolInputStream.java:312)


at chemaxon.formats.MolInputStream.init(MolInputStream.java:133)


... 51 more


 


Can you please help?


The exact replacement for ... above is:


%3C%3Fxml+version%3D%221.0%22+%3F%3E%0A%3Ccml%3E%0A%3CMDocument%3E%0A++%3CMChemicalStruct%3E%0A++++%3Cmolecule+molID%3D%22m1%22%3E%0A++++++%3CatomArray%0A++++++++++atomID%3D%22a1+a2+a3+a4+a5+a6%22%0A++++++++++elementType%3D%22C+C+C+C+C+C%22%0A++++++++++x2%3D%22-2.309999942779541+-3.6436692838277995+-3.6436692838277995+-2.309999942779541+-0.9763306017312825+-0.9763306017312825%22%0A++++++++++y2%3D%222.530033890654824+1.7600169500957836+0.2199830689777027+-0.5500338715813378+0.2199830689777027+1.7600169500957836%22%0A++++++++++%2F%3E%0A++++++%3CbondArray%3E%0A++++++++%3Cbond+atomRefs2%3D%22a1+a2%22+order%3D%221%22+%2F%3E%0A++++++++%3Cbond+atomRefs2%3D%22a1+a6%22+order%3D%222%22+%2F%3E%0A++++++++%3Cbond+atomRefs2%3D%22a2+a3%22+order%3D%222%22+%2F%3E%0A++++++++%3Cbond+atomRefs2%3D%22a3+a4%22+order%3D%221%22+%2F%3E%0A++++++++%3Cbond+atomRefs2%3D%22a4+a5%22+order%3D%222%22+%2F%3E%0A++++++++%3Cbond+atomRefs2%3D%22a5+a6%22+order%3D%221%22+%2F%3E%0A++++++%3C%2FbondArray%3E%0A++++%3C%2Fmolecule%3E%0A++%3C%2FMChemicalStruct%3E%0A%3C%2FMDocument%3E%0A%3C%2Fcml%3E%0A



 


Thanks,


Isha

ChemAxon e49cf225c6

31-08-2012 14:54:42

It seems that your file is URL encoded.


The content should be this:


<?xml version="1.0" ?>

<cml>

<MDocument>

  <MChemicalStruct>

    <molecule molID="m1">

      <atomArray

          atomID="a1 a2 a3 a4 a5 a6"

          elementType="C C C C C C"

          x2="-2.309999942779541 -3.6436692838277995 -3.6436692838277995 -2.309999942779541 -0.9763306017312825 -0.9763306017312825"

          y2="2.530033890654824 1.7600169500957836 0.2199830689777027 -0.5500338715813378 0.2199830689777027 1.7600169500957836"

          />

      <bondArray>

        <bond atomRefs2="a1 a2" order="1" />

        <bond atomRefs2="a1 a6" order="2" />

        <bond atomRefs2="a2 a3" order="2" />

        <bond atomRefs2="a3 a4" order="1" />

        <bond atomRefs2="a4 a5" order="2" />

        <bond atomRefs2="a5 a6" order="1" />

      </bondArray>

    </molecule>

  </MChemicalStruct>

</MDocument>

</cml>

This can be read with no problems.


 


How was that file created?

User 52a4e280f0

04-09-2012 10:13:09

Thanks you were right, the structure was being URLEncoded before being sent out to the Chemaxon. I have fixed this now...


 


Thanks,


Isha