Image generation - missing jar file???

User 6d24b35814

19-10-2009 15:23:29

I'm following the instructions for image generation as descirbed here:-


http://www.chemaxon.com/marvin/examples/beans/image-generation/index.html


I have copied jar files into almost every lib directory under my tomcat installation but I still can't get the images to display.


The error message in catalina.out is below - i don't think the IP address that is shown is the address of the machine on which I'm running tomcat - what should I do?


Kind regards


Ceara


O: bad Clean2D option
1: bad Clean2D option
java.lang.InternalError: Can't connect to X11 window server using '147.184.25.112:0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$000(X11GraphicsEnvironment.java:53)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:142)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:164)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)
        at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:96)
        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.paint.internal.MolPainter.calcBounds(MolPainter.java:3125)
        at chemaxon.marvin.paint.internal.MolPainter.setBoundsFor(MolPainter.java:2174)
        at chemaxon.marvin.paint.internal.MolPainter.setBoundsFor(MolPainter.java:2158)
        at chemaxon.marvin.io.formats.image.ImageExport.initPainter(ImageExport.java:724)
        at chemaxon.marvin.io.formats.image.ImageExport.convert(ImageExport.java:495)
        at chemaxon.marvin.io.formats.image.PngExport.convert(PngExport.java:41)
        at chemaxon.struc.Molecule.exportToObject(Molecule.java:1491)
        at chemaxon.struc.Molecule.exportToObject(Molecule.java:1456)
        at chemaxon.struc.Molecule.exportToBinFormat(Molecule.java:1372)
        at chemaxon.struc.Molecule.toBinFormat(Molecule.java:1349)
        at org.apache.jsp.marvin.generate_005fimage_jsp._jspService(generate_005fimage_jsp.java:85)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)

ChemAxon 7c2d26e5cf

19-10-2009 17:11:58

The problem is that there is no graphical interface when Java running.


Please see the linking topic.


generate image without opening a display


It describes what you have to do in this case.

User 6d24b35814

20-10-2009 07:51:59

 


Many thanks, I didn't think the link you sent really explained what to do but an internet search gave me the answer I needed.


Just set the CATALINA_OPTS environment variable to include -Djava.awt.headless=true and restart tomcat - the images display.


Kind regards


Ceara

ChemAxon 7c2d26e5cf

20-10-2009 17:27:47

Sorry, if I was not clear.


I wanted to point on that the java.awt.headless JVM parameter is the clue.


By the way, there is alternative solution (virtual X11 server) is also mentioned in that topic.


Anyway, I am glad that your problem has been solved.