Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow multiple @Import statements for migration from xml [SPR-17165] #21701
Labels
Milestone
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jeff opened SPR-17165 and commented
In migrating from xml defined configuration java defined configuration, it is not possible to load xml and .class configurations in arbitrary orders. This makes mixing the two somewhat impossible and forces us to stay with the xml configurations. In our case, our xml configs are huge, and migrating them all at once isn't desired.
For example:
The below is the desired configuration. The PropertiesConfig is loaded first, as it loads all property placeholders for use in all of the xml files.
At the end, I'd like to add a MongoConfig.class to add more mongo-spring-data defined beans within the application that reference the beans defined in applicationContext-mongo.xml.
Unfortunately, I can't order the loading of configuration classes between xml and .class files - I have to either load all class files first then all xml files, or load all xml files first, then all class files.
The implementation below gives me the error: "Duplicate annotation of non-repeatable type
@Import
"Please allow spring to have ordered loading of configuration files wheather they are xml or .class configurations by making the Import annotations repeatable, or provide another solution.
No further details from SPR-17165