I have been updating my development environment to Eclipse Neon and introducing m2e to manage project dependencies. in one project the original (very old) versions of JFreeChart
were not available on maven so I have put in the latest versions of JFreeChart
and JCommon
.
I now have one compile error, described below:
The type org.jfree.data.general.Series cannot be resolved.
It is indirectly referenced from required .class files.
I have found a number of questions and answers about this, but they seem to relate to the absence of JCommon
. I have JCommon
in my dependencies, and I have checked the specific class that is referred to is actually in the jfreechart.jar
file with 7-zip.
Below is the code fragment with the error, which occurs on the last else statement results.add(…)
.
public XYDataset getMetricHistogramData(Timestamp t1, Timestamp t2){
int index1=-1;
Timestamp startTime,endTime;
TimePeriodValues results = new TimePeriodValues(this.type.name());
final TimePeriodValuesCollection results1 = new TimePeriodValuesCollection();
if (t1.before(earliest)||t1.after(latest)||(readings.size()<=1)) return null; // won't find a value for the timestamp t1
if (t2.before(earliest)||t2.after(latest)) return null; // won't find a value for the timestamp t2
for(int i = 0;i<readings.size();i++){
if (readings.get(i).timestamp().equals(t1)){
index1=i;
break;
}
if (readings.get(i).timestamp().after(t1)){
index1=i-1;
break;
}
}
// index1 now contains the index of the starting timestamp
for (int i=index1; i<(readings.size()-1); i++){
startTime = readings.get(i).timestamp();
if(startTime.after(t2)) break;
//endTime = new Timestamp(Math.abs(readings.get(i+1).timestamp().getTime()-Timestamped.SECOND_IN_MS));
endTime = readings.get(i+1).timestamp();
if (endTime.before(startTime))
SmartPower.getMain().getFrame().displayLog("Bad Timestamps "+startTime + " - " + endTime+"\n\r");
else results.add(new SimpleTimePeriod(startTime, endTime), readings.get(i).value());
}
results1.addSeries(results);
return results1;
}
This is my pom.xml file
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>SmartPower</groupId>
<artifactId>SmartPower</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.eclipse.persistence/javax.persistence -->
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.1.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jfree/jfreechart -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jfreechart</artifactId>
<version>1.0.19</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.jfree/jcommon -->
<dependency>
<groupId>org.jfree</groupId>
<artifactId>jcommon</artifactId>
<version>1.0.23</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.jgoodies/forms -->
<dependency>
<groupId>com.jgoodies</groupId>
<artifactId>forms</artifactId>
<version>1.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.apache.derby/derby -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<version>10.12.1.1</version>
</dependency>
</dependencies>
</project>
Neon was a clean install about a week ago on windows 10.
Any pointers would be appreciated.