chsam27 Posted March 26, 2018 Share Posted March 26, 2018 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-scriptletBelow 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 More sharing options...
Solution Friendly User Posted March 27, 2018 Solution Share Posted March 27, 2018 Hey, I would suggest following this video tutorial for scriptlets in JasperServer: In your case I'd try to upload scriptlet as a report resource instead of adding it to lib. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now