Fine on one machine, NoSuchMethodError exception on another

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
filonenko
Posts: 2
Joined: Sat Sep 13, 2014 10:04 pm
antibot: No, of course not.

Fine on one machine, NoSuchMethodError exception on another

Post by filonenko » Sat Sep 13, 2014 10:43 pm

Hello,

I'm using JFreeChart_1.0.17 with JCommon_1.0.21.

When I run my java project on one machine, it works fine, but when I try it on another one it fails with an exception:

Code: Select all

Exception in thread "main" java.lang.NoSuchMethodError: org.jfree.chart.ChartFactory.createXYStepChart(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lorg/jfree/data/xy/XYDataset;)Lorg/jfree/chart/JFreeChart;
The same with createXYLineChart either createScatterPlot instead of createXYStepChart - ChartFactory methods. In the same time I have no problem using XYSeries, for example.

Both machines run under Ubuntu 12.04 for OS.
Java: OpenJDK, version "1.7.0_65", from ubuntu repositories.

No, there're no duplicate references on the classpath and no forgotten older versions of JFreeChart or JCommon.

Can you please help me, what can I be probably missing or what may be wrong, so that I get the error on one machine and don't get it on the other?
Any your ideas will be appreciated.

filonenko
Posts: 2
Joined: Sat Sep 13, 2014 10:04 pm
antibot: No, of course not.

Re: Fine on one machine, NoSuchMethodError exception on anot

Post by filonenko » Wed Sep 17, 2014 6:00 pm

Looks like I have solved this.
There were no duplicate references on the classpath and no forgotten older versions of JFreeChart or JCommon - in mine project, in the part created by me and in the command I used to launch it.
But finally I have discovered an older version of JFreeChart inside a 3rd party library (jar-file). This did not influence the whole project while I was developping it on one machine. But when I moved copies of project onto other machines, on one of the machines smth. might have changed in a random fashion the order in which the libraries were picked from the classpath folder during the launch. The conflict emerged.
Thanks for your attention.

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

Re: Fine on one machine, NoSuchMethodError exception on anot

Post by david.gilbert » Wed Sep 17, 2014 8:03 pm

Thanks for the followup. Duplicate classes seem to cause the strangest error messages :cry:
David Gilbert
JFreeChart Project Leader

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

Locked