Re: Graph APIs does not work on Linux Server.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Robert,

     Thank you very much for the information.

     Just want to dig more. I am using Java 6.0 & Tomcat 5.
     - For JChart: How I can give access to display (X Server) to Tomcat server.
     - REgd JFreeChart: In which file in need to add -Djava.awt.headless=true ? I already did that in tomcat5.conf. And also I setup the same in the code before calling the JFreeChart API (System.properties("java.awt.headless","true"))
   

  Appreciate your help !!!!


Thanks again,
David





On Sun, Sep 13, 2009 at 11:03 PM, Robert Marcano <robert@xxxxxxxxxxxxxxxxx> wrote:
On 09/14/2009 01:10 AM, sj david wrote:
Hi Fedora,

Hello David
...

     I Setup the Eclipse IDE & Tomcat server on Fedora 9. I am facing
following problems while enabling graphical APIs on the application:
*1*. I have a running java application with JCharts on Windows which
works fine with Eclipse & Tomcat server. But when I am  trying to deploy
the same on Fedora 9. JCharts are not able to render & I am getting the
following error:
    : "/*Gtk Warning: cannot open display*/".

First, it is time to move from Fedora 9, it is not supported anymore :-)

Now the problem could be that the Tomcat server is running under a user with no access to the display and that is the correct way to install it. JFreeChart uses a lot Java2D, that until Java 1.4 required to have access to a display (in Linux a X Server), but Sun introduced a in 1.4 the System property java.awt.headless that make it possible to use Java2D and many other graphic related classes/methods.

You need to add the argument -Djava.awt.headless=true to the script that start Tomcat, when calling the java executable

If I disable the call to JCharts APIs, My application works fine. Can
you please help me here.

*2*. To overcome this issue, I move to another Chart API: JFreeCharts. I
added the jar in the classpath & also added its java files in the
project, but whenever I am running my application from Eclipse with
Tomcat, Tomcat is not able to  load this JFreeChart class files, saying :

*java.lang.NoClassDefFoundError*

. Please help me here.


Thanks
David.


------------------------------------------------------------------------

--
fedora-devel-java-list mailing list
fedora-devel-java-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

--
fedora-devel-java-list mailing list
fedora-devel-java-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

--
fedora-devel-java-list mailing list
fedora-devel-java-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-java-list

[Index of Archives]     [Red Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux