Version troubles

A discussion forum for the JCommon class library.
Locked
Stacey
Posts: 15
Joined: Tue Jan 27, 2004 5:09 pm

Version troubles

Post by Stacey » Mon Jun 14, 2004 7:09 pm

I am working on an application which uses the jfreechart api and, as of the last 6months, the jfreereport api also.

The trouble I have is finding jfreechart/jfreereport/jcommon compatabilities. It seems like once I get jfreechart supported in my application and then attempt to get jfreereport supported...the jcommon version for each api is different.

For example, currently
Jfreechart - 0.9.20 with jcommon 0.9.5
jfreereport - 0.8.4_10 with jcommon 0.9.3a
jfreereport_ext - 0.8.4_10 with jfreechart 0.9.13

Any recommendations of which version/api to start with and build up compatability from there?
I'd really like to keep with the latest of each version...especially the jfreechart api because it has changed so much in the last few versions...it would be really hard to downgrade.

Is there an easy way to build a release all of jfree api(s) together so versions are kept compatible?

Thanks for product!
Stacey

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Mon Jun 14, 2004 9:39 pm

Hi,

the JFreeChart-version of JFreeReport-ext can be replaced by an later version - it is just used for the chart-demo.

The new JCommon version has an ugly flaw (evil me!) as it breaks the most unimportant class of JFreeReport.

Compatibility can be restored by replacing the class org.jfree.report.JFreeReportInfo with the code below:

Code: Select all

package org.jfree.report;

import java.util.Arrays;

import org.jfree.JCommon;
import org.jfree.base.Library;
import org.jfree.ui.about.Contributor;
import org.jfree.ui.about.Licences;
import org.jfree.ui.about.ProjectInfo;

/**
 * Details about the JFreeReport project.
 *
 * @author David Gilbert
 */
public class JFreeReportInfo extends ProjectInfo implements Cloneable
{
  /**
   * Constructs an object containing information about the JFreeReport project.
   * <p>
   * Uses a resource bundle to localise some of the information.
   */
  public JFreeReportInfo()
  {
    setName("JFreeReport");
    setVersion("0.8.4-9");
    setInfo("http://www.jfree.org/jfreereport/index.html");
    setCopyright
        ("(C)opyright 2000-2003, by Thomas Morgner, Object Refinery Limited and Contributors");

    setContributors(Arrays.asList(
        new Contributor[]
        {
          new Contributor("David Gilbert", "david.gilbert@object-refinery.com"),
          new Contributor("Thomas Morgner", "taqua@users.sourceforge.net"),
          new Contributor("J\u00d6rg Sch\u00d6mer", "joerg.schoemer@nikocity.de"),
          new Contributor("Heiko Evermann", "-"),
          new Contributor("Piotr Bzdyl", "-"),
          new Contributor("Patrice Rolland", "-"),
          new Contributor("Cedric Pronzato", "-")
        }
    ));


    addLibrary(JCommon.INFO);
    addLibrary(new Library("Pixie", "0.8.1", "LGPL",
            "http://sourceforge.net/projects/jfreereport/"));
  }

  /**
   * Tries to read the licence text from jcommon. This method does not reference
   * jcommon directly, as this would increase the size of that class file.
   *
   * @see org.jfree.ui.about.ProjectInfo#getLicenceText()
   * @return the licence text for this project.
   */
  public String getLicenceText()
  {
    return Licences.getInstance().getLGPL();
  }

  /**
   * Print the library version and information about the library.
   * <p>
   * After there seems to be confusion about which version is currently used by
   * the user, this method will print the project information to clarify this
   * issue.
   *
   * @param args ignored
   */
  public static void main(final String[] args)
  {
    final JFreeReportInfo info = new JFreeReportInfo();
    System.out.println(info.getName() + " " + info.getVersion());
    System.out.println("----------------------------------------------------------------");
    System.out.println(info.getCopyright());
    System.out.println(info.getInfo());
    System.out.println("----------------------------------------------------------------");
    System.out.println("This project is licenced under the terms of the "
        + info.getLicenceName() + ".");
    System.exit(0);
  }
}
There are no other traps hidden and after that JFreeReport will happily work together with the newest JFreeChart version.

