java.lang.NoSuchMethodError: org.jfree.data.time.TimeTableXY

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ndawoud
Posts: 4
Joined: Tue Apr 18, 2006 9:51 pm

java.lang.NoSuchMethodError: org.jfree.data.time.TimeTableXY

Post by ndawoud » Tue Apr 18, 2006 10:03 pm

Hi,

I am new to JFreeChart and JCommon.

I have downloaded the latest version of jFreeChart, jfreechart-1.0.1.jar, and the latest version of jCommon, jcommon-1.0.3.jar; however, it seems that I am still getting an incompatibility problem during runtime.

I get the following error while running my application via tomcat and utilizing CeWolf to display the chart:

java.lang.NoSuchMethodError: org.jfree.data.time.TimeTableXYDataset.add(Lorg/jfree/data/time/RegularTimePeriod;DLjava/lang/String;)


The above error is incorrect, I have coded corretly with the appropriate number of arguments, but it seems that the runtime code has a different signature.

CAN ANYONE HELP!!!!!!!

thanks,
nasser

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Apr 19, 2006 2:14 pm

That is odd. I would check that you don't have more than one version of the JFreeChart jar files on your classpath - sometimes that can lead to error messages that make no sense.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

ndawoud
Posts: 4
Joined: Tue Apr 18, 2006 9:51 pm

java.lang.NoSuchMethodError: org.jfree.data.time.TimeTableXY

Post by ndawoud » Wed Apr 19, 2006 2:35 pm

there is only that one jar file...nothing else.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Apr 19, 2006 2:40 pm

Can you post the code that throws the exception? It may not help, but it won't hurt.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

ndawoud
Posts: 4
Joined: Tue Apr 18, 2006 9:51 pm

code

Post by ndawoud » Wed Apr 19, 2006 5:39 pm

private TimeTableXYDataset createTimeTable(TimeTableXYDataset objTimeTable,
String strName, String strScaleFactor, List objListData) throws Exception {

Iterator objItData = objListData.iterator();
while(objItData.hasNext()) {
DATA objData = (DATA)objItData.next();
Date objDate = objData.getDate();
Object objValue = objData.getValue();

if(SCALE_FACTOR_MONTHLY.equals(strScaleFactor)) {
objTimeTable.add(new Month(objDate), ((Double)objValue).doubleValue(), strName);
System.out.println("TIMETABLE_MONTHLY====>>>> objDate=" + objDate + "; objValue=" + objValue);
}
else if(SCALE_FACTOR_WEEKLY.equals(strScaleFactor)) {
objTimeTable.add(new Week(objDate), ((Double)objValue).doubleValue(), strName);
System.out.println("TIMETABLE_MONTHLY====>>>> objDate=" + objDate + "; objValue=" + objValue);
}
else if(SCALE_FACTOR_DAILY.equals(strScaleFactor)) {
objTimeTable.add(new Day(objDate), ((Double)objValue).doubleValue(), strName);
System.out.println("TIMETABLE_MONTHLY====>>>> objDate=" + objDate + "; objValue=" + objValue);
}
else if(SCALE_FACTOR_HOURLY.equals(strScaleFactor)) {
objTimeTable.add(new Hour(objDate), ((Double)objValue).doubleValue(), strName);
System.out.println("TIMETABLE_MONTHLY====>>>> objDate=" + objDate + "; objValue=" + objValue);
}

}

return objTimeTable;
}

socrateone
Posts: 13
Joined: Fri Apr 28, 2006 2:53 pm

similar problem

Post by socrateone » Mon May 01, 2006 10:11 pm

I'm having a similar problem:

Code: Select all

java.lang.NoSuchMethodError: org.jfree.chart.ChartFactory.createBarChart(Ljava/lang/String; Ljava/lang/String;Ljava/lang/String; Lorg/jfree/data/category/CategoryDataset; Lorg/jfree/chart/plot/PlotOrientation;ZZZ) Lorg/jfree/chart/JFreeChart;
        at org.jfree.chart.demo.servlet.BarChartJFreeChart.createBarChart(BarChartJFreeChart.java:99)
        at org.jfree.chart.demo.servlet.BarChartJFreeChart.service(BarChartJFreeChart.java:59)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
etc...
The actual call that throws the exeption is this:

Code: Select all

JFreeChart chart = ChartFactory.createBarChart(                          
                        "Chart Title",
                        null,    
                        null,
                        catDataSet,
                        PlotOrientation.VERTICAL,
                        false,
                        false,
                        false
      ); 
Somehow, in the argument list, the three boolean arguments in the signature are being converted to "ZZZ"

Code: Select all

createBarChart(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String; Lorg/jfree/data/category/CategoryDataset; Lorg/jfree/chart/plot/PlotOrientation;ZZZ) Lorg/jfree/chart/JFreeChart;
wtf???
Last edited by socrateone on Mon May 01, 2006 10:14 pm, edited 1 time in total.

socrateone
Posts: 13
Joined: Fri Apr 28, 2006 2:53 pm

one more thing...

Post by socrateone » Mon May 01, 2006 10:13 pm

I think an important thing to point out is that this error is in the catalina logs. There isn't any compile time error thrown. When I try to load the page with the chart in my web app, I get a blank page and that NoSuchMethodError is in the log files.

socrateone
Posts: 13
Joined: Fri Apr 28, 2006 2:53 pm

found a fix for this

Post by socrateone » Mon May 01, 2006 11:07 pm

I still had the old lib files in my build directory. I needed to clean the build directory with an ant clean. That removed the old directory and the conflict.

Locked