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

Get ClassCastException when generating report with Struts2


Akshay Jadhav
Go to solution Solved by Akshay Jadhav,

Recommended Posts

 

I put *.jasper* file in my web content folder of my project and in my action class there is only execute method and my *struts.xml* has following code:
 
<!-- language: lang-xml -->
 
    <action name="myJasperTest" class="com.acme.test.action.JasperAction">
    <result name="success" type="jasper">
    <param name="location">/our_jasper_template.jasper</param>
    <param name="dataSource">myList</param>
    <param name="reportParameters">reportParams</param>
    <param name="format">PDF</param>
    </result>
    <result name="error">/Error.jsp</result>
    </action>
 
 
And while running this program it gives me error: 
 
    java.lang.ClassCastException: cannot assign instance of
    net.sf.jasperreports.engine.base.JRBaseStyle to field
    net.sf.jasperreports.engine.base.JRBaseParagraph.paragraphContainer of type
    net.sf.jasperreports.engine.JRParagraphContainer in instance of
    net.sf.jasperreports.engine.base.JRBaseParagraph
 
Can anybody help me how to resolve this problem?
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 2 months 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...