Jump to content

How to deploy a report with scriptlet class


kschmitte

Recommended Posts

Hi all,

 

I have created a report with a small scriptlet in iReport. Report runs fine in iReport.

Now I want to deploy the report in JasperServer 2.

But - I don't know how to connect the report to the scriptlet.

I tried to put the scriptlet in a jar file and add the jar to the "Resources" section of my Report Unit. When I run this from JasperServer I get a message which doesn't help at all. When I run the report from within the iReport JasperServer plugin, I get the message that the class could not be found:

java.lang.Exception: 1 - Report design not valid : 1. java.lang.ClassNotFoundException: quarterlyExchangedMailScriptlet

 

A research in this forum showed me no helpful article.

 

A restart of the machine JasperServer is running on (was needed anyway) did not change the behaviour.

 

What am I doing wrong?

Do I need to obey some naming schema? Or something else?

 

Thanks for any help!

 

Kai

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

So, now I went little further with my investigations:

1) I needed to put the *.class and *.java files in the root of the JAR file. Otherwise the report could not be validated in JasperServer and the addition of the JAR was not successful.

2) I needed to add the iReport.jar to the Tomcat where I run JasperServer 2 on.

 

But, then - again no way to get further:

From iReport I get:

java.lang.Exception: 1 - Report design not valid : 1. java.lang.ClassNotFoundException: QuarterlyExchangedMail_jrxml_1190130107948Scriptlet at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:382) at com.jaspersoft.jasperserver.irplugin.wsclient.WSClient.runReport(WSClient.java:299) at com.jaspersoft.jasperserver.irplugin.ReportRunner.run(ReportRunner.java:73) at java.lang.Thread.run(Unknown Source)

This seems as if the mechanism of running reports from the PlugIn in iReport is not capable of using scriptlets.

 

and in JasperServer the message is:

java.io.NotSerializableException: net.sf.jasperreports.engine.design.JRValidationFault

java.io.NotSerializableException: net.sf.jasperreports.engine.design.JRValidationFault
at java.io.ObjectOutputStream.writeObject0(Unknown Source)
at java.io.ObjectOutputStream.writeObject(Unknown Source)
at java.util.ArrayList.writeObject(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[...]

 

Has anyone an idea how to get around this?

 

Does this work at all?

Or are scriptlets only for iReport exceution?

Link to comment
Share on other sites

  • 7 months later...

I am receiving the exact same message and I cannot bypass. Scriptlet works fine in iReport but deployed as above and I receive the exact same message.

 

Did you manage to solve this error? Scriptlets are very poorly documented!

Link to comment
Share on other sites

I have stopped development of scriplets and moved everything into a simple JAR.

This jar is part of my JasperServer Repository and needs to be linked as resource for every report.

 

For iReport I need to keep the java *.class and *.java files in the folder where the report jrxml is stored - then I don't need to change anything in iReport or the report itself.

 

Gruss

 

Kai Schmitte

Link to comment
Share on other sites

  • 1 month later...

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...