igjyoti Posted October 25, 2006 Share Posted October 25, 2006 I tested Jasper code on my machine and it is working well. Whereas on Unix server when I try to run during call to fillReporttoFile method I am getting java.lang.NoClassDefFoundError: sun/awt/X11GraphicsEnvironment.. Also please suggest can I use any alternative method to fill the reports which does not make call to awt package.Please help me ASAP what I should do? Link to comment Share on other sites More sharing options...
rsilverns.sympatico.ca Posted October 26, 2006 Share Posted October 26, 2006 I have encountered that same problem. It is related to a bug in the underlying java graphics environment with how the graphics objects are being created to render report portions on unix/linux. To counteract this error, use -Djava.awt.headless=true, which resolves the issue. What the -Djava.awt.headless flag does is instructs the JVM to ignore any exceptions thrown that have to do with not having a GUI when initializing the GraphicsContext. Link to comment Share on other sites More sharing options...
riftware Posted October 26, 2006 Share Posted October 26, 2006 You need to supply a java environment variable when running headless or with an unset Display variable:Code:"-Djava.awt.headless=true" Link to comment Share on other sites More sharing options...
mathewrond Posted October 26, 2006 Share Posted October 26, 2006 I too encountered this problem and I have solved it by adding Code:System.setProperty("java.awt.headless", "true"«»); in my java code. Link to comment Share on other sites More sharing options...
wildhuman Posted December 7, 2006 Share Posted December 7, 2006 I added same codes in my catalina.out, but there are new problems, just like that:exception javax.servlet.ServletException org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758) org.apache.jsp.reportJasper_jsp._jspService(reportJasper_jsp.java:589) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.it45.hhds.AuthorizationFilter.doFilter(AuthorizationFilter.java:133) root cause java.lang.NoClassDefFoundError net.sf.jasperreports.engine.xml.JRBoxFactory.setBoxAttributes(JRBoxFactory.java:102) net.sf.jasperreports.engine.xml.JRBoxFactory.createObject(JRBoxFactory.java:71) org.apache.commons.digester.FactoryCreateRule.begin(FactoryCreateRule.java:389) org.apache.commons.digester.Digester.startElement(Digester.java:1361) org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source) org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown Source) org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) org.apache.xerces.parsers.XMLParser.parse(Unknown Source) org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) org.apache.commons.digester.Digester.parse(Digester.java:1647) net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:238) net.sf.jasperreports.engine.xml.JRXmlLoader.loadXML(JRXmlLoader.java:225) net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:213) net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:167) net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:151) net.sf.jasperreports.engine.JasperManager.loadXmlDesign(JasperManager.java:971) org.apache.jsp.reportJasper_jsp._jspService(reportJasper_jsp.java:244) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) com.it45.hhds.AuthorizationFilter.doFilter(AuthorizationFilter.java:133) Link to comment Share on other sites More sharing options...
asd123 Posted December 7, 2006 Share Posted December 7, 2006 Hi Teodor, I had faced the same issues earlier and I remember we had resolved that by installing xorg-x11-Xvfb-6.8.1-23.EL.i386.rpm . I recently installed Linux on a different machine just to re simulate the error but to my surprise all my reports came out well. without the common error message cant connect to xll window. The version of Linux available to me is Red Hat Enterprise Linux version 3.0 and kernel 2.4 As this issue been fixed with the newer version of jasperreports i.e. beyond version jasperreports-1.2.7 thanks & regards, Santosh 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