Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Class cast exception calling JFreeReport component

  1. #1
    Join Date
    May 2008
    Posts
    3

    Default Class cast exception calling JFreeReport component

    Hi,

    I'm currently evaluating Pentaho and am having a problem running a report (created with Report Designer) via an action script in the 1.70 PCI.


    Error: org.pentaho.actionsequence.dom.ActionInputConstant cannot be cast to org.pentaho.actionsequence.dom.ActionInput (org.pentaho.plugin.jfreereport.JFreeReportComponent)

    I've debugged through the code and it seems to be an incompatibility between the action sequence dom jar and the JFreeReport component which is expecting a certain class to be returned by (ActionInput)jFreeReportAction.getData();

    Can anyone suggest what might be causing this?

    thanks

    Lee

    here is my action script:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <action-sequence> 
      <title>Send Email</title>
      <version>1</version>
      <logging-level>DEBUG</logging-level>
      <documentation> 
        <author>Joe Pentaho</author>  
        <description>Sample sequence for sending an email</description>  
        <help>%help</help>  
        <result-type>rule</result-type>  
        <icon>HelloEmail.png</icon> 
      </documentation>
    
      <inputs> 
        <to type="string"> 
          <sources> 
            <request>to</request>
          </sources>  
          <default-value/> 
        </to>  
        <countryfilter type="property-map"> 
          <default-value type="property-map">
            <property-map>
              <entry key="0">All Countries</entry>
            </property-map>
          </default-value>  
          <sources>
            <request>countryfilter</request>
          </sources>
        </countryfilter> 
      </inputs>
    
      <outputs> 
        <outputmessage type="string"> 
          <destinations> 
            <response>outputmessage</response> 
          </destinations> 
        </outputmessage> 
      </outputs>
    
      <resources> 
        <report-definition> 
          <solution-file> 
            <location>/reports/ClientsByCountry.xml</location>  
            <mime-type>text/plain</mime-type> 
          </solution-file> 
        </report-definition> 
      </resources>
      
      <actions> 
        <action-definition> 
          <component-name>SQLLookupRule</component-name>
          <action-type>Relational</action-type>
          <action-outputs> 
            <query-result type="result-set" mapping="countries"/>  
            <CountryID type="integer"/>  
            <Country type="string"/> 
          </action-outputs>
          <component-definition> 
            <jndi><![CDATA[Beta]]></jndi>  
            <query><![CDATA[Select 0 as CountryID, 'All' as Country from GeoCountries
    union
    Select CountryID, Country from GeoCountries]]></query>  
            <live><![CDATA[false]]></live> 
          </component-definition> 
        </action-definition>
      
        <action-definition> 
          <component-name>SecureFilterComponent</component-name>
          <action-type>Prompt/Secure Filter</action-type>
          <action-inputs> 
            <to type="string"/>  
            <countryfilter type="property-map"/>  
            <countries type="result-set"/> 
          </action-inputs>
          <component-definition> 
            <selections> 
              <to filter="none" style="text-box"> 
                <title>Email Address</title> 
              </to>  
              <countryfilter style="select"> 
                <filter value-col-name="CountryID" display-col-name="Country">countries</filter>  
                <title>Country Filter</title> 
              </countryfilter> 
            </selections> 
          </component-definition> 
        </action-definition>
      
        <action-definition> 
          <component-name>JFreeReportComponent</component-name>
          <action-type>ClientsByCountry</action-type>
          <action-inputs> 
            <countryfilter type="property-map"/> 
          </action-inputs>
          <action-outputs> 
            <report-output type="content" mapping="report"/> 
          </action-outputs>
          <component-definition> 
            <output-type>html</output-type> 
          </component-definition> 
        </action-definition>
      
        <action-definition> 
          <component-name>org.pentaho.plugin.email.EmailComponent</component-name>
          <action-type>Send Email</action-type>
          <action-inputs> 
            <to type="string"/>  
            <report type="content"/> 
          </action-inputs>
          <action-outputs/>
          <component-definition> 
            <message-plain><![CDATA[The Clients by Country report is attached to this email.
    
    regards
    
    Allotz Reporting System]]></message-plain>  
            <subject><![CDATA[Client Listing by Country]]></subject>  
            <from><![CDATA[reporting@allotz-dev.com]]></from>  
            <attachment-ref name-param="attach_name_1" input-param="report"/>  
            <attach_name_1><![CDATA[report]]></attach_name_1> 
          </component-definition> 
        </action-definition>
      
        <action-definition> 
          <component-name>UtilityComponent</component-name>
          <action-type>Formatted Message</action-type>
          <action-outputs> 
            <formatted-msg type="string" mapping="outputmessage"/> 
          </action-outputs>
          <component-definition> 
            <format> 
              <format-string>The report has been sent successfully.</format-string>  
              <return>formatted-msg</return> 
            </format> 
          </component-definition> 
        </action-definition>
     
      </actions> 
    </action-sequence>

  2. #2

    Default

    FYI, I've upgraded to 1.7 GA and hit the same problem with and old report.
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: chat.freenode.net Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(http://analytical-labs.com)

    http://mattlittle.files.wordpress.co...-bananaman.jpg

  3. #3
    Join Date
    May 2008
    Posts
    3

    Default

    Good to know I'm not alone

    Quote Originally Posted by bugg_tb View Post
    FYI, I've upgraded to 1.7 GA and hit the same problem with and old report.

  4. #4

    Default

    Ah but you are now I created these reports ages ago with report wizard, looks like 1.7 doesn't like the report component it created. I deleted the report component and some corrupt sql and reinserted the 2 components and it started working.

    Tom
    This is a signature.... everyone gets it.

    Join the Unofficial Pentaho IRC channel on freenode.
    Server: chat.freenode.net Channel: ##pentaho

    Please try and make an effort and search the wiki and forums before posting!
    Checkout the Saiku, the future of Open Source Interactive OLAP(http://analytical-labs.com)

    http://mattlittle.files.wordpress.co...-bananaman.jpg

  5. #5
    Join Date
    Jul 2008
    Posts
    14

    Default

    Hi,

    I'm having the same problem. However I've only ever been using 1.7. For some reason when I go to publish I get a ClassCastException saying that it cannot Cast an ActionInput to an ActionInputConstant and fails messily.

    Can I ask what was corrupted about the report component and the SQL that caused the problem.

    Thanks,

    Grant

  6. #6
    Join Date
    Jul 2008
    Posts
    14

    Default

    Here's the stack trace that appears. The thing is I haven't configured the report to have any parameters.

    Code:
    org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.PublishException: org.pentaho.actionsequence.dom.ActionInputConstant cannot be cast to org.pentaho.actionsequence.dom.ActionInput
        at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.JFreeReportFileExporter.exportReport(JFreeReportFileExporter.java:330)
        at org.pentaho.reportdesigner.crm.report.commands.PublishToLocationCommand$3.run(PublishToLocationCommand.java:338)
        at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassCastException: org.pentaho.actionsequence.dom.ActionInputConstant cannot be cast to org.pentaho.actionsequence.dom.ActionInput
        at org.pentaho.actionsequence.dom.actions.JFreeReportAction.getSubreportQueryParams(JFreeReportAction.java:751)
        at org.pentaho.actionsequence.dom.actions.JFreeReportAction.setSubReportQueryParams(JFreeReportAction.java:762)
        at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.XActionHelper.finishProcessing(XActionHelper.java:191)
        at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.XActionHelper.getXActionFile(XActionHelper.java:350)
        at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.JFreeReportFileExporter.exportReport(JFreeReportFileExporter.java:267)
        ... 2 more
    Code:
    org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.PublishException: org.pentaho.actionsequence.dom.ActionInputConstant cannot be cast to org.pentaho.actionsequence.dom.ActionInput
            at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.JFreeReportPublishOnServerExporter.exportReport(JFreeReportPublishOnServerExporter.j
    ava:433)
            at org.pentaho.reportdesigner.crm.report.commands.PublishToServerCommand$1.run(PublishToServerCommand.java:310)
            at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassCastException: org.pentaho.actionsequence.dom.ActionInputConstant cannot be cast to org.pentaho.actionsequence.dom.ActionInput
            at org.pentaho.actionsequence.dom.actions.JFreeReportAction.getSubreportQueryParams(JFreeReportAction.java:751)
            at org.pentaho.actionsequence.dom.actions.JFreeReportAction.setSubReportQueryParams(JFreeReportAction.java:762)
            at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.XActionHelper.finishProcessing(XActionHelper.java:191)
            at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.XActionHelper.getXActionFile(XActionHelper.java:350)
            at org.pentaho.reportdesigner.crm.report.reportexporter.jfreereport.JFreeReportPublishOnServerExporter.exportReport(JFreeReportPublishOnServerExporter.j
    ava:359)
            ... 2 more
    Last edited by voidhawc; 07-30-2008 at 10:45 PM. Reason: adding additional stack trace

  7. #7
    Join Date
    Jul 2006
    Posts
    14

    Lightbulb figured out

    I had the same problem deploying a parametrized report from ReportDesigner. The reason was the 'query name' specified in 'query details' : if you set a custom name
    the errors occurs;if you leave unaltered the default name (which is 'default') then you have no problem.
    Pretty strange....

  8. #8

    Default

    Quote Originally Posted by eccoilmoro View Post
    I had the same problem deploying a parametrized report from ReportDesigner. The reason was the 'query name' specified in 'query details' : if you set a custom name
    the errors occurs;if you leave unaltered the default name (which is 'default') then you have no problem.
    Pretty strange....
    Hey man,

    It worked for me. I had the following error:
    ClassCastException: org.pentaho.actionsequence.dom.ActionInputConstant cannot be cast to org.pentaho.actionsequence.dom.ActionInput

    I solved it changing my query name to default at Query Details on Pentaho Report Designer, thanks for your help man.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.