Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GenericApplicationContext the default ApplicationContext class for non-webapp #14590

Closed
dsyer opened this issue Sep 24, 2018 · 3 comments
Closed

Comments

@dsyer
Copy link
Member

dsyer commented Sep 24, 2018

GenericApplicationContext is arguably a better choice these days and all the default webapp context types used by Boot are GenericApplicationContext, so it would make things (by default) uniform and more predictable. It would simplify the job of anyone trying to add ApplicationContextInitializers with functional bean definitions.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 24, 2018
@dsyer dsyer changed the title Make default ApplicationContext class for non-webapp GenericApplicationContext Make GenericApplicationContext the default ApplicationContext class for non-webapp Sep 24, 2018
@philwebb
Copy link
Member

The default is currently AnnotationConfigApplicationContext which extends GenericApplicationContext. This works:

SpringApplication application = new SpringApplication(ScratchApplication.class);
application.setWebApplicationType(WebApplicationType.NONE);
GenericApplicationContext run = (GenericApplicationContext) application.run(args);

Is AnnotationConfigApplicationContext doing too much or causing some other issues?

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Sep 24, 2018
@dsyer
Copy link
Member Author

dsyer commented Sep 24, 2018

I don't think it was always a GenericApplicationContext, was it (maybe I am misremembering)? Anyway it has a built in AnnotatedBeanDefinitionReader which is too much for anything that doesn't want to use @Configuration or wants to control it a bit more. Probably this can be rolled up into #8115.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Sep 24, 2018
@spring-projects spring-projects deleted a comment from philwebb Sep 24, 2018
@philwebb
Copy link
Member

philwebb commented Oct 1, 2018

I've added a comment to #8115.

@philwebb philwebb closed this as completed Oct 1, 2018
@philwebb philwebb removed status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants