RPKapgate Report post Posted March 4, 2011 Hi, I am fusion chart for displaying the using javascript.. I am facing problem while exporting to image in JPG format on linux server. It working fine on windows server for both i.e. for jpg and pdf export format but on linux server export to pdf working fine but export to jpg giving error as follows "width=0height=0 DOMId=11-chartgraphDiv statusMessage= Unable to encode buffered image. statusCode=0" Share this post Link to post Share on other sites
RPKapgate Report post Posted March 11, 2011 I am getting the following error java.lang.Throwable at com.fusioncharts.exporter.encoders.BasicEncoder.encode(BasicEncoder.java:75) at org.apache.jsp.graph.ExportHandlers.JSP.Resources.FCExporter_005fIMG_jsp._jspService(FCExporter_005fIMG_jsp.java:228) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302) at org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:706) at org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:677) at org.apache.jsp.graph.ExportHandlers.JSP.FCExporter_jsp._jspService(FCExporter_jsp.java:280) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107) at org.acegisecurity.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:72) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:166) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249) at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275) at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149) at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 14, 2011 For further investigation, can you please try if export to PNG format is working? Let me know the results. Thanks Srividya Share this post Link to post Share on other sites
srividya_sharma Report post Posted March 14, 2011 Please note the following findings: In Unix/Linux/Solaris, there might be a problem while using java Graphics package. ( as in the case of FusionCharts server-side exporter ) So when using FusionCharts for JSP export handler, you might run into the following exceptions: SYMPTOMS EXTERNALINTERFACE: Could not initialize class sun.awt.X11GraphicsEnvironment java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java: ) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment . ) java.awt.image.BufferedImage.createGraphics(BufferedImage.java: ) OR java.lang.NoClassDefFoundError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java ) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment .java ) at java.awt.image.BufferedImage.createGraphics(BufferedImage.java ) OR java.lang.InternalError: Can't connect to X11 window server using ... ---- CAUSE Most versions of the Java.AWT library on Unix/Linux/Solaris require a functioning X server. The X server and the DISPLAY environment variable are not correctly set. X server is not installed in the machine. SOLUTION The best solution is to run Java in headless mode. This can be done by adding -Djava.awt.headless=true to server options. ( >= jdk 1.4.2 ) The other solutions involve installing a library like PJA library or a X server emulator. Reference: http://www.idautomation.com/kb/xwindow-error.html Share this post Link to post Share on other sites