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

Autowiring a GemfireTemplate into the application is not working in all cases #55

Closed
kohlmu-pivotal opened this issue Sep 18, 2019 · 2 comments
Assignees
Milestone

Comments

@kohlmu-pivotal
Copy link

kohlmu-pivotal commented Sep 18, 2019

Autowiring the {{o.s.d.g.GemfireTemplate}} as per the documentation does not work as documented.

Seems it has to do with the lazy initialization of the Region. If the Repository is annotated wit DependsOn("Customers"), then the problem is resolved.

@Repository
public class DemoRepository {

	@Autowired
	@Qualifier("customersTemplate")
	private GemfireTemplate customersTemplate;

	public void putData(String key, String value) {
		customersTemplate.put(key, value);
	}
}

Fails with:

Description:

Field customersTemplate in com.example.demo.client.repo.DemoRepository required a bean of type 'org.springframework.data.gemfire.GemfireTemplate' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.data.gemfire.GemfireTemplate' in your configuration.
@jxblum jxblum added the bug label Sep 18, 2019
@jxblum jxblum changed the title Autowiring a GemFireTemplate into App does not work Autowiring a GemfireTemplate into the application is not working in all cases Sep 18, 2019
@jxblum jxblum self-assigned this Sep 18, 2019
@jxblum jxblum added this to the 1.2.0.M3 milestone Sep 19, 2019
@jxblum jxblum changed the title Autowiring a GemfireTemplate into the application is not working in all cases Autowiring a GemfireTemplate into the application is not working in all cases. Sep 20, 2019
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
… minimize issues when auto-wiring templates into application components.

Resolves spring-projectsgh-55.
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
@jxblum jxblum closed this as completed in af35414 Sep 20, 2019
@jxblum
Copy link
Contributor

jxblum commented Sep 20, 2019

Need to merge to the 1.1.x branch for the 1.1.2.RELEASE.

@jxblum jxblum reopened this Sep 20, 2019
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
… minimize issues when auto-wiring templates into application components.

Resolves spring-projectsgh-55.
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
… minimize issues when auto-wiring templates into application components.

Resolves spring-projectsgh-55.
jxblum added a commit to jxblum/spring-boot-data-geode that referenced this issue Sep 20, 2019
@jxblum jxblum added fixed and removed in-progress labels Sep 20, 2019
@jxblum
Copy link
Contributor

jxblum commented Sep 20, 2019

Merged to branch 1.1.x for the 1.1.2.RELEASE.

@jxblum jxblum closed this as completed Sep 20, 2019
@jxblum jxblum changed the title Autowiring a GemfireTemplate into the application is not working in all cases. Autowiring a GemfireTemplate into the application is not working in all cases Sep 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants