Here's what was answered in the JFreeChart forum. I'm includind the full
text. In any case I intend to do a minimal TextLayout implementation for
some bidi support without the awt toolkit and for the C# and J# ports.

************************************************************************
Offscreen Imaging 
----------------- 

Keywords: X11, DISPLAY, BufferedImage 

JFreeChart was designed to draw into an arbitrary Java 2D graphics device.
In this way, a java servlet can render a chart into an offscreen image for
subsequent display in a browser. See, for example: 

com.jrefinery.chart.JFreeChart.createBufferedImage() 

This method hinges on the construction of a java.awt.image.BufferedImage.
Sadly, the constructor fails under JRE 1.3.x in he absence of a window
environment from which to obtain various device properties. Typically, you
get an InternalError exception: 

java.lang.InternalError: Can't connect to X11 window server using ':0.0' 
as the value of the DISPLAY variable. 

Several workarounds are known: 

1) X Virtual Frame Buffer (Xvfb) 
2) Pure Java AWT (PJA) 
3) Virtual Network Computing (VNC) 

On WinNT and Win2K with JRE 1.3.1, logging onto the console instantiates the
window system and the BufferedImage creation succeeds. You must be logged is
as the same user that instantiates the servlet container. Installing VNC and
running tomcat as a service allows normal operation even when logged out. 

On Mac OS X 10.1.4, the OS creates an anonymous instance of the JRE. This
fails if the machine enters "sleep" mode, but it works during normal
screen-saver operation. I haven't tried VNC in this environemnt. 

Under Solaris 2.7 with JRE 1.2.2, VNC allows correct operation as long as
the same user starts both tomcat and VNC. 

Under RedHat linux 7.1, JRE 1.3.1 and tomcat 4.0.3, vnc-server-3.3.3r2-28
allows correct operation as long as the same user starts both tomcat and
VNC. Edit the file /etc/tomcat4/conf/tomcat4.conf to set the DISPLAY
variable to the same virtual X session created in /etc/sysconfig/vncservers.
You may need to start VNC before starting tomcat. 

Under JRE 1.4, setting the "headless" property to true allows JFreeChart to
render in the absence of an X11 instance. Ray Mercer reports success on
RedHat Linux 7.1, 7.1j & 7.2. I have verified correct operation on Solaris
2.7.20: 

System.setProperty("java.awt.headless","true"); 

For servlets, you can use set the property in the command line that invokes
the servlet container: 

java -Djava.awt.headless=true ... 

In tomcat 4, the catalina.sh script can use an environment setting: 

setenv CATALINA_OPTS -Djava.awt.headless=true 

Comments, corrections and additions are welcome. 

John 
---- 
John B. Matthews 
[EMAIL PROTECTED]

************************************************************************

Best Regards,
Paulo Soares

> -----Original Message-----
> From: Zaher Afra [SMTP:[EMAIL PROTECTED]
> Sent: Monday, July 07, 2003 8:52
> To:   [EMAIL PROTECTED]
> Subject:      Hello Paul
> 
> hi , i have a jsp page that works fine on tomcat and actually gives
> perfect results, but i am shocked to know that when i moved it to unix
> system and tried to run it through broad vision server it gave 
> can't connect to X11 server, u told me to install an X server but after
> asking the admini in the company he said we can't change anything in the
> enviroment which means we can't install anything else, so is there any
> other way???
> sometimes i get this X11 server problem and sometimes i get the below
> error, although the iText library is in the unix class path and it was
> working fine until i used this column text thingy, the error is
> java.lang.NoClassDefFoundError
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:120)
>       at
> java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironme
> nt.java:58)
>       at java.awt.Font.initializeFont(Font.java:264)
>       at java.awt.Font.(Font.java:348)
>       at java.awt.Font.getFont(Font.java:365)
>       at java.awt.font.TextLayout.singleFont(TextLayout.java:409)
>       at java.awt.font.TextLayout.(TextLayout.java:382)
>       at com.lowagie.text.pdf.BidiLine.getParagraph(Unknown Source)
>       at com.lowagie.text.pdf.BidiLine.processLine(Unknown Source)
>       at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
>       at com.lowagie.text.pdf.ColumnText.go(Unknown Source)
>       at
> n_00025wmtc.testing._0002fnewmtc_0002ftesting_0002fpdf_00035_0002ejsppdf5_
> jsp_34._jspService(_0002fnewmtc_0002ftesting_0002fpdf_00035_0002ejsppdf5_j
> sp_34.java:98)
>       at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.
> java:174)
>       at
> org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:268)
>       at org.apache.jasper.runtime.JspServlet.service(JspServlet.java:381)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> com.broadvision.servlet.ServletContainer.service(ServletContainer.java:404
> )
>       at
> com.broadvision.servlet.ServletContainer.processRequest(ServletContainer.j
> ava:348)
>       at
> com.broadvision.servlet.ServletContextContainer.processRequest(ServletCont
> extContainer.java:660)
>       at
> com.broadvision.servlet.BVServletEngine.service(BVServletEngine.java:202)
>       at
> com.broadvision.servlet.BVServletConnector.service(BVServletConnector.java
> :139)
> 
> ANY IDEAS???????????????????


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01
_______________________________________________
iText-questions mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to