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

Does the JBP support Spring Boot 2.0? #485

Closed
metacubed opened this issue Sep 1, 2017 · 6 comments
Closed

Does the JBP support Spring Boot 2.0? #485

metacubed opened this issue Sep 1, 2017 · 6 comments
Assignees
Milestone

Comments

@metacubed
Copy link

https://spring.io/blog/2017/07/26/spring-boot-2-0-0-m3-available-now

@nebhale nebhale self-assigned this Sep 1, 2017
@nebhale
Copy link
Member

nebhale commented Sep 1, 2017

We have not tested against it yet, but given that the way it runs (java -jar) hasn’t changed, I have no reason to believe that it doesn’t.

@slu-it
Copy link

slu-it commented Sep 13, 2017

I actually have a problem with the current M3. But it only happens when MongoDB is used. Cloud Foundry tries to reconfigure the MongoDB connection and runs into a NoSuchMethodError.

As far as I can see, this is due to breaking changes in the spring-data-mongo dependency.

Setup is a basic Spring Boot 2.0.0.M3 app with starters for:

  • actuator
  • data-mongo
  • web
  • etc.

The Project can be found here:
https://github.com/nt-ca-aqe/library-app/tree/master/library-service

Logs Excerpt:

2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] 2017-09-13 10:56:07.083 ERROR [] --- [ main] o.s.boot.SpringApplication : Application startup failed
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] java.lang.NoSuchMethodError: org.springframework.data.mongodb.core.SimpleMongoDbFactory.<init>(Lcom/mongodb/Mongo;Ljava/lang/String;)V
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.org.springframework.cloud.service.document.MongoDbFactoryCreator.createMongoDbFactory(MongoDbFactoryCreator.java:50)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.org.springframework.cloud.service.document.MongoDbFactoryCreator.create(MongoDbFactoryCreator.java:37)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.org.springframework.cloud.service.document.MongoDbFactoryCreator.create(MongoDbFactoryCreator.java:31)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.org.springframework.cloud.Cloud.getServiceConnector(Cloud.java:245)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.org.springframework.cloud.Cloud.getSingletonServiceConnector(Cloud.java:155)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.spring.AbstractCloudServiceBeanFactoryPostProcessor.reconfigureBean(AbstractCloudServiceBeanFactoryPostProcessor.java:119)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.spring.AbstractCloudServiceBeanFactoryPostProcessor.processBean(AbstractCloudServiceBeanFactoryPostProcessor.java:112)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.spring.AbstractCloudServiceBeanFactoryPostProcessor.processBeans(AbstractCloudServiceBeanFactoryPostProcessor.java:97)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.cloudfoundry.reconfiguration.spring.AbstractCloudServiceBeanFactoryPostProcessor.postProcessBeanFactory(AbstractCloudServiceBeanFactoryPostProcessor.java:63)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:282)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:127)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:693)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:122)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at library.service.ApplicationKt.main(Application.kt:17)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
2017-09-13T12:56:07.084+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
2017-09-13T12:56:07.085+02:00 [APP/PROC/WEB/0] [OUT] 2017-09-13 10:56:07.085 INFO [] --- [ main] ConfigServletWebServerApplicationContext : Closing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2cfb4a64: startup date [Wed Sep 13 10:56:02 UTC 2017]; root of context hierarchy
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] 2017-09-13 10:56:07.087 WARN [] --- [ main] ConfigServletWebServerApplicationContext : Exception thrown from LifecycleProcessor on context close
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2cfb4a64: startup date [Wed Sep 13 10:56:02 UTC 2017]; root of context hierarchy
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:433)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1004)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:963)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:808)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at library.service.ApplicationKt.main(Application.kt:17)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
2017-09-13T12:56:07.088+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] 2017-09-13 10:56:07.089 ERROR [] --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Destroy method on bean with name 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory' threw an exception
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@2cfb4a64: startup date [Wed Sep 13 10:56:02 UTC 2017]; root of context hierarchy
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:420)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.ApplicationListenerDetector.postProcessBeforeDestruction(ApplicationListenerDetector.java:95)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:240)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.java:582)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegistry.java:558)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingleton(DefaultListableBeanFactory.java:952)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegistry.java:527)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.destroySingletons(FactoryBeanRegistrySupport.java:228)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.beans.factory.support.DefaultListableBeanFactory.destroySingletons(DefaultListableBeanFactory.java:959)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1035)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1011)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:963)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:808)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1245)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1233)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at library.service.ApplicationKt.main(Application.kt:17)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at java.lang.reflect.Method.invoke(Method.java:498)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
2017-09-13T12:56:07.089+02:00 [APP/PROC/WEB/0] [OUT] at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
2017-09-13T12:56:07.446+02:00 [APP/PROC/WEB/0] [OUT] Exit status 1

@nebhale
Copy link
Member

nebhale commented Sep 13, 2017

Yeah, this is an auto-reconfiguration issue. We depend on a version of Spring Cloud Connectors that might not be ready to go for the major version uprade to Spring Data. @scottfrederick are you aware of this and all that I’ll need to do is start using a new version of the Spring Cloud Connectors?

@nebhale nebhale added this to the v4.6 milestone Sep 13, 2017
@metacubed metacubed changed the title [Question] Does the JBP support Spring Boot 2.0? Does the JBP support Spring Boot 2.0? Sep 18, 2017
@nebhale nebhale modified the milestones: v4.6, v4.7 Oct 17, 2017
@nebhale
Copy link
Member

nebhale commented Oct 17, 2017

I've been updating our Java Test Applications to Boot 2.0. Based on that work, the only thing that seems to have a problem is that the auto-reconfiguration of Spring Data Mongo seems to be broken (API changes). I'll leave this issue open as an indicator of that, and then close it once we've got a fix in place.

@andreas-schilling
Copy link

Any estimation when this will be available? Also: are there applicable workarounds for the moment?

@nebhale
Copy link
Member

nebhale commented Nov 7, 2017

We’re quite close to delivering, but are still waiting for @scottfrederick to do a release of Spring Cloud Connectors. We’ve done significant work to simplify the auto-reconfiguration and upgrade it to use Spring Cloud Connectors 2.x. As part of that work, we submitted a PR to ensure that all configured types were compatible across both Boot 1.x and Boot 2.x. This has been included but is still undergoing testing. Once it is released, we’ll consume it and get a new version of the auto-reconfiguration into the wild.

There is no real need for a work around as everything except MongoDB auto-reconfiguration works as expected today. If you are trying to do auto-reconfiguration of MongoDB, there is no work around other than to explicitly configure your application to use the service (which you should be doing anyway; auto-reconfiguration isn’t a good choice for production systems).

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

4 participants