ChartCreator with Facelets

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
gildas
Posts: 2
Joined: Fri Oct 17, 2008 12:53 pm

ChartCreator with Facelets

Post by gildas » Fri Oct 17, 2008 1:23 pm

I've installed ChartCreator, following the intructions given by

Code: Select all

jsf-comp.sourceforge.net/components/chartcreator/
When I run the example (DefaultPieDataset), I have this error :

Code: Select all

13:48:13,088 ERROR [[Chartlet]] () "Servlet.service()" pour la servlet Chartlet a gÚnÚrÚ une exception
java.lang.NullPointerException
        at net.sf.jsfcomp.chartcreator.utils.ChartUtils.createChartWithType(Unknown Source)
        at net.sf.jsfcomp.chartcreator.Chartlet.doGet(Unknown Source)
        at javax.servlet.H.HttpServlet.service(HttpServlet.java:690)
        at javax.servlet.H.HttpServlet.service(HttpServlet.java:803)
I use servlet. Config in web.xml :

Code: Select all

	<context-param>
		<param-name>net.sf.jsfcomp.chartcreator.USE_CHARTLET</param-name>
		<param-value>true</param-value>
	</context-param>
	<servlet>
		<servlet-name>Chartlet</servlet-name>
		<servlet-class>net.sf.jsfcomp.chartcreator.Chartlet</servlet-class>
	</servlet>
		
	<servlet-mapping>
		<servlet-name>Chartlet</servlet-name>
		<url-pattern>*.chart</url-pattern>
	</servlet-mapping>
Here's chartcreator.taglib.xml

Code: Select all

<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
  "-..Sun Microsystems, Inc...DTD Facelet Taglib 1.0..EN"
  "H:..java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
   <namespace>H:..sourceforge.net/projects/jsf-comp</namespace>
   <tag>
      <tag-name>chart</tag-name>
      <component>
         <component-type>net.sf.jsfcomp.chartcreator.UIChart</component-type>
      </component>
   </tag>
</facelet-taglib>
My XHTML fie :

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-..W3C..DTD XHTML 1.0 Transitional..EN"
		"H:..www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="H:..www.w3.org/1999/xhtml"
		xmlns:f="H:..java.sun.com/jsf/core"
		xmlns:h="H:..java.sun.com/jsf/html"
		xmlns:ui="H:..java.sun.com/jsf/facelets"
		xmlns:a4j="H:..richfaces.org/a4j"
		xmlns:carl="H:..com/carl/carl/frmk"
		xmlns:c="H:..sourceforge.net/projects/jsf-comp">

<f:view>
	<head>
	</head>
	<body>
	<carl:bind var="pieChart" type="com.carl.xnet.system.frontend.bean.PieChart" />

	<carl:form id="PIECHART">

		<c:chart id="chart1" datasource="#{pieChart.pieDataSet}"
			type="pie" is3d="true" antialias="true" title="Example Chart"
			xlabel="X Label" ylabel="Y Label" height="300" width="400">
		</c:chart>
		
	</carl:form>
	
	</body>
</f:view>

</html>
Any idea to investigate this error ?

gildas
Posts: 2
Joined: Fri Oct 17, 2008 12:53 pm

Post by gildas » Fri Oct 17, 2008 3:28 pm

It's a filter in my framework which caused this trouble...

ajanitin
Posts: 7
Joined: Wed Dec 03, 2008 12:30 pm
Location: Pune, India

Chart creator in portlet

Post by ajanitin » Wed Dec 03, 2008 12:34 pm

Hi,

I am facing the same problem. When a JSF page containing the chart is executed in browser the chart displays correctly. But when a portlet containing the JSF page is executed, i am getting following exception

I am using oracle weblogic portal with oracle workshop. I am using the same configuration.


java.lang.NullPointerException
at net.sf.jsfcomp.chartcreator.utils.ChartUtils.createChartWithType(Unknown Source)
at net.sf.jsfcomp.chartcreator.Chartlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
Truncated. see log file for complete stacktrace

ajanitin
Posts: 7
Joined: Wed Dec 03, 2008 12:30 pm
Location: Pune, India

Post by ajanitin » Wed Dec 03, 2008 12:36 pm

Hi gildas,

which filter causes this exception. will u plz help me?

Locked