[#12496] - Could not create chart customizer instance.

Category:
Bug report
Priority:
High
Status:
Feedback Requested
Project: Severity:
Major
Resolution:
Open
Component: Reproducibility:
Random
Assigned to:
0

net.sf.jasperreports.engine.JRRuntimeException: Could not create chart customizer instance.
at net.sf.jasperreports.engine.fill.JRFillChart.createAndInitCustomizer(JRFillChart.java:357)
at net.sf.jasperreports.engine.fill.JRFillChart.<init>(JRFillChart.java:318)
at net.sf.jasperreports.engine.fill.JRFillObjectFactory.visitChart(JRFillObjectFactory.java:704)
at net.sf.jasperreports.engine.base.JRBaseChart.visit(JRBaseChart.java:578)
at net.sf.jasperreports.engine.JRAbstractObjectFactory.getVisitResult(JRAbstractObjectFactory.java:88)
at net.sf.jasperreports.engine.fill.JRFillElementGroup.<init>(JRFillElementGroup.java:82)
at net.sf.jasperreports.engine.fill.JRFillElementContainer.<init>(JRFillElementContainer.java:93)
at net.sf.jasperreports.engine.fill.JRFillBand.<init>(JRFillBand.java:121)
at net.sf.jasperreports.engine.fill.JRFillObjectFactory.getBand(JRFillObjectFactory.java:524)
at net.sf.jasperreports.engine.fill.JRFillSection.<init>(JRFillSection.java:74)
at net.sf.jasperreports.engine.fill.JRFillObjectFactory.getSection(JRFillObjectFactory.java:500)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:261)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:200)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:215)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:115)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:983)
at com.example.mongodbdemo.Utils.PdfReport.generateReport(PdfReport.java:682)
at com.example.mongodbdemo.Contoller.UserController.empReport(UserController.java:89)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:118)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.customizers.axis.RangeAxisCustomizer
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:174)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:114)
at net.sf.jasperreports.engine.fill.JRFillChart.createAndInitCustomizer(JRFillChart.java:352)
... 74 more

v6.10
Chart
balatemp64's picture
Joined: Oct 19 2019 - 1:20am
Last seen: 5 months 2 weeks ago

2 Comments:

#1
  • Status:New» Feedback Requested
  • Assigned:nobody» teodord

Hi,

Do you get this error in Jaspersoft Studio, or do you get it in the application where you deploy your reports?
Can you provide us the JRXML?

Thank you,
Teodor

#2
  • Assigned:nobody»

Have same problem, in the Report Studio.

Was trying to use customization from this page: https://mdahlman.wordpress.com/2011/04/17/chart-customizers-2/

I put the jar file into C:\Program Files\TIBCO\Jaspersoft Studio Professional-7.1.0.final\configuration\org.eclipse.osgi\65\0\.cp\lib folder.