JFreeChart and JFreeReport *should* be fully compabile - except on these rare conditions where something ugly sneaked in - like now :(

Have more fun,
said Thomas

Guest

Post by Guest » Tue Jun 22, 2004 6:00 pm

will there be a release of jcommon SOON with the fixed class?

md315
Posts: 7
Joined: Wed Jun 23, 2004 4:43 pm
Location: us

Post by md315 » Wed Jul 21, 2004 4:23 pm

I hope so I have this problem as well......

md315
Posts: 7
Joined: Wed Jun 23, 2004 4:43 pm
Location: us

Post by md315 » Thu Jul 22, 2004 6:20 pm

I recently tried this solution a couple ways without success. I am able to build the project using the old version of JFreeReportInfo. But when I replace it with this code I get the following error from ANT.

Code: Select all



C:\OTHERL~1\JFREER~1\SOURCE>ant -f ..\ant\build.xml
Buildfile: ..\ant\build.xml


build-all:

init:

compile:
    [javac] Compiling 248 source files to C:\OTHERL~1\JFREER~1\build
    [javac] C:\OTHERL~1\JFREER~1\source\org\jfree\report\JFreeReportInfo.java:6: package org.jfree.base does not exist
    [javac] import org.jfree.base.Library; 
    [javac]                       ^
    [javac] C:\OTHERL~1\JFREER~1\source\org\jfree\report\JFreeReportInfo.java:45: cannot resolve symbol
    [javac] symbol  : method addLibrary (org.jfree.ui.about.ProjectInfo)
    [javac] location: class org.jfree.report.JFreeReportInfo
    [javac]     addLibrary(JCommon.INFO); 
    [javac]     ^
    [javac] C:\OTHERL~1\JFREER~1\source\org\jfree\report\JFreeReportInfo.java:46: cannot resolve symbol
    [javac] symbol  : class Library 
    [javac] location: class org.jfree.report.JFreeReportInfo
    [javac]     addLibrary(new Library("Pixie", "0.8.1", "LGPL", 
    [javac]                    ^
    [javac] 3 errors

BUILD FAILED
C:\OTHERL~1\JFREER~1\ant\build.xml:185: Following error occured while executing this line
C:\OTHERL~1\JFREER~1\ant\build-core.xml:51: Compile failed; see the compiler error output for details.

Total time: 5 seconds
Looking at the differences in the two versions this is the only difference I see;

new code that fails;

Code: Select all

    
    addLibrary(JCommon.INFO); 
    addLibrary(new Library("Pixie", "0.8.1", "LGPL", 		"http://sourceforge.net/projects/jfreereport/")); 
old code that works;
?

Code: Select all

    setLibraries(Arrays.asList(
        new Library[]
        {
          new Library(JCommon.INFO),
          new Library("Pixie", "0.8.1", "LGPL",
              "http://sourceforge.net/projects/jfreereport/"),
        }
    ));

Any ideas? Am I missing a library that the other version doesn't need?

md315
Posts: 7
Joined: Wed Jun 23, 2004 4:43 pm
Location: us

Post by md315 » Fri Jul 23, 2004 3:22 pm

Ok since it looked as though the build couldn't find org.jfree.base.Library I realized that the build was still using jcommon-0.9.3a.jar rather than the jcommon-0.9.5.jar I had in the ant/lib directory. When I replaced that with jcommon-0.9.5.jar I got an error that the build required jcommon-0.9.3a.jar. Next I renamed jcommon-0.9.5.jar to jcommon-0.9.3a.jar and it looks to have compiled ok.

After doing this I got it working.

demmons

Version troubles

Post by demmons » Mon Jul 26, 2004 8:59 pm

I tried doing the rename trick.
This didn't work for me. Now JFreeChart is broken (see error below), and JFreeReport doesn't show the text in the table model i pass it. Any clue?


java.lang.VerifyError: (class: org/jfree/chart/JFreeChartInfo, method: <init> signature: ()V) Incompatible argument to function
at org.jfree.chart.JFreeChart.<clinit>(JFreeChart.java:187)
at com.starkinvestments.rigor.client.ui.quotes.bonds.charts.Chart.getChart(Chart.java:213)
at com.starkinvestments.rigor.client.ui.quotes.bonds.charts.GenericChart.GenericGraphPanel.makeChart(GenericGraphPanel.java:387)
at com.starkinvestments.rigor.client.ui.quotes.bonds.charts.GenericChart.GenericGraphPanel.showChart(GenericGraphPanel.java:323)
at com.starkinvestments.rigor.client.ui.instrument.bond.PriceMatrixPanel.onActivate(PriceMatrixPanel.java:158)
at com.starkinvestments.client.ui.control.LazyInitTabbedPane$1.run(LazyInitTabbedPane.java:44)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:454)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)

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 » Thu Jul 29, 2004 9:03 am

I performed the following steps which worked for me:

(1) Start with a clean copy of JFreeReport 0.8.4_10.

(2) Delete the jcommon-0.9.3a.jar file from the 'lib' directory.

(3) Copy the jcommon-0.9.5.jar file from the JFreeChart distribution to the 'lib' directory of your JFreeReport distribution.

(4) Edit JFreeReportInfo.java as indicated at the top of the thread.

(5) Edit the build.properties file (in the 'ant' directory) replacing 'jcommon-0.9.3a.jar' with 'jcommon-0.9.5.jar'.

(6) Change to the 'ant' directory and type 'ant'. This will rebuild JFreeReport entirely (there are a couple of deprecation warnings, but you should see no errors).

Now you should have a version of JFreeReport that runs with the same version of JCommon (0.9.5) as JFreeChart.

Sorry for the trouble. We are working towards getting stable versions of JFreeChart, JFreeReport and JCommon released, but hopefully you can appreciate that with limited resources it can be difficult for us to keep everything working as it should.

Regards,

Dave Gilbert
JFreeChart Project Leader

BrianFox

Post by BrianFox » Mon Aug 09, 2004 8:24 pm

Is there any work planned to allow us to upgrade jfreechart independantly from jfreereport?

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 » Mon Aug 09, 2004 11:43 pm

BrianFox wrote:Is there any work planned to allow us to upgrade jfreechart independantly from jfreereport?
These two projects share code via the JCommon library. With most releases (of JFreeChart and JFreeReport) there have been no problems upgrading to the latest version of JCommon (usually things are added to JCommon but nothing is taken away). BUT we broke that in the latest JCommon release by accident. The fix (which is pretty straightforward) needs to be applied to JFreeReport, as outlined above.
David Gilbert
JFreeChart Project Leader

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

Brad Kieser

Post by Brad Kieser » Mon Sep 06, 2004 6:07 pm

The fix works a treat. Thx for the details destructions, Dave, they were invaluable.

singhtjunior
Posts: 2
Joined: Thu Jul 29, 2004 8:34 pm

Still getting errors with jcommon-0.9.6.jar

Post by singhtjunior » Tue Sep 28, 2004 10:34 pm

I followed the instructions, the only difference is that I used jcommon-0.9.6.jar

My config consists of
jfreechart-0.9.21, jfreereport-0.8.4_10, and jcommon-0.9.6

My JDK version is JDK 1.4.2

After running ant in all three (chart, report, common), and making changes according to this thread, the system continues to spill errors.

The outcome of HelloWorld.java is the following:

Exception in thread "main" java.lang.NoSuchMethodError: org.jfree.ui.about.ProjectInfo.setLibraries(Ljava/util/List;)V
at org.jfree.report.JFreeReportInfo.<init>(JFreeReportInfo.java:86)
at org.jfree.report.Boot.start(Boot.java:108)
at org.jfree.report.demo.HelloWorld.main(HelloWorld.java:177)

Does this only work with jcommon-0.9.5.jar?

spyffe

Problem finding older versions of jfree package

Post by spyffe » Fri Jan 21, 2005 9:39 pm

Hi,

I have a java program that needs to be updated. The program refers to an older version of the org.jfree package. It has a reference to org.jfree.date, which I can not find in the latest (0.9.21) version. I tried searching for older versions, but could not locate any.

Where can I find the older versions of the package?

Thanks!

Taqua
JFreeReport Project Leader
Posts: 698
Joined: Fri Mar 14, 2003 3:34 pm
Contact:

Post by Taqua » Fri Jan 21, 2005 10:20 pm

Hi,

that package is in jcommon.

Have mo' fun,
said Thomas

Locked