User c1f77e1011
14-12-2006 14:44:24
Hi,
we're using SuSe Linux Enterprise Server v9.3 with Java RE v1.5.0_05b and MarvinBeans v4.14. Our servlet converts mol files to other image formats and is runing on OC4J 10g (v10.1.3). There is no problem converting from mol to jpg, bmp, png, svg or ppm on Linux server as well as on my Windows XP workstation. Only if I want to use the emf- or pdf-export function from MarvinBeans, which uses the VectorGraphics package of FreeHEP Java Library, it works under Windows XP but our Linux server is sending me the following exception:
Exception in web browser:
Exception in server console:
The Java VM on the Linux server is running in headless mode using the "-Djava.awt.headless=true" parameter. So I changed the parameter to "-Djava.awt.headless=false" and it worked on my Windows XP workstation but not on our Linux server because it has no X-Server. This exception is thrown when a mol file is converted to emf or pdf. The other image exports are not available at this time. I know the solution with Xvfb-Server but we can't run this product in our certified production environment.
The next step was PJA. The Pure Java AWT Toolkit is a Java library for drawing graphics developed by eTeks (http://www.eteks.com/pja/en/). It is 100% Pure Java and doesn't use any native graphics resource of the system on which the Java Virtual Machine runs. But there might be an incompatibility with Java v1.5.x:
Exception in web browser:
I has found another solution directly from FreeHep (http://forum.freehep.org/index.php?t=msg&goto=677&rid=0&S=620411d4c43ea67ede90ad80c77b9ef8&srch=headless)
but I use the MarvinBean interface to convert image formats.
I use this code to convert a mol file to emf:
Is there a mistake using the "toBinFormat" method or have you other ideas which would solve this problem?
Thanks
Tobias
P.S.: The application has to go live within 2006 :)
we're using SuSe Linux Enterprise Server v9.3 with Java RE v1.5.0_05b and MarvinBeans v4.14. Our servlet converts mol files to other image formats and is runing on OC4J 10g (v10.1.3). There is no problem converting from mol to jpg, bmp, png, svg or ppm on Linux server as well as on my Windows XP workstation. Only if I want to use the emf- or pdf-export function from MarvinBeans, which uses the VectorGraphics package of FreeHEP Java Library, it works under Windows XP but our Linux server is sending me the following exception:
Exception in web browser:
Quote: |
500 Internal Server Error java.lang.NullPointerException at chemaxon.marvin.modules.ImageExport.paint(Unknown Source) at chemaxon.marvin.modules.VectGraphicsExport.convert(Unknown Source) at chemaxon.struc.Molecule.exportToObject(Unknown Source) at chemaxon.struc.Molecule.exportToObject(Unknown Source) at chemaxon.struc.Molecule.exportToBinFormat(Unknown Source) at chemaxon.struc.Molecule.toBinFormat(Unknown Source) [...] |
Quote: |
java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at chemaxon.marvin.modules.VectGraphicsExport.createGraphics(Unknown Source) at chemaxon.marvin.modules.VectGraphicsExport.callback(Unknown Source) at chemaxon.marvin.common.swing.ExportGraphics.getGraphics2D(Unknown Source) at chemaxon.marvin.modules.VectGraphicsExport.convert(Unknown Source) at chemaxon.struc.Molecule.exportToObject(Unknown Source) at chemaxon.struc.Molecule.exportToObject(Unknown Source) at chemaxon.struc.Molecule.exportToBinFormat(Unknown Source) at chemaxon.struc.Molecule.toBinFormat(Unknown Source) [...] Caused by: java.awt.HeadlessException at sun.awt.HeadlessToolkit.getScreenSize(Unknown Source) at org.freehep.graphicsio.emf.EMFGraphics2D.writeHeader(EMFGraphics2D.java:162) at org.freehep.graphicsio.AbstractVectorGraphicsIO.startExport(AbstractVectorGraphicsIO.java:186) ... 29 more Error in the initalization of EMFGraphics2D:null |
The next step was PJA. The Pure Java AWT Toolkit is a Java library for drawing graphics developed by eTeks (http://www.eteks.com/pja/en/). It is 100% Pure Java and doesn't use any native graphics resource of the system on which the Java Virtual Machine runs. But there might be an incompatibility with Java v1.5.x:
Exception in web browser:
Quote: |
500 Internal Server Error java.lang.AbstractMethodError: sun.java2d.SunGraphicsEnvironment.createFontConfiguration()Lsun/awt/FontConfiguration; at sun.java2d.SunGraphicsEnvironment$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at sun.java2d.SunGraphicsEnvironment.<init>(Unknown Source) at com.eteks.java2d.PJAGraphicsEnvironment.<init>(PJAGraphicsEnvironment.java:66) at com.eteks.java2d.PJABufferedImage.createGraphics(PJABufferedImage.java:112) at java.awt.image.BufferedImage.getGraphics(Unknown Source) at com.eteks.java2d.PJAGraphicsManager2D.getFontMetrics(PJAGraphicsManager2D.java:86) at com.eteks.awt.PJAToolkit.getFontMetrics(PJAToolkit.java:551) at sun.awt.HeadlessToolkit.getFontMetrics(Unknown Source) at chemaxon.marvin.util.MolPainter.calcBounds(Unknown Source) at chemaxon.marvin.util.MolPainter.setBoundsFor(Unknown Source) at chemaxon.marvin.util.MolPainter.setBoundsFor(Unknown Source) at chemaxon.marvin.modules.ImageExport.initPainter(Unknown Source) at chemaxon.marvin.modules.VectGraphicsExport.convert(Unknown Source) at chemaxon.struc.Molecule.exportToObject(Unknown Source) at chemaxon.struc.Molecule.exportToObject(Unknown Source) at chemaxon.struc.Molecule.exportToBinFormat(Unknown Source) at chemaxon.struc.Molecule.toBinFormat(Unknown Source) [...] |
but I use the MarvinBean interface to convert image formats.
I use this code to convert a mol file to emf:
Code: |
mol.toBinFormat("emf:w200h100"); |
Is there a mistake using the "toBinFormat" method or have you other ideas which would solve this problem?
Thanks
Tobias
P.S.: The application has to go live within 2006 :)