Here's the JRXML file

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 7.1.0.final using JasperReports Library version 6.4.3 -->
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Pie_Specified_Series_Colors" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="ab9d31b8-2727-48d8-ae23-90c2e6b8b1da">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<subDataset name="dataset1" uuid="f762e3d7-8f94-45be-b448-a2f88da5449a">
<queryString>
<![CDATA[select 'Prod A' as prod_name, 15 as prod_value
union select 'Prod C' as prod_name, 20 as prod_value
union select 'Prod D' as prod_name, 55 as prod_value
union select 'Prod E' as prod_name, 10 as prod_value]]>
</queryString>
<field name="prod_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="prod_value" class="java.lang.Long">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
</subDataset>
<queryString>
<![CDATA[select 'Prod A' as prod_name, 10 as prod_value
union select 'Prod B' as prod_name, 20 as prod_value
union select 'Prod C' as prod_name, 40 as prod_value
union select 'Prod D' as prod_name, 25 as prod_value
union select 'Prod E' as prod_name, 5 as prod_value]]>
</queryString>
<field name="prod_name" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="prod_value" class="java.lang.Long">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="560" splitType="Stretch">
<pieChart>
<chart isShowLegend="false" evaluationTime="Report">
<reportElement x="0" y="100" width="250" height="200" uuid="7086fe45-f3f9-4702-931b-c177a6c6bcb8">
<property name="PredefinedColors" value="Prod A:red;Prod B:orange;Prod C:#C0C0C0;Prod D:cyan;Prod E:magenta"/>
</reportElement>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset>
<keyExpression><![CDATA[$F{prod_name}]]></keyExpression>
<valueExpression><![CDATA[$F{prod_value}]]></valueExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
</piePlot>
</pieChart>
<pieChart>
<chart isShowLegend="false" evaluationTime="Report">
<reportElement x="0" y="300" width="250" height="200" uuid="08eec36d-6387-46d9-827b-5534949cfc4c">
<property name="PredefinedColors" value="Prod A:red;Prod B:orange;Prod C:#C0C0C0;Prod D:cyan;Prod E:magenta"/>
</reportElement>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset>
<dataset>
<datasetRun subDataset="dataset1" uuid="65c2bde4-a03b-4f01-b002-491a6806d8db"/>
</dataset>
<keyExpression><![CDATA[$F{prod_name}]]></keyExpression>
<valueExpression><![CDATA[$F{prod_value}]]></valueExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
</piePlot>
</pieChart>
<textField>
<reportElement x="0" y="0" width="555" height="40" uuid="1eda3c2a-6e43-4139-b74f-5ca52f66d18e"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["Demonstration of a sample Chart Customizer allowing the report designer to specify series colors"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="40" width="250" height="60" uuid="b78ebb23-85d8-44fc-82fd-f9a798dcd441"/>
<textFieldExpression><![CDATA["In a standard report it can be difficult to detect trends " +
"because a series may have a different color depending on " +
"the order of the resultset or the presence of other items."]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="500" width="250" height="60" uuid="b9dd1112-c005-411c-9ef7-af37a7db7317"/>
<textFieldExpression><![CDATA["At first glance it appears that Prod C has increased from " +
"the first chart to the second chart. But on closer inspection " +
"you can see that it as decreased."]]></textFieldExpression>
</textField>
<pieChart>
<chart isShowLegend="false" evaluationTime="Report" customizerClass="com.jaspersoft.bizdev.PieLabels">
<reportElement x="305" y="100" width="250" height="200" uuid="4ac198dd-3bba-44f9-9730-93a5b5b28bf1">
<property name="PredefinedColors" value="Prod A:red;Prod B:orange;Prod C:#C0C0C0;Prod D:cyan;Prod E:magenta"/>
</reportElement>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset>
<keyExpression><![CDATA[$F{prod_name}]]></keyExpression>
<valueExpression><![CDATA[$F{prod_value}]]></valueExpression>
</pieDataset>
<piePlot labelFormat="{0}">
<plot/>
<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
</piePlot>
</pieChart>
<textField>
<reportElement x="305" y="40" width="250" height="60" uuid="4c7a5322-5d9b-4588-bb57-5fe6f6cdcef9"/>
<textFieldExpression><![CDATA["These two charts have a chart customizer specified. " +
"This allows us to specify series colors in the custom " +
"property called PredefinedColors."]]></textFieldExpression>
</textField>
<textField>
<reportElement x="305" y="500" width="250" height="60" uuid="f324cb45-33c5-4a7e-ab19-524b7ed508d6"/>
<textFieldExpression><![CDATA["Here it is easy for the end user to see the trend " +
"from one chart to the next. It's immediately obvious that " +
"Prod D has increased, Prod C has decreased, and Prod B is gone."]]></textFieldExpression>
</textField>
<pieChart>
<chart isShowLegend="false" evaluationTime="Report" customizerClass="com.jaspersoft.bizdev.PieLabels">
<reportElement x="305" y="300" width="250" height="200" uuid="9740d50d-5bf9-4c33-bc83-16376f7e7349">
<property name="PredefinedColors" value="Prod A:red;Prod B:orange;Prod C:#C0C0C0;Prod D:cyan;Prod E:magenta"/>
</reportElement>
<chartTitle/>
<chartSubtitle/>
<chartLegend/>
</chart>
<pieDataset>
<dataset>
<datasetRun subDataset="dataset1" uuid="defb6b72-f89f-41b6-9543-dc33707423f0"/>
</dataset>
<keyExpression><![CDATA[$F{prod_name}]]></keyExpression>
<valueExpression><![CDATA[$F{prod_value}]]></valueExpression>
</pieDataset>
<piePlot>
<plot/>
<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
</piePlot>
</pieChart>
<rectangle>
<reportElement x="274" y="40" width="5" height="520" backcolor="#666666" uuid="e6ec8535-244d-4544-8b06-0f79c3b3c271"/>
</rectangle>
</band>
</title>
<pageFooter>
<band height="54" splitType="Stretch">
<textField>
<reportElement x="0" y="34" width="274" height="20" uuid="9abf3ba8-865f-46d4-89e3-0df53eb382a2"/>
<textFieldExpression><![CDATA["Author: Matt Dahlman"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="274" y="34" width="279" height="20" uuid="ff490c0b-4ff5-47f9-a19b-b730157e0e30"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Copyright Jaspersoft Corporation"]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>

AttachmentSize
File chartcustomizers2.jar10.4 KB
Feedback