Skip to content

AOT processing loses bean aliases #29391

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

Closed
wilkinsona opened this issue Oct 27, 2022 · 0 comments
Closed

AOT processing loses bean aliases #29391

wilkinsona opened this issue Oct 27, 2022 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Oct 27, 2022

Affects: 6.0.0-RC1

See spring-projects/spring-boot#32906 for details. The summary of the problem is that Spring Data Elasticsearch defines a bean like this:

	/**
	 * Creates a {@link ElasticsearchOperations} implementation using an
	 * {@link co.elastic.clients.elasticsearch.ElasticsearchClient}.
	 *
	 * @return never {@literal null}.
	 */
	@Bean(name = { "elasticsearchOperations", "elasticsearchTemplate" })
	public ElasticsearchOperations elasticsearchOperations(ElasticsearchConverter elasticsearchConverter,
			ElasticsearchClient elasticsearchClient) {

		ElasticsearchTemplate template = new ElasticsearchTemplate(elasticsearchClient, elasticsearchConverter);
		template.setRefreshPolicy(refreshPolicy());

		return template;
	}

The AOT-generated code defines a bean named elasticsearchOperations but does not define elasticsearchTemplate as an alias of this bean.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Oct 27, 2022
@sbrannen sbrannen added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Oct 27, 2022
@sbrannen sbrannen added this to the 6.0.0-RC3 milestone Oct 27, 2022
@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing labels Oct 27, 2022
@sdeleuze sdeleuze self-assigned this Oct 30, 2022
snicoll added a commit that referenced this issue Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) theme: aot An issue related to Ahead-of-time processing type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants