[#13656] - Custom ChartCustomizer class are not found by JSS

Category:
Bug report
Priority:
Normal
Status:
Resolved
Project: Severity:
Major
Resolution:
Fixed
Component: Reproducibility:
Always
Assigned to:

Hi Massimo,

as I have already reported in a comment to issue 13591, it looks like JSS 6.17.0 does not find my custom ChartCustomizer classes (added via a jar in a User Library to my project).
The report compiles fine (with your patch for the Function Extension issue), but upon execution I get:

net.sf.jasperreports.engine.JRRuntimeException: Could not create chart customizer instance.
at net.sf.jasperreports.engine.fill.JRFillChart.createAndInitCustomizer(JRFillChart.java:354)
at net.sf.jasperreports.engine.fill.JRFillChart.<init>(JRFillChart.java:320)
at net.sf.jasperreports.engine.fill.JRFillObjectFactory.visitChart(JRFillObjectFactory.java:704)
at net.sf.jasperreports.engine.base.JRBaseChart.visit(JRBaseChart.java:586)
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:95)
at net.sf.jasperreports.engine.fill.JRFillFrame$JRFillFrameElements.<init>(JRFillFrame.java:505)
at net.sf.jasperreports.engine.fill.JRFillFrame.<init>(JRFillFrame.java:99)
at net.sf.jasperreports.engine.fill.JRFillObjectFactory.visitFrame(JRFillObjectFactory.java:1475)
at net.sf.jasperreports.engine.base.JRBaseFrame.visit(JRBaseFrame.java:92)
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:95)
at net.sf.jasperreports.engine.fill.JRFillBand.<init>(JRFillBand.java:129)
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:285)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:82)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:251)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:272)
at net.sf.jasperreports.engine.fill.BaseFillHandle.<init>(BaseFillHandle.java:86)
at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.<init>(AsynchronousFillHandle.java:120)
at net.sf.jasperreports.engine.fill.AsynchronousFillHandle.createHandle(AsynchronousFillHandle.java:244)
at com.jaspersoft.studio.editor.preview.view.control.ReportController$1.run(ReportController.java:441)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.printserver.customizers.SeriesColorCustomizer cannot be found by net.sf.jasperreports_6.17.0.final
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:519)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:171)
at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:208)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:148)
at net.sf.jasperreports.engine.fill.JRFillChart.createAndInitCustomizer(JRFillChart.java:348)
... 26 more

When I execute the jasper file that JSS compiled in "pure" JapserReports Library 6.17 environment it works...

Btw, in the Property Wizard were I can add a Chart Customizer to a chart and were I can enter a class name filter, my class net.sf.jasperreports.printserver.customizers.SeriesColorCustomizer can be found.

So, I guess JSS 6.17.0 has some problems to find custom classes (Function Extension, Chart Customizers, ???)...

Regards,
Michael

v6.17.0
Jaspersoft® Studio
Michael Schmid's picture
Joined: Oct 4 2013 - 9:43am
Last seen: 2 months 2 weeks ago

7 Comments:

#1

Same problem here, any workaround?

#2
  • Status:New» Acknowledged

Hi, I will try to check if I'm able to look into this issue during this week.

Regards,
Massimo.

#3

Hi Massimo,

it would be great if you could solve this issue!
If you need any further information to analyze this, I'll be glad to help, if possible.

Thanks,
Michael

#4

Hi Michael, sorry for late reply but it has been busy times working on other stuff.
I'm attaching here a project that I would like you to give it a try.
Can you please try it, in a fresh new workspace and see if it works fine for you?
Try to play with it like I did in the linked video: I suppose I'm performing similar operations like you.
SCREENCAST LINK: https://www.youtube.com/watch?v=_FesRljE21Q

I think there is probably something related to the project/workspace that in some cases might affect the normal behaviour and resulting in something similar to your situation. I also experienced randomly similar problems in the past. I will give it a try investigating further on this.
If possible can you please attach a minimal setup, project(s) or workspace, where I can verify the problem?

In my video screencast you see a "Professional" version that is similar (a part from the PRO stuff) in the next upcoming Community. I just quickly registered the video with one of latest integration I had available using the clean workspace.

Thanks.
Regards,
Massimo.

AttachmentSize
Package icon myreports.zip35.19 KB
#5
  • Resolution:Open» Fixed
  • Status:Acknowledged» Resolved

Hi Micheal,
can you please test this patch and see if it works fine for you? It should fix your problem.
I found out that the scenario I was showing you yesterday was wrong. This time I tested with an actual customizer class and was able to reproduce.
Apparently it was a kind of regression introduced in the latest releases, similar to the other one related to .class.

You can delete the previous patch (if you had applied it) and put this new one that includes both fixes.
Regards,
Massimo.

P.S: as usual when applying patches if you need it, temporary add the "-clean" flag

#6

Hi Massimo,

GOOD news: I placed the new/second patch in the plugins directory and removed the first patch there.
Then restarted JSS 6.17 with the -clean switch.

And now: My test case with my own ChartCustomizer works just fine.
Perhaps emorgado (Reply #1) could also check, if it work with this patch for him, too.
Also the used FunctionExtension works fine.
So, this patch indeed fixed both issues.

I guess this patch will be included in the 6.18 release, right?

Thanks,
Michael

#7

Sure it will be included in the next upcoming release. Thanks for confirming it works ok for you.

Regards,
Massimo.

Feedback