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

Task Fails to start if use --spring.datasource.initialization-mode=always #592

Closed
cppwfs opened this issue Apr 11, 2019 · 1 comment
Closed

Comments

@cppwfs
Copy link
Collaborator

cppwfs commented Apr 11, 2019

There is an open issue on Boot for this spring-projects/spring-boot#13042 (comment)
And the work around is to add the following configuration:

	@Configuration
	protected static class DataSourceInitializerInvokerConfiguration implements LoadTimeWeaverAware {

		@Autowired
		private ListableBeanFactory beanFactory;

		@PostConstruct
		public void init() {
			String cls = "org.springframework.boot.autoconfigure.jdbc.DataSourceInitializerInvoker";
			if (beanFactory.containsBean(cls)) {
				beanFactory.getBean(cls);
			}
		}

		@Override
		public void setLoadTimeWeaver(LoadTimeWeaver ltw) {
		}
	}

@cppwfs
Copy link
Collaborator Author

cppwfs commented Apr 24, 2019

Unable to reproduce.

@cppwfs cppwfs closed this as completed Apr 24, 2019
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

1 participant