sketch-simple Example fails

User c30a4b265a

11-03-2010 23:26:19

Hi - I installed (just downloaded the jar-file) for the newest Marvin distribution.  The sketch example, SketchSimple.java fails.  I am just running the example with it's RUN.BAT launcher.  The error message is like I get with my own app now, which is why I care.


A capture of the stack trace from the resulting DOS window is below, the exception is thrown at startup for the little example app:


chemaxon.formats.MolFormatException: Cannot create record reader for ChemAxon Ma
rvin Documents / MRV
        at chemaxon.formats.MFileFormat.createRecordReader(Unknown Source)
        at chemaxon.formats.MFileFormatUtil.createRecordReader(Unknown Source)
        at chemaxon.formats.MFileFormatUtil.createRecordReader(Unknown Source)
        at chemaxon.marvin.io.MRecordImporter.<init>(Unknown Source)
        at chemaxon.marvin.sketch.templates.TemplateSetLocation.readMoleculeStre
am(Unknown Source)
        at chemaxon.marvin.sketch.templates.TemplateSetLocation.importTemplates(
Unknown Source)
        at chemaxon.marvin.sketch.templates.TemplateSet.getTemplates(Unknown Sou
rce)
        at chemaxon.marvin.sketch.swing.templates.TemplateHandler$TemplateImport
er.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
        at chemaxon.marvin.io.formats.XmlImport.initImport(Unknown Source)
        at chemaxon.marvin.io.formats.cml.CMLRecordReader.<init>(Unknown Source)


        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)


        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)


        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        ... 9 more


 


 


The version.properties from the distribution is:


# Version info of Marvin Beans
MARVIN_VERSION=5.3.1
MARVIN_VERSION.major=5
MARVIN_VERSION.minor=3
MARVIN_VERSION.revision=01
MARVIN_VERSION.postfix=

ChemAxon 7c2d26e5cf

12-03-2010 15:21:31

Since 5.3, Marvin Beans API has been devided into several small jars. The MarvinBeans.jar includes only core classes, you also need all jars from the lib folder (MarvinBeans-*.jar and the third party jars).


When you update, update the whole "lib" folder.

User c30a4b265a

12-03-2010 16:06:51

I was getting that error message from your example program.  It seems to have been related to my attempts to load a templates SDF file to be placed on the toolbar as described in the doc.  It worked on my own machine only.  I had been having difficulties with having that work by including it in my app distribution jar file, if I then placed that on a network drive and had people run it from the network drive - that one resource always caused an exception on loading.


So I had begun to experiment with putting it in the chemaxon subdirectory of the user's directory, that also failed, then I tried modifying the empty file marvin.mytemplates file, pasting the SD file contents into it, that also failed.  I had gotten to simply having the marvin.mytemplates file as an empty (0 bytes) file, and that failing, when I posted this request for help.


I made the error message go away by deleting that empty file from the user home\chemaxon directory, which is good as far as it goes.  I'd still like to have my own templates come up on the mol sketcher toolbar though!


 

ChemAxon 7c2d26e5cf

17-03-2010 16:57:00

We will check it.