2002 JI Open Discussion Posted August 18, 2006 Share Posted August 18, 2006 By: Marco - marco_010177 Error on X need to restart web application 2003-08-29 05:45 Hello, I wrote a servlet to display a PDF report to web users fetching data from a database. The application works fine but there is a strange problem with X server. If the first call of the servlet have a problem with X server (like forgot to launch the X server...), this cause an (obvious) exception like this: [Exception stack trace] java.lang.InternalError: Can't connect to X11 window server using ':1.0' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:77) at java.lang.Class.forName1(Native Method) at java.lang.Class.forName(Class.java(Compiled Code)) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:72) at dori.jasper.engine.fill.JRBaseFiller.<clinit>(JRBaseFiller.java:210) at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:150) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:350) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:290) at dori.jasper.engine.JasperRunManager.runReportToPdfFile(JasperRunManager.java:245) at miaapp.report.ReportManager.createPdf(ReportManager.java:33) at miaapp.servlet.PrintReportServlet.createReport(PrintReportServlet.java:305) at miaapp.servlet.PrintReportServlet.doService(PrintReportServlet.java:144) at miaapp.servlet.MIAServlet.doGet(MIAServlet.java:385) But, now, if I start the X server the servlet still cannot create the report and throw this exception: [Exception stack trace] java.lang.NoClassDefFoundError: dori/jasper/engine/fill/JRVerticalFiller at dori.jasper.engine.fill.JRFiller.fillReport(JRFiller.java:150) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:350) at dori.jasper.engine.JasperFillManager.fillReport(JasperFillManager.java:290) at dori.jasper.engine.JasperRunManager.runReportToPdfFile(JasperRunManager.java:245) at miaapp.report.ReportManager.createPdf(ReportManager.java:33) at miaapp.servlet.PrintReportServlet.createReport(PrintReportServlet.java:305) at miaapp.servlet.PrintReportServlet.doService(PrintReportServlet.java:144) at miaapp.servlet.MIAServlet.doGet(MIAServlet.java:385) The only way to resolve the problem is to restart the Web Application on Websphere (without restart X). I have used JasperReports ver. 0.4.5 (I also tried with 0.5.0 without difference). The application server is Websphere App Server rel 5.0.2, with JVM 1.3.1 (exactly "J2RE 1.3.1 IBM"). I tried with two X servers: Xvnc (on Linux) and Xvfb, the problem and the exception are the same. Operating system is IBM AIX but I've tried on Linux (RedHat 7.3) whith the same result. I don't know if this is a bug but appear that JasperReport "remember" the bad startup with X, are there any way to reset this "memory" ? I need a way to avoid to restart the entire web application. Thank you. By: lihongbing - hongbingli RE: Error on X need to restart web application 2003-09-02 01:43 Hi we have same problem with linux/tomcat,but it's not the poblem of jasper ,it's webserver who remember the bad things. I delete the work directory of the web server. this may help for you. By: Marco - marco_010177 RE: Error on X need to restart web application 2003-09-03 00:56 Thank you for your suggestions but I don't understand why the problem is on the web server, I think the problem is on application server (Tomcat for you), the web server has only a cache (I don't think that web server has any kind of "logic"). But the major question is: what is the "work directory" ? The PDF is composed in memory, without any files (except for report template and eventually temporary files). Thank you By: lihongbing - hongbingli RE: Error on X need to restart web application 2003-09-03 04:55 your are right. not the websever but application server remember the bad thing.for tomcat ther is a directoty named work ,it's tomcat's work directory to record some inner runtime information . in jasper source code ,i find error souce in jrbasefill.java static { //FIXME use this in some kind of a isFontAvailable method String envfonts[] = GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(); } so may when application sever encounter a java inner error ,record it and no longer load this class. you also can try to update this file,add a try-catch. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now