NoClassDefFoundError from molToImage

User fa1369adab

14-10-2005 15:34:05

We just upgraded to jdk1.5.0 from j2sdk1.4.1_02. We are using jchem3.0.15. We are starting to see errors like this:





java.lang.NoClassDefFoundError


at java.lang.Class.forName0(Native Method)


at java.lang.Class.forName(Class.java:164)


at java.awt.Toolkit$2.run(Toolkit.java:821)


at java.security.AccessController.doPrivileged(Native Method)


at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:804)


at chemaxon.marvin.util.MolPainter.calcBounds(MolPainter.java:1539)


at chemaxon.marvin.util.MolPainter.setBoundsFor(MolPainter.java:1118)


at chemaxon.marvin.modules.ImageExport.initPainter(ImageExport.java:407)


at chemaxon.marvin.modules.ImageExport.convert(ImageExport.java:272)


at chemaxon.marvin.modules.JpegExport.convert(JpegExport.java:38)


at chemaxon.formats.MolExporter.write(MolExporter.java:178)


at chemaxon.formats.MolConverter.convert0(MolConverter.java:552)


at chemaxon.formats.MolConverter.convert(MolConverter.java:458)


at com.prenhall.epoch.chem.MolFunctions.molToImage(MolFunctions.java:61)





What do you suggest?

ChemAxon 7c2d26e5cf

14-10-2005 16:58:56

Have you got a display when you generate the image?


The image export can fail if there is not a graphical display.


See the following topic what should be done in this case:


http://www.chemaxon.com/forum/ftopic73.html


Probably, the "java.awt.headless" parameter was set in the old Java but it has not been specified yet to the new one.

User fa1369adab

14-10-2005 18:36:18

Tamas,





That makes sense. But how do I specify headless java? The code is running from Tomcat (an http server), and I have no idea how it invokes the Java virtual machine. I'll have to rummage through some code ...





There isn't a parameter I can use in the call to the MolConverter?





Raphael

ChemAxon 7c2d26e5cf

14-10-2005 19:10:39

No, it's not a MolConverter parameter. It is an option that you should set to the Java VM.


I am not an expert in Tomcat issues. JChem guys are experts in this question.


But I have found something about Java options in the JChem documentation (see the "3.2 Setting JVM options for Tomcat" section):


http://www.chemaxon.com/jchem/doc/admin/tomcat.html

User fa1369adab

14-10-2005 19:14:59

I found out how to pass the necessary paramater to tomcat.. The problem is resolved. Thanks!