JChem Molecule serialization appears to lose properties

User c0e481a82c

24-08-2005 09:12:09

Hi,





I've been using the JChem 2.3.2 libraries in writing an application. At some point, I have a Javabean which returns a Molecule object to my client. However, the Molecule the client receives has properties which I can no longer access. That is, if I look at the Molecule object when debuging, I can see the properties, but the getProperty(String) method returns null, even though getPropertyKey(int) returns the correct property value.





I've narrowed this down to the serialization of the Molecule object, as I have written a test class where the Molecule is written to a file, then read back in, and I see the same behaviour. The source file for this class is attached. Could someone take a look at this and check if this is correct or not?





Regards,





Phil.

ChemAxon a3d59b832c

24-08-2005 09:55:12

Hi Phil,





I just tried your code with JChem 3.1 and it seems to be correct. This is the output I got:
Quote:
Structure is: c1ccccc1


MOLNAME = Benzene


MOL_WEIGHT = 78.113
I recommend to upgrade or to use the mrv format instead of serialization.





Best regards,


Szabolcs