Uploaded image for project: 'Active and Available Inventory'
  1. Active and Available Inventory
  2. AAI-2769

[aai-common] Two Spring Beans with Same Name

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Medium Medium
    • Frankfurt Release
    • None
    • None
    • A&AI Sprint 30

      The aai-common has two beans (ConfigConfiguration,SchemaServiceConfiguration) with same name (schemaVersions)

      Prior to Spring boot v2, spring was internally handling this, but if we upgrade to Springboot v2, we cannot have 2 beans with same name. And it throws below error

       

      Error -

      ***************************

      APPLICATION FAILED TO START

      ***************************

      Description:

      The bean 'schemaVersions', defined in org.onap.aai.config.ConfigConfiguration, could not be registered. A bean with that name has already been defined in org.onap.aai.config.SchemaServiceConfiguration and overriding is disabled.

       Action:

       Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

      "

       

      The following 2 files have same bean name declared "schemaVersions":

         [SchemaServiceConfiguration.java | https://gerrit.onap.org/r/gitweb?p=aai/aai-common.git;a=blob;f=aai-schema-ingest/src/main/java/org/onap/aai/config/SchemaServiceConfiguration.java;h=cdd874929288c8d95445d7f13e79667b8fcddf28;hb=HEAD]

         [ConfigConfiguration.java | https://gerrit.onap.org/r/gitweb?p=aai/aai-common.git;a=blob;f=aai-schema-ingest/src/main/java/org/onap/aai/config/ConfigConfiguration.java;h=e4d18650eb0218849a5dd2c5f95cc29452fddf1d;hb=HEAD]

       

            jimmydot jimmydot
            snehad snehad
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: