Uploaded image for project: 'Teiid Spring Boot'
  1. Teiid Spring Boot
  2. TEIIDSB-160

Initialization order issue

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.4.0, 1.3.1
    • None
    • core
    • None
    • DV Sprint 58
    • 0.5

      In working with the infinispan translator there is a situation where defining a project that has no relational sources, but uses infinispan and a rest source on startup gives:

      Description:
      
      The bean 'dataSource', defined in class path resource [org/teiid/spring/autoconfigure/TeiidAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Tomcat.class] and overriding is disabled.
      
      Action:
      
      Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
      

      Our starter has a reference to tomcat-jdbc, so that will always be in the classpath making that DataSourceConfiguration eligible.

      The best solution seems to be for the TeiidAutoConfiguration to be marked with

      @AutoConfigureBefore({ DataSourceAutoConfiguration.class })

      so that it will install the primary datasource bean first.

              rhn-engineering-shawkins Steven Hawkins
              rhn-engineering-shawkins Steven Hawkins
              Archiver:
              rhn-support-adandapa Aitik Dandapat (Inactive)

                Created:
                Updated:
                Resolved:
                Archived:

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours
                  2h