Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    10
    Rep Power
    0

    Default JfreeChart.. how to plot????? help needed

    Hii.. I am using Jfreechart to plot a time series graph..
    i studied the tutorial for that and copied a sample code so as to understand..
    I am using netbeabs 6.8.. and i downloaded .jar file of jfreechart from the internet..

    i added the jar file in the library tab of a new project in Java...
    and copied the code in the main file..

    It is giving the following error...
    i guess there is some problem may be with importing files etc..
    can anyone help me to solve it??





    Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
    at org.jfree.chart.axis.Axis.<clinit>(Axis.java:169)
    at org.jfree.chart.ChartFactory.createTimeSeriesChart (ChartFactory.java:1345)
    at javaapplication23.TimeSeriesDemo.createChart(TimeS eriesDemo.java:41)
    at javaapplication23.TimeSeriesDemo.<init>(TimeSeries Demo.java:33)
    at javaapplication23.TimeSeriesDemo.main(TimeSeriesDe mo.java:115)
    Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:334)
    ... 5 more

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,306
    Rep Power
    25

    Default

    NoClassDefFoundError: org/apache/log4j/Logger
    You need to add the library containing the class in the above message to the classpath for java command to find.

  3. #3
    Join Date
    Jun 2010
    Posts
    10
    Rep Power
    0

    Default

    thanks man..
    I solved that somehow..
    I created a new project in Netbeans..
    and imported libraries and ran the code.
    it is working fine..

    now i do the same thing in my current project(here project means the project we create in netbeans..)

    i import same libraries..
    and do all things as same..
    then there is a new error...




    Exception in thread "main" java.lang.NoSuchMethodError: org.jfree.chart.JFreeChartInfo.setLibraries(Ljava/util/List;)V
    at org.jfree.chart.JFreeChartInfo.<init>(JFreeChart.j ava:1467)
    at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.jav a:187)
    at org.jfree.chart.ChartFactory.createTimeSeriesChart (ChartFactory.java:1364)
    at multiple.TimeSeriesDemo.createChart(TimeSeriesDemo .java:41)
    at multiple.TimeSeriesDemo.<init>(TimeSeriesDemo.java :33)
    at multiple.Main.main(Main.java:76)
    Java Result: 1



    i have searches many forums on net but i cant find its solution...

  4. #4
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Perhaps you have more than one jfreechart jar on your classpath and they have different versions.
    Make sure you use only one jar and that it is the same at compile time and at run time.

Similar Threads

  1. JFreeChart 1.0.11
    By Java Tip in forum Java Software
    Replies: 3
    Last Post: 04-18-2014, 08:27 PM
  2. Jfreechart help
    By shruti in forum AWT / Swing
    Replies: 1
    Last Post: 07-11-2009, 04:16 AM
  3. JfreeChart
    By puk284 in forum Advanced Java
    Replies: 1
    Last Post: 05-12-2009, 04:52 PM
  4. JFreeChart 1.0.8
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 11-27-2007, 08:27 PM
  5. JFreeChart 1.0.5
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-10-2007, 05:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •