Jump to content
Changes to the Jaspersoft community edition download ×

  • djohnson53
    • Features: JasperReports Server, Scheduler Version: v8 Product: JasperReports® Server

    Introduction

    To leverage this capability to the greatest extent, it is important to get familiar with configurability of this feature. This tutorial covers some of the most commonly used configuration parameters associated with the scheduling feature.

    Objectives

    This guide will enable you to:

    Pre-Requisites

    • Access to the file system of and the ability to stop and start an operational installation of JasperReports Server
    • Access to a running outbound mail server.

    Setting Up the Connection to your Outbound Email Server

    In order for the scheduler to successfully send email notifications and distribute reports, it must be configured to connect to an outbound email server.

    StepAction

    1

    Open the following configuration file in your preferred text editor: /WEB-INF/js.quartz.properties

    2

    Set the value for the mail.sender.host property to your outbound mail server.

    Example: report.scheduler.mail.sender.host=outbound.yourdomain.com

    3

    Set the value for the mail.sender.protocol property to the protocol used by your outbound mail server.

    Example: report.schedulers.mail.sender.protocol=smtp

    4

    Set the value for the mail.sender.port property to the port that your outbound mail server listens on.

    Example: report.schedler.mail.sender.port=25

    5

    Set the mail.sender.username and mail.sender.password properties using valid login credentials to your outbound mail server.

    Example: report.scheduler.mail.sender.username=myusername report.scheduler.mail.sender.password=mypassword

    6

    Restart JasperReports Server for the configurations to take effect.

    Setting the Outbound Email Address for the Scheduler

    When the scheduler sends out emails, these emails need to come from a specific email address as the sender. This should be a valid email that is monitored for email bounce backs, etc. so that appropriate action can be taken.

    The following steps cover how to define the email address that should be used as the sender of emails coming from the scheduler jobs.

    StepAction

    1

    Open the following configuration file in your preferred text editor: /WEB-INF/js.quartz.properties

    2

    Set the value for the mail.sender.from property to the email address you would like emails to come from.

    Example: report.scheduler.mail.sender.from=yourname@yourdomain.com

    3

    Restart JasperReports Server for the configurations to take effect.

    Defining the URI for Emailed Report Links

    When a link to a report is sent out in an email from a scheduler job, this link must refer the user back to the appropriate place on the server to access the output. In order for this to occur, the scheduler must be aware of the URI for JasperReports Server.

    Example: If the default login page for JasperReports Server is accessed by going to http://www.yourdomain.com/jasperserver-pro/login.html, the URI for the scheduler should be set to http://www.yourdomain.com/jasperserver-pro.

    The following steps outline how to set the URI properly.

    StepAction

    1

    Open the following configuration file in your preferred text editor: /WEB-INF/js.quartz.properties

    2

    Set the value for the web.deployment.uri property to the URI for your JasperReports Server installation.

    Example: report.scheduler.web.deployment.uri=http://www.yourdomain.com/jasperserver-pro

    3

    Restart JasperReports Server for the configurations to take effect.

    Defining the Number of Scheduler Threads per Server

    In order to keep the scheduler jobs from using too many resources on a particular server, it is important to control the number of threads used to process scheduled jobs.

    • The thread count controls the maximum number of concurrent scheduler jobs that will run on a server at once.
    • Increasing this count increases the throughput of schedules that can be processed, but may adversely impact the resources available for end-users that are interacting directly with the application.

    The following steps cover how to configure the number of threads per server that will process scheduled jobs.

    StepAction

    1

    Open the following configuration file in your preferred text editor: /WEB-INF/js.quartz.base.properties

    2

    Set the value for the threadPool.threadCount property to the number of threads you want to process schedule jobs per server.

    Example: org.quartz.threadPool.threadCount=3

    3

    Restart JasperReports Server for the configurations to take effect.

    Defining the Job Misfire Threshold

    The misfire threshold sets the amount of time that can pass before a missed or delayed scheduler job is skipped.

    • Increasing the misfire threshold will allow reports to run even if schedules are delayed due to server downtime or a backlog of jobs scheduled at the same time.
    • Decreasing this threshold is useful if you have jobs that are scheduled frequently.

    Example: If a report is scheduled every hour, you may not want the 8am report to run if it is already 9am and the 9am report would give you the same information.

    The following steps show how to set the misfire threshold.

    StepAction

    1

    Open the following configuration file in your preferred text editor: /WEB-INF/js.quartz.base.properties

    2

    Set the value for the jobStore.misfireThreshold property to the number of milliseconds beyond the scheduled time that a delayed schedule job should be skipped.

    Example: For 30 minutes, org.quartz.jobStore.misfireThreshold=1800000

    3

    Restart JasperReports Server for the configurations to take effect.

    Disabling the Report Scheduler on a Server

    Under certain circumstances, it may be necessary to disable the report schedules completely on a server.

    Example: It may make sense to have dedicated servers for end users separate from those that execute scheduler jobs.

    The following steps cover how to disable the report scheduler on a particular server.

    StepAction

    1

    Open the following configuration file in your preferred text editor: /WEB-INF/applicationContext-report-scheduling.xml

    2

    Find the following lines:

    3

    Remove the init-method definition – init-method=”start”

    4

    Restart JasperReports Server for the configuration to take effect.

    What's Next?

    JasperReports Server leverages the quartz scheduler to execute scheduled report jobs. For more information on configuring or customizing quartz, please see:


    User Feedback

    Recommended Comments

    1 down vote favorite

    I setup my Jasper Report Server. As well as I already schedule my reports and every things was working fine with me. During the setup, I was using my personal Gmail accounts to share the emails witch associated with gmail.smtp.com

    I changed the SMTP setup to my domain account (Corporate Microsoft Exchange Server) but emails stopped working. I believe there is issue with the SMTP configuration.

    Whenever I change the setup to my personal email, everything working fine but when I swap it to my domain account, which is corporate Microsoft Exchange server, it is not working. My domain account Microsoft outlook base, I believe there should not be any issue. Using same credential, I can access from the web.

    I check following provided URL from Jasper Community and it seems I am following the same. URL: https://community.jaspersoft.com/wiki/configuring-report-scheduler

    What could be the issue?

    Here is the error details, which I got:

    Subject: The job failed to execute. Review its parameters.Date: TodayComponent: Report SchedulerMessage:Job: Immediate Execution2323 (ID: 3889) Report unit: /reports/Paid_Violation_of_last_week_ Quartz Job: ReportJobs.job_3889 Quartz Trigger: ReportJobs.trigger_3886_0 Error Message: There was an error on the server. Try again or contact site administrators. (Error UID: 4d89f7cc-28cc-4d1d-86cb-cd0c764e1348).

    I would appreciate if someone will share his/her experience if he/she face the same before.

     

    Link to comment
    Share on other sites



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