Hi,
I wanted to include a JFreeChart in my Vaadin application. For that, I have to use JFreeChartWrapper. I am using JFreeChartWrapper 2.4, Vaadin 6.8.14 and JFreeChart 1.0.18. When I execute my program (in Forefox) I get the following error message:
[code]
Terminal error:
java.lang.NullPointerException
at org.apache.batik.svggen.SVGGeneratorContext.doubleString(Unknown Source)
at org.apache.batik.svggen.SVGGraphics2D.drawString(Unknown Source)
at org.jfree.text.TextUtilities.drawAlignedString(TextUtilities.java:392)
at org.jfree.text.TextUtilities.drawRotatedString(TextUtilities.java:553)
at org.jfree.text.TextFragment.draw(TextFragment.java:217)
at org.jfree.text.TextLine.draw(TextLine.java:174)
at org.jfree.text.TextBlock.draw(TextBlock.java:260)
at org.jfree.text.TextBlock.draw(TextBlock.java:222)
at org.jfree.chart.title.TextTitle.drawHorizontal(TextTitle.java:772)
at org.jfree.chart.title.TextTitle.draw(TextTitle.java:713)
at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1315)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1204)
at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1113)
at org.vaadin.ui.JFreeChartWrapper$1.getByteStream(JFreeChartWrapper.java:290)
at org.vaadin.ui.JFreeChartWrapper$1.getStream(JFreeChartWrapper.java:373)
at com.vaadin.Application.handleURI(Application.java:798)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleURI(AbstractCommunicationManager.java:2289)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleURI(CommunicationManager.java:377)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleURI(AbstractApplicationServlet.java:1099)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:535)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
Sep 30, 2014 9:34:13 AM com.vaadin.Application terminalError
SCHWERWIEGEND: Terminal error:
java.lang.NoSuchMethodError: org.apache.batik.svggen.SVGGraphics2D.stream(Lorg/w3c/dom/Element;Ljava/io/Writer;ZZ)V
at org.vaadin.ui.JFreeChartWrapper$1.getByteStream(JFreeChartWrapper.java:313)
at org.vaadin.ui.JFreeChartWrapper$1.getStream(JFreeChartWrapper.java:373)
at com.vaadin.Application.handleURI(Application.java:798)
at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleURI(AbstractCommunicationManager.java:2289)
at com.vaadin.terminal.gwt.server.CommunicationManager.handleURI(CommunicationManager.java:377)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.handleURI(AbstractApplicationServlet.java:1099)
at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:535)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
[/code]My code looks as follows:
......
chart = new BarChart();
wrapper = new JFreeChartWrapper(chart);
resultContainer.addComponent(wrapper,0,0);
.......
Did I forget something? Could need any help for that, I don’t know what to try