开发者

JFreeChart Exceptionless Forever-blocking error

I am not sure if this is a permissions problem, or an error in JFreeChart (latest version 1.0.13) with my web application that is running on Tomcat in CentOS. But I have a very odd situation where I in m开发者_Python百科y application an event fires, eventually causing the below method to be executed with the supplied parameters.

I've checked the documentation and it appears that these static methods don't throw exceptions, so I can only assume they return null series or similar if they cannot execute properly. However, in my case, I will execute the use case that causes this code to be run, and as I'm looking at the Tomcat log catalina.out, I can see the line "===================5" appear, but "===================6" never does. And that's where I am stumped. And clearly since "chart" never get's made, the image file can never be generated, leaving an ugly error on my webpage.

Can anyone shed some light on why ChartFactory.createTimeSeriesChart seems to hang? Wouldn't bad input cause the method to return a null series or something, certainly this very mature product wouldn't just sit there and block forever right?

The other detail is that this worked in the GWT servlet container, and also another Tomcat servlet container on Windows...which kind of makes me think there could be some permissions issue. Except that for my last test I made everything root...

Finally, perhaps I missed something huge and JFree methods do throw exceptions? Perhaps my catch block errors out and the message never goes to my error logs?

EDIT: The class files in my .war were compiled the Windows machine that they function correctly on. bytecode is bytecode, right? Or is there some potential problem?

EDIT 2: The project is headless and configured as such.

Code:

public LineChart(final String title, List<GraphData> graphxy[],
             String url, String sensorName[], String unit[], float critHigh,
             float critLow, Double percent, String historic, String clickZoomIn,
             String BaseUrl,Date[][] dateDifference)
    throws IOException
{
    try {
        ...
        System.out.println("===================5");
        //All the parameters are built defined in excised code:
            final JFreeChart chart = ChartFactory.createTimeSeriesChart(ShowsensorName, "Date", readUnit, dataset, true, true, false);  
        System.out.println("===================6");
        ...
    }
    catch (Exception e)
    {
        System.out.println("Exception  in  line chart demo is========="+e);
    }
}


Here's a few things to try:

  1. If headless, verify correct setup.

  2. Try related demos on the affected server.

  3. Try evoking your chart as an application, e.g. TimeSeriesChartDemo1.

  4. Walk through the source by clicking the createTimeSeriesChart() link.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