Jump to content
We've recently updated our Privacy Statement, available here ×

A report with Scriplet does not run on Jasper Server


chsam27
Go to solution Solved by Friendly User,

Recommended Posts

I am new to Jasper reporting and I have a report with a simple scriplet that only return a string. When previewing it with Jasper studio 6.5.0, I was able to see the results but when I try deploy the same report on my local jasper server, it throws the error:


Caused by: java.lang.ClassCastException: <class> cannot be cast to net.sf.jasperreports.engine.JRAbstractScriptlet
    at net.sf.jasperreports.engine.scriptlets.DefaultScriptletFactory.getScriptlet(DefaultScriptletFactory.java:109)
    ... 178 more]]

I am running the server on Glassfish 4.1.1, included the scriplet jar file in the lib folder and changed the import in the scriplet according to https://community.jaspersoft.com/wiki/classcast-exception-when-running-report-containing-scriptlet

Below is the scriplet:

import net.sf.jasperreports.engine.*;public class DemoScriplet extends JRDefaultScriptlet{        public String getHello() throws JRScriptletException{        return "This is from a scriplet!";    }}[/code]

Has anyone encountered this issue?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...