java.lang.IllegalArgumentException with chiral_selected

ChemAxon 587f88acea

05-10-2005 13:53:40

Hello,


I generate molecule images (jpeg) using function toBinFormat of chemaxon.struc.Molecule class. I try to add chiral_selected option for my image generation, nevertheless a java.lang.IllegalArgumentException error occurs. When this option is off, everything's OK.


Is this option not compatible with this kind of generation? Do you have a solution to this problem? I've done a few searches on internet, but I didn't find any answers...


Thanks, regards.





Eric MENDIZABAL

ChemAxon 7c2d26e5cf

05-10-2005 14:44:57

Have you tried this code?


Code:
MolImporter importer = new MolImporter(filename);


Molecule mol = importer.read();


byte[] data = mol.toBinFormat("jpeg:chiral_selected");



It works for me.


If you have got an error at running this code, please send me the molecule where you find the error.

ChemAxon 587f88acea

05-10-2005 15:30:04

Thanks for your answer.


It is slightly the code I was using, with more options for generation and using another constructor ( MolImporter(java.io.InputStream, java.lang.String) ).


I tried your code and I always have an error (java.lang.IllegalArgumentException) at running it... I'll try your code out of my servlet first and then send you the molecule if the error still occurs.


Thanks for your help, regards.





Eric

ChemAxon 7c2d26e5cf

05-10-2005 15:47:58

When you send me the molecule, please attach also the stack trace of the IllegalArgumentException.

ChemAxon 587f88acea

06-10-2005 07:32:46

I tried to generate the JPEG image associated to my .mol file in a separate class in Eclipse using the option "chiral_selected". Everything worked fine. The problem was only occuring in Visual Age, which wasn't using the good version of the API. Now, everything's OK! :)


Thanks a lot for your help.


Regards,





Eric