Is is possilble to have a definitive set of instructions of how to use scriptlets from within Jaspersoft studio. As from one hour to the next I can have it working and then it fails. it is difficult to develop a solution when the product behaves differentlyeach time you start it



clive.haynes_1's picture
Joined: Sep 11 2013 - 6:40am
Last seen: 1 month 1 week ago

2 Answers:

Can you be more specific on how are you using the scriptlets and how they behave differently form one time to the next? If you can post an example it will  be great.

Here are some good examples and tutorials on how scriptlets work: there is also a video about this one

And of course there is nothing like the docs: and

marianol's picture
Joined: Sep 13 2011 - 8:04am
Last seen: 4 years 11 months ago

The problem is that if I follow the same steps for creating a scriptlet from one project to another, then it is a lottery whether the the exact same script is going to to work, more often than not it fails. Maybe after some hours or redefining the scriptlet in the jasper report it might work just once and then fail.

The error I keep getting is as follows

net.sf.jasperreports.engine.JRException: net.sf.jasperreports.engine.JRException: Error loading scriptlet class : MyTest
Caused by: net.sf.jasperreports.engine.JRException: Error loading scriptlet class : MyTest
 at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriptlet(
 at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriplets(
 at net.sf.jasperreports.engine.fill.JRFillDataset.createScriptlets(
 at net.sf.jasperreports.engine.fill.JRFillDataset.setParameterValues(
 at net.sf.jasperreports.engine.fill.BaseReportFiller.setParameters(
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(
 at net.sf.jasperreports.engine.fill.BaseFillHandle$
 at Source)
Caused by: java.lang.ClassNotFoundException: MyTest
 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(
 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
 at org.eclipse.osgi.internal.loader.BundleLoader.findClass(
 at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(
 at java.lang.ClassLoader.loadClass(Unknown Source)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Unknown Source)
 at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(
 at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(
 at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriptlet(
 ... 7 more


This is why I am looking for something that is stable


clive.haynes_1's picture
Joined: Sep 11 2013 - 6:40am
Last seen: 1 month 1 week ago