Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-1291

Creating a default cache for Jobs Service if none is found

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • 0.9.0
    • 0.7.1
    • Job Service
    • None
    • Hide

      Just deploy it on Openshift with "infinispan.UseKogitoInfra=true" attribute.

      Show
      Just deploy it on Openshift with "infinispan.UseKogitoInfra=true" attribute.

      When deploying Jobs Service on OpenShift and having it connected to a brand new Infinispan installation, the following error is raised:

      2020-02-26 20:25:20,079 jobs-service-6d89c89c44-qnmnl WARN  [org.infinispan.HOTROD:335] (HotRod-client-async-pool-1-1) ISPN004005: Error received from the server: org.infinispan.server.hotrod.CacheNotFoundException: Cache with name 'SCHEDULED_JOBS' not found amongst the configured caches
      2020-02-26 20:25:20,081 jobs-service-6d89c89c44-qnmnl ERROR [io.quarkus.application:214] (main) Failed to start application: java.lang.IllegalArgumentException: cache parameter cannot be null
      	at org.infinispan.client.hotrod.Search.getQueryFactory(Search.java:20)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository.<init>(InfinispanJobRepository.java:62)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_Bean.create(InfinispanJobRepository_Bean.zig:166)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_Bean.create(InfinispanJobRepository_Bean.zig:76)
      	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:80)
      	at io.quarkus.arc.impl.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:99)
      	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
      	at io.quarkus.arc.impl.ComputingCache.getValue(ComputingCache.java:41)
      	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:25)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_ClientProxy.arc$delegate(InfinispanJobRepository_ClientProxy.zig:438)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_ClientProxy.findByStatus(InfinispanJobRepository_ClientProxy.zig:218)
      	at org.kie.kogito.jobs.service.repository.impl.JobRepositoryDelegate.findByStatus(JobRepositoryDelegate.java:84)
      	at org.kie.kogito.jobs.service.repository.impl.JobRepositoryDelegate_ClientProxy.findByStatus(JobRepositoryDelegate_ClientProxy.zig:314)
      	at org.kie.kogito.jobs.service.scheduler.JobSchedulerManager.loadScheduledJobs(JobSchedulerManager.java:46)
      	at org.kie.kogito.jobs.service.scheduler.JobSchedulerManager_Observer_loadScheduledJobs_9002720dcbf935f99e8382cc4acef4c2e216fd5f.notify(JobSchedulerManager_Observer_loadScheduledJobs_9002720dcbf935f99e8382cc4acef4c2e216fd5f.zig:111)
      	at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:224)
      	at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:65)
      	at io.quarkus.arc.runtime.LifecycleEventRunner.fireStartupEvent(LifecycleEventRunner.java:23)
      	at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:108)
      	at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent34.deploy_0(LifecycleEventsBuildStep$startupEvent34.zig:77)
      	at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent34.deploy(LifecycleEventsBuildStep$startupEvent34.zig:36)
      	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:193)
      	at io.quarkus.runtime.Application.start(Application.java:87)
      	at io.quarkus.runtime.Application.run(Application.java:210)
      	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
      
      2020-02-26 20:25:21,151 jobs-service-6d89c89c44-qnmnl INFO  [io.smallrye.reactive.messaging.extension.MediatorManager:121] (main) Cancel subscriptions
      Exception in thread "main" java.lang.RuntimeException: Failed to start quarkus
      	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:223)
      	at io.quarkus.runtime.Application.start(Application.java:87)
      	at io.quarkus.runtime.Application.run(Application.java:210)
      	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:41)
      Caused by: java.lang.IllegalArgumentException: cache parameter cannot be null
      	at org.infinispan.client.hotrod.Search.getQueryFactory(Search.java:20)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository.<init>(InfinispanJobRepository.java:62)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_Bean.create(InfinispanJobRepository_Bean.zig:166)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_Bean.create(InfinispanJobRepository_Bean.zig:76)
      	at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:80)
      	at io.quarkus.arc.impl.ComputingCache$CacheFunction.lambda$apply$0(ComputingCache.java:99)
      	at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
      	at io.quarkus.arc.impl.ComputingCache.getValue(ComputingCache.java:41)
      	at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:25)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_ClientProxy.arc$delegate(InfinispanJobRepository_ClientProxy.zig:438)
      	at org.kie.kogito.jobs.service.repository.infinispan.InfinispanJobRepository_ClientProxy.findByStatus(InfinispanJobRepository_ClientProxy.zig:218)
      	at org.kie.kogito.jobs.service.repository.impl.JobRepositoryDelegate.findByStatus(JobRepositoryDelegate.java:84)
      	at org.kie.kogito.jobs.service.repository.impl.JobRepositoryDelegate_ClientProxy.findByStatus(JobRepositoryDelegate_ClientProxy.zig:314)
      	at org.kie.kogito.jobs.service.scheduler.JobSchedulerManager.loadScheduledJobs(JobSchedulerManager.java:46)
      	at org.kie.kogito.jobs.service.scheduler.JobSchedulerManager_Observer_loadScheduledJobs_9002720dcbf935f99e8382cc4acef4c2e216fd5f.notify(JobSchedulerManager_Observer_loadScheduledJobs_9002720dcbf935f99e8382cc4acef4c2e216fd5f.zig:111)
      	at io.quarkus.arc.impl.EventImpl$Notifier.notify(EventImpl.java:224)
      	at io.quarkus.arc.impl.EventImpl.fire(EventImpl.java:65)
      	at io.quarkus.arc.runtime.LifecycleEventRunner.fireStartupEvent(LifecycleEventRunner.java:23)
      	at io.quarkus.arc.runtime.ArcRecorder.handleLifecycleEvents(ArcRecorder.java:108)
      	at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent34.deploy_0(LifecycleEventsBuildStep$startupEvent34.zig:77)
      	at io.quarkus.deployment.steps.LifecycleEventsBuildStep$startupEvent34.deploy(LifecycleEventsBuildStep$startupEvent34.zig:36)
      	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:193)
      	... 3 more
      

      This is happening because the default cache is not found. We could implement something like we are doing with Data Index:

      https://github.com/kiegroup/kogito-apps/blob/master/data-index/data-index-storage/data-index-storage-infinispan/src/main/java/org/kie/kogito/index/infinispan/cache/InfinispanCacheManager.java#L92-L110

              tdolphin-1 Tiago Dolphine (Inactive)
              rhn-support-zanini Ricardo Zanini
              Karel Suta, Tristan Radisson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: