You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Carlos Fau (Jira)" <ji...@apache.org> on 2022/10/27 19:59:00 UTC

[jira] [Commented] (FINERACT-1789) retriveSchedulerDetail fails with Array index out of range: 0 on MySQL

    [ https://issues.apache.org/jira/browse/FINERACT-1789?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17625305#comment-17625305 ] 

Carlos Fau commented on FINERACT-1789:
--------------------------------------

PR available: https://github.com/apache/fineract/pull/2712

> retriveSchedulerDetail fails with Array index out of range: 0 on MySQL
> ----------------------------------------------------------------------
>
>                 Key: FINERACT-1789
>                 URL: https://issues.apache.org/jira/browse/FINERACT-1789
>             Project: Apache Fineract
>          Issue Type: Bug
>          Components: Job Scheduler
>    Affects Versions: 1.7.0
>         Environment: Server OS: azul/zulu-openjdk-alpine:17 on docker container
> Database version: MySQL 8.0.26 
> Database driver: org.mariadb.jdbc:mariadb-java-client:2.7.5
>            Reporter: Carlos Fau
>            Priority: Critical
>
> h3. Description:
> When starting a new Fineract instance theĀ 
> *JobRegisterServiceImpl* loads all jobs callingĀ *SchedularWritePlatformServiceJpaRepositoryImpl.retriveSchedulerDetail* which found no {*}SchedulerDetail{*}.
> Assuming that the JPA *findAll* will return a *null* response if no records found, it checks that and gets the first element of the returned array.
> {code:java}
> final List<SchedulerDetail> schedulerDetailList = this.schedulerDetailRepository.findAll();
> if (schedulerDetailList != null) {
> schedulerDetail = schedulerDetailList.get(0);
> }{code}
> The problem is that some JSP + Driver + Database instead of returning *null* when no records are found, it returns an empty array.
> h3. Steps to reproduce
>  # Install mysql 8.0.26 (or use instance from GCE)
>  # Deploy fineract on K8S
>  # Fineract POD fails to start
> h3. Notes
> If confirmed I can provide a PR.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)