Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: Problem::Source code modifcation for Report Design Wizard

  1. #1

    Default Problem::Source code modifcation for Report Design Wizard

    One of the requirements of our client was to generate reports on fly by providing sql queries. They were very keen on providing the "query timeout" feature to the reports so as to prevent long running queries. For such long running queries they planned to rerun them after making suitable query optimization and modifications.

    We have made changes to the relevant Pentaho code base to include the query timeout functionality. We have tested this functionality at our end.

    We are also working on the front end part (report design wizard) where user can enter the query timeout value before executing the query.

    Features:
    1) The timeout parameter will set timeout value in "seconds" on the executing query, the lapse of which will stop the query execution on the Database Server, as well as the thread performing the executeQuery.
    2) The code is backward compatible too. Older xaction files created without the timeout parameter will also be supported with a timeout value of 0 i.e no timeout.
    3) The code is independent of the database being used since the setQueryTimeout() method provided by the java.sql.* package is used.

    The action definition would look something like this:

    <action-definition>
    <component-name>SQLLookupRule</component-name>
    <action-type>SQL Query</action-type>
    <action-outputs>
    <query-result mapping="rule-result" type="result-set"/>
    </action-outputs>
    <component-definition>
    <jndi>SampleData</jndi>
    <!-- The Timeout parameter is set here -->
    <timeout>1</timeout>
    <query><![CDATA[SELECT * FROM CUSTOMERS,PAYMENTS,EMPLOYEES]]></query>
    </component-definition>
    </action-definition>

    We thought this functionality would be a great value addition that we can provide to the Pentaho users.

    Have also made changes to the Pentaho Report Designer Wizard Code available from:
    http://source.pentaho.org/svnroot/pentaho-reportwizard/trunk/

    The timeout tags get successfully embedded into the xaction file and after publishing it to pentaho-solutions/samples folder, gets executed successfully on the BI Server.

    However, on clicking the preview button in the report design wizard, I get the following error:

    Registering: org.hsqldb.jdbcDriver
    Registering: com.mysql.jdbc.Driver
    Registering: com.mysql.jdbc.NonRegisteringDriver
    Registering: com.mysql.jdbc.NonRegisteringReplicationDriver
    Registering: com.mysql.jdbc.ReplicationDriver
    Registering: org.gjt.mm.mysql.Driver
    2008/01/28 14:01:05:893 IST [ERROR] Logger - -misc-org.pentaho.core.system.Penta
    hoSystem: PentahoSystem.ERROR_0021 - Could not detemine implementor for IAclVote
    r
    2008/01/28 14:01:05:909 IST [ERROR] Logger - -misc-org.pentaho.core.system.Penta
    hoSystem: PentahoSystem.ERROR_0021 - Could not detemine implementor for ISubscri
    ptionRepository
    2008/01/28 14:01:05:925 IST [WARN] Logger - -misc-org.pentaho.core.system.Pentah
    oSystem: PentahoSystem.ERROR_0021 - Could not detemine implementor for IUITempla
    ter
    2008/01/28 14:01:05:925 IST [WARN] Logger - -misc-org.pentaho.core.system.Pentah
    oSystem: PentahoSystem.ERROR_0021 - Could not detemine implementor for IUserFile
    sComponent
    2008/01/28 14:01:05:925 IST [WARN] Logger - -misc-org.pentaho.core.system.Pentah
    oSystem: PentahoSystem.ERROR_0021 - Could not detemine implementor for IBackgrou
    ndExecution
    2008/01/28 14:01:06:018 IST [WARN] Logger - -misc-org.pentaho.plugin.olap.Mondri
    anSystemListener: Mondrian Property File system\mondrian\mondrian.properties Not
    Found
    2008/01/28 14:01:06:018 IST [ERROR] Logger - -misc-org.pentaho.core.system.Penta
    hoSystem: PentahoSystem.ERROR_0007 - userDetailsRoleListService property of Pent
    ahoSystem has not been set. Make sure that an instance of UserDetailsRoleListSer
    vice is defined in a Spring XML file. Note that UserDetailsRoleListService will
    attach itself automatically to PentahoSystem. It simply needs to be defined in S
    pring.
    [DS]Getting Connection for url: jdbc:mysql://localhost:3306/sampledata
    [DS]Getting Connection for url: jdbc:mysql://localhost:3306/sampledata
    The Timeout set for query is: 0
    Query Execution Finished
    [DS]Getting Connection for url: jdbc:mysql://localhost:3306/sampledata
    [DS]Getting Connection for url: jdbc:mysql://localhost:3306/sampledata
    QueryPanel: When next is clicked: timeout is: 0
    Writing to ./resources/solutions/samples/reporting/JFreeReport-WizardReport.xml
    ReportWizard: query in reportspec isSelect * from customers
    ReportWizard: timeout in reportspec is0
    2008/01/28 14:01:19:628 IST [ERROR] RuntimeContext - -6617331e-cd7b-11dc-86e8-33
    82cf1c2265:RUNTIME:context-19481516-1201509079206:JFreeReport-WizardReport.xacti
    on RuntimeContext.ERROR_0019 - Invalid input parameter "result-output" requested
    during execution of JFreeReport-WizardReport.xaction
    2008/01/28 14:01:19:643 IST [ERROR] JFreeReportComponent - -6617331e-cd7b-11dc-8
    6e8-3382cf1c2265:COMPONENT:context-19481516-1201509079206:JFreeReport-WizardRepo
    rt.xactionBase.ERROR_0002 - Component execution failed
    2008/01/28 14:01:19:643 IST [ERROR] RuntimeContext - -6617331e-cd7b-11dc-86e8-33
    82cf1c2265:RUNTIME:context-19481516-1201509079206:JFreeReport-WizardReport.xacti
    on RuntimeContext.ERROR_0012 - ActionDefinition for JFreeReportComponent did not
    execute successfully
    2008/01/28 14:01:19:659 IST [ERROR] SolutionEngine - -6617331e-cd7b-11dc-86e8-33
    82cf1c2265:SOLUTION-ENGINE:JFreeReport-WizardReport.xaction: SolutionEngine.ERRO
    R_0007 - Action sequence execution failed

    Could you please point me as to the cause of this error.


    Thanks in advance.


    Regards,

    Arijit Chatterjee

  2. #2

    Default Modified files

    The files that I had modified are:
    QueryPanel.java and ReportWizard.java from the pentaho-reportwizard sources from Pentaho SVN Repository and ReportSpec.java and report-spec.xsd from pentah-commons/pentaho-reportwizard-core sources.

  3. #3

    Default Issue resolved

    Issue Resolved for problem with the previewing of reports commented at:
    http://jira.pentaho.org/browse/RDW-88#action_22766

    Cause: Problem in validating the xaction file being created, since the template JFree_ResultSet_template.xaction did not have a timeout tag.

    Workaround: Added dummy SQLLookupRule component as:
    <action-definition>
    <action-inputs/>
    <action-outputs/>
    <component-name>SQLLookupRule</component-name>
    <action-type/>
    <component-definition>
    <jndi/>
    <timeout/>
    <query/>
    </component-definition>
    </action-definition>

    in \resources\solutions\samples\reporting\JFree_ResultSet_template.xaction
    Thanks and Regards,

    Arijit Chatterjee,

    Software Engineer,
    Business Intelligence Competency Centre,
    Persistent Systems Ltd.,
    Pune, India.

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.