Skip to content

我花了很久的时间来跟踪这个问题,希望这段代码能使我的自定义的Environment正常工作 #80

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
wants to merge 1 commit into from

Conversation

johntostring
Copy link

我正在我的项目中尝试spring-data-jpa,然后发现了这个问题,希望这段代码有用,谢谢!

@thomasdarimont
Copy link

Hello John,

thanks for your contribution :) Would you mind to explain what you did and why - in plain english ;-)
From what I see in the code, your change seems to make the Environment configurable that is used for ClassPathScanningCandidateComponentProvider, you do you need that? To use custom profiles that are set in the environment?

Cheers,
Thomas

@odrotbohm
Copy link
Member

I think I got what he's shooting for and filed DATACMNS-492. More sophisticated implementation coming, but thanks for the submission and making us aware of the issue!

@odrotbohm odrotbohm closed this Apr 29, 2014
odrotbohm added a commit that referenced this pull request Apr 29, 2014
…ment.

Added a constructor to RepositoryConfigurationDelegate that takes an additional Environment instance to make sure we can equip ClasspathScanningCandidateComponentProviders with Environments to make sure they only find components matching the environment.

Retain the old constructor by defaulting to the Environment the ResourceLoader potentially contains or even a StandardEnvironment in worse cases. This is primarily to not break existing clients. Those should be upgraded to use the new constructor, of course.

Needed to add an additional guard in BeanDefinitionRegistrarSupport as Spring 3.2.8 fails to invoke EnvironmentAware (filed SPR-11744 for that). This should be removed once we upgrade to Spring 3.2.9.

Related pull request: #80.
Related tickets: DATACMNS-493, DATACMNS-494, SPR-11744.
@johntostring
Copy link
Author

You got me!Thank you Oliver! You are great!
I hope I can make a useful contribution next time.Thank you Thomas!

odrotbohm added a commit that referenced this pull request Apr 29, 2014
…ment.

Added a constructor to RepositoryConfigurationDelegate that takes an additional Environment instance to make sure we can equip ClasspathScanningCandidateComponentProviders with Environments to make sure they only find components matching the environment.

Retain the old constructor by defaulting to the Environment the ResourceLoader potentially contains or even a StandardEnvironment in worse cases. This is primarily to not break existing clients. Those should be upgraded to use the new constructor, of course.

Needed to add an additional guard in BeanDefinitionRegistrarSupport as Spring 3.2.8 fails to invoke EnvironmentAware (filed SPR-11744 for that). This should be removed once we upgrade to Spring 3.2.9.

Related pull request: #80.
Related tickets: DATACMNS-493, DATACMNS-494, SPR-11744.
thomasdarimont pushed a commit to thomasdarimont/spring-data-commons that referenced this pull request Jul 1, 2015
We now delegate calls to invokeFindOne to the correct target repository.

Original pull request: spring-projects#80.
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
If user has @EnableDiscoveryClient but no implementation (e.g. if he
just has @EnableZuulProxy) the autoconfig will now kick in and
provide an instance of NoopDiscoveryClient.

Fixes spring-projectsgh-80
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

Successfully merging this pull request may close these issues.

3 participants