Uploaded image for project: 'FlightPath'
  1. FlightPath
  2. FLPATH-278

CI: Verify build sanity when dependencies are modified

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Undefined Undefined
    • v1.0.17
    • None
    • parodos-backend
    • None

      When a new dependency is added to the project, it might cause the service not to start properly if the version is outdated.

      For instance, an obsolete Jira client version led to the EntityManager with Postgres jdbc driver failing initialization. 

      An example PR to solve that issue:

      https://github.com/parodos-dev/parodos/pull/207

      Logs of the failure:

      2023-04-04 12:15:03.022 INFO 1261792 — [ main] c.r.p.w.r.BeanWorkFlowRegistryImpl : >> Detected 14 WorkFlow and 20 workFlowTasks from the Bean Registry
      2023-04-04 12:15:03.093 WARN 1261792 — [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'workFlowDelegate' defined in URL [jar:file:/home/masayag/work/parodos/workflow-service/target/workflow-service-1.0.7-SNAPSHOT.jar!/BOOT-INF/classes!/com/redhat/parodos/workflow/WorkFlowDelegate.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'beanWorkFlowRegistryImpl': Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workFlowCheckerMappingDefinitionRepository' defined in com.redhat.parodos.workflow.definition.repository.WorkFlowCheckerMappingDefinitionRepository defined in @EnableJpaRepositories declared on JpaRepositoriesRegistrar.EnableJpaRepositoriesConfiguration: Cannot resolve reference to bean 'jpaMappingContext' while setting bean property 'mappingContext'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaMappingContext': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Failed to asynchronously initialize native EntityManagerFactory: java.lang.NoSuchMethodError: 'com.google.common.collect.Range com.google.common.collect.Range.closedOpen(java.lang.Comparable, java.lang.Comparable)'
      2023-04-04 12:15:03.093 INFO 1261792 — [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
      2023-04-04 12:15:03.093 WARN 1261792 — [ main] o.s.b.f.support.DisposableBeanAdapter : Invocation of destroy method failed on bean with name 'entityManagerFactory': java.lang.IllegalStateException: Failed to asynchronously initialize native EntityManagerFactory: java.lang.NoSuchMethodError: 'com.google.common.collect.Range com.google.common.collect.Range.closedOpen(java.lang.Comparable, java.lang.Comparable)'
      2023-04-04 12:15:03.094 INFO 1261792 — [ main] com.zaxxer.hikari.HikariDataSource : ${DATASOURCE_NAME} - Shutdown initiated...
      2023-04-04 12:15:03.099 INFO 1261792 — [ main] com.zaxxer.hikari.HikariDataSource : ${DATASOURCE_NAME} - Shutdown completed.
      2023-04-04 12:15:03.101 INFO 1261792 — [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
      2023-04-04 12:15:03.118 INFO 1261792 — [ main] ConditionEvaluationReportLoggingListener :Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
      2023-04-04 12:15:03.132 ERROR 1261792 — [ main] o.s.b.d.LoggingFailureAnalysisReporter :***************************
      APPLICATION FAILED TO START
      ***************************Description:An attempt was made to call a method that does not exist. The attempt was made from the following location:io.hypersistence.utils.hibernate.type.range.guava.PostgreSQLGuavaRangeType.<clinit>(PostgreSQLGuavaRangeType.java:57)The following method did not exist:'com.google.common.collect.Range com.google.common.collect.Range.closedOpen(java.lang.Comparable, java.lang.Comparable)'The method's class, com.google.common.collect.Range, is available from the following locations:jar:file:/home/masayag/work/parodos/workflow-service/target/workflow-service-1.0.7-SNAPSHOT.jar!/BOOT-INF/lib/guava-10.0.1.jar!/com/google/common/collect/Range.classThe class hierarchy was loaded from the following locations:com.google.common.collect.Range: jar:file:/home/masayag/work/parodos/workflow-service/target/workflow-service-1.0.7-SNAPSHOT.jar!/BOOT-INF/lib/guava-10.0.1.jar!/Action:Correct the classpath of your application so that it contains a single, compatible version of com.google.common.collect.Range

      This issue should have been detected by the CI, but it wasn't.

       

            eloycoto Eloy Coto
            masayag@redhat.com Moti Asayag
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: