Hi,
I am trying to use the JfreeChart Wrapper in order to make a simple chart however I keep getting a HTTP status 500 error. I have been through the forums and added all the Jar files that are suggested that is all the GWT jars as well as Batik jars but still getting the same error.
Here is the code
[b]
package com.example.vaadin;
import com.vaadin.Application;
import com.vaadin.ui.;
import com.vaadin.data.;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;
import org.vaadin.addon.JFreeChartWrapper;
/**
*
- @author Lewis Posner
- @version
*/
public class MyApplication extends Application {
@Override
public void init() {
Window main = new Window();
setMainWindow(main);
XYSeries series = new XYSeries("Test");
series.add(0, 165);
series.add(1, 150);
series.add(2, 130);
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(series);
// Generate the graph
JFreeChart chart = ChartFactory.createXYLineChart("Testing Jfree", // Title
"Please", // x-axis Label
"work", // y-axis Label
dataset, // Dataset
PlotOrientation.VERTICAL, // Plot Orientation
true, // Show Legend
true, // Use tooltips
false // Configure chart to generate URLs?
);
JFreeChartWrapper wrapper = new JFreeChartWrapper(chart);
VerticalLayout v = new VerticalLayout();
main.addComponent(v);
v.addComponent(wrapper);
v.setWidth("100%");
}
}
[/b]
Here is the error message from the Tomcat Log
[color=#f90505]
Dec 21, 2011 12:19:55 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [VaadinApplication]
in context with path
[/WebApplication3] threw exception [java.lang.NoSuchMethodError: com.vaadin.terminal.gwt.server.WebBrowser.isIE()Z]
with root cause
java.lang.NoSuchMethodError: com.vaadin.terminal.gwt.server.WebBrowser.isIE()Z
at org.vaadin.addon.JFreeChartWrapper.attach(JFreeChartWrapper.java:127)
at com.vaadin.ui.AbstractComponent.setParent(AbstractComponent.java:551)
at com.vaadin.ui.AbstractComponentContainer.addComponent(AbstractComponentContainer.java:207)
at com.vaadin.ui.AbstractOrderedLayout.addComponent(AbstractOrderedLayout.java:68)
at com.example.vaadin.MyApplication.init(MyApplication.java:52)
at com.vaadin.Application.start(Application.java:545)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.startApplication(AbstractApplicationServlet.java:1032)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:423)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
[/color]
If someone could please help me I would be really grateful.
Thanks a lot
Pozzy