Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-15600

Upgrade to Objenesis 2.6 for Google App Engine Standard on Java 8 and for better JDK 9 support

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Complete
    • Affects Version/s: None
    • Fix Version/s: 4.3.10, 5.0 RC3
    • Component/s: Core:AOP
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      App Engine Standard for Java 8 (currently in Alpha) lifted the old sandbox/API restrictions. We can now use Objenesis as-is. A recent patch was merged into Objensis to take this new environment into account.

      See https://github.com/easymock/objenesis/issues/51

      This is tracking issue to ensure that Spring core will use the new version when it becomes available on Maven.

        Issue Links

          Activity

          saturnism Ray Tsang created issue -
          juergen.hoeller Juergen Hoeller made changes -
          Field Original Value New Value
          Issue Type Improvement [ 4 ] Task [ 3 ]
          Fix Version/s 5.0 RC3 [ 16199 ]
          Priority Trivial [ 5 ] Major [ 3 ]
          Assignee Juergen Hoeller [ juergen.hoeller ]
          juergen.hoeller Juergen Hoeller made changes -
          Fix Version/s 4.3.10 [ 16213 ]
          juergen.hoeller Juergen Hoeller made changes -
          Link This issue is related to SPR-15668 [ SPR-15668 ]
          juergen.hoeller Juergen Hoeller made changes -
          Summary Upgrade Objenesis to fix be able to generate proxy correctly in App Engine for Java 8 Upgrade Objenesis for Google App Engine Standard support on Java 8
          Issue Type Task [ 3 ] Improvement [ 4 ]
          juergen.hoeller Juergen Hoeller made changes -
          Summary Upgrade Objenesis for Google App Engine Standard support on Java 8 Upgrade to Objenesis 2.6 for Google App Engine Standard on Java 8 and for better JDK 9 support
          Hide
          henri.tremblay Henri Tremblay added a comment - - edited

          Just wanted to add a precision:

          • Objenesis 2.6 works perfectly on GAE on Java 8
          • Objenesis 2.6 will behave as it used to on GAE on Java 7 which is
          • Call no constructor if the class is serializable
          • Call the no-arg constructor otherwise

          And then, there is 3 things I should have mention a long time ago:

          • Maybe shading Objenesis isn't a good idea. Objenesis has a stable API. It hasn't changed for years. Only the code under the hood is changing. So not shading would allow users to update easily.
          • Right now, Objenesis is static in ConfigurationClassEnhancer. So there is no way to easily specify a custom strategy even though SpringObjenesis allows it. It would be useful to change that to get flexibility
          • SpringObjenesis seems to contain some (not all) stuff that could go down in Objenesis directly. I will have a better look but you can file an issue (or PR) about it
          Show
          henri.tremblay Henri Tremblay added a comment - - edited Just wanted to add a precision: Objenesis 2.6 works perfectly on GAE on Java 8 Objenesis 2.6 will behave as it used to on GAE on Java 7 which is Call no constructor if the class is serializable Call the no-arg constructor otherwise And then, there is 3 things I should have mention a long time ago: Maybe shading Objenesis isn't a good idea. Objenesis has a stable API. It hasn't changed for years. Only the code under the hood is changing. So not shading would allow users to update easily. Right now, Objenesis is static in ConfigurationClassEnhancer. So there is no way to easily specify a custom strategy even though SpringObjenesis allows it. It would be useful to change that to get flexibility SpringObjenesis seems to contain some (not all) stuff that could go down in Objenesis directly. I will have a better look but you can file an issue (or PR) about it
          Hide
          glaforge Guillaume Laforge added a comment -

          I was trying to deploy a simple Hello World style Spring Boot app to the new Java 8 runtime for Google App Engine, and also faced this issue with Objenesis.

          For reference, here was the huge stacktrace I got:

          javax.servlet.ServletContext log: 2 Spring WebApplicationInitializers detected on classpath
          javax.servlet.ServletContext log: Initializing Spring embedded WebApplicationContext
          Failed startup of context [email protected]{/,file:///base/data/home/apps/s~spring-boot-jpa-demo/20170622t160815.402154028493911964/,UNAVAILABLE}{/base/data/home/apps/s~spring-boot-jpa-demo/20170622t160815.402154028493911964}
          java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:68)
          	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
          	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:330)
          	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406)
          	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368)
          	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
          	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
          	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
          	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
          	at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:244)
          	at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:182)
          	at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:96)
          	at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:661)
          	at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:621)
          	at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:591)
          	at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:787)
          	at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:263)
          	at java.lang.Thread.run(Thread.java:745)
          Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
          	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
          	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
          	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
          	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
          	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
          	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
          	at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
          	at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
          	at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
          	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
          	at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:140)
          	at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:63)
          	... 17 more
          Caused by: org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:217)
          	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:109)
          	at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(ContextAnnotationAutowireCandidateResolver.java:100)
          	at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.getLazyResolutionProxyIfNecessary(ContextAnnotationAutowireCandidateResolver.java:45)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1063)
          	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
          	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
          	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
          	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1316)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1282)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1180)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1096)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:659)
          	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
          	... 37 more
          Caused by: org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:76)
          	at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:201)
          	... 61 more
          Caused by: java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at java.lang.Class.newInstance(Class.java:428)
          	at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:73)
          	... 62 more
          Caused by: java.lang.NoSuchMethodException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15.<init>()
          	at java.lang.Class.getConstructor0(Class.java:3084)
          	at java.lang.Class.newInstance(Class.java:413)
          	... 63 more
           
          Uncaught exception from servlet
          java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:68)
          	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
          	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:330)
          	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406)
          	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368)
          	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
          	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
          	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522)
          	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
          	at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:244)
          	at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:182)
          	at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:96)
          	at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:661)
          	at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:621)
          	at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:591)
          	at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:787)
          	at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:263)
          	at java.lang.Thread.run(Thread.java:745)
          Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
          	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
          	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
          	at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
          	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
          	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
          	at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
          	at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151)
          	at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131)
          	at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86)
          	at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169)
          	at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:140)
          	at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:63)
          	... 17 more
          Caused by: org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:217)
          	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:109)
          	at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(ContextAnnotationAutowireCandidateResolver.java:100)
          	at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.getLazyResolutionProxyIfNecessary(ContextAnnotationAutowireCandidateResolver.java:45)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1063)
          	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835)
          	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741)
          	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513)
          	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
          	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
          	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
          	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
          	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1316)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1282)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1180)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1096)
          	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:659)
          	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
          	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
          	... 37 more
          Caused by: org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:76)
          	at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:201)
          	... 61 more
          Caused by: java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15
          	at java.lang.Class.newInstance(Class.java:428)
          	at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:73)
          	... 62 more
          Caused by: java.lang.NoSuchMethodException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15.<init>()
          	at java.lang.Class.getConstructor0(Class.java:3084)
          	at java.lang.Class.newInstance(Class.java:413)
          	... 63 more
          

          Show
          glaforge Guillaume Laforge added a comment - I was trying to deploy a simple Hello World style Spring Boot app to the new Java 8 runtime for Google App Engine, and also faced this issue with Objenesis. For reference, here was the huge stacktrace I got: javax.servlet.ServletContext log: 2 Spring WebApplicationInitializers detected on classpath javax.servlet.ServletContext log: Initializing Spring embedded WebApplicationContext Failed startup of context [email protected]{/,file:///base/data/home/apps/s~spring-boot-jpa-demo/20170622t160815.402154028493911964/,UNAVAILABLE}{/base/data/home/apps/s~spring-boot-jpa-demo/20170622t160815.402154028493911964} java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:68) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:330) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:244) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:182) at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:96) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:661) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:621) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:591) at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:787) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:263) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151) at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131) at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:140) at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:63) ... 17 more Caused by: org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:217) at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:109) at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(ContextAnnotationAutowireCandidateResolver.java:100) at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.getLazyResolutionProxyIfNecessary(ContextAnnotationAutowireCandidateResolver.java:45) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1063) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1316) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1282) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1180) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1096) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:659) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ... 37 more Caused by: org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:76) at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:201) ... 61 more Caused by: java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at java.lang.Class.newInstance(Class.java:428) at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:73) ... 62 more Caused by: java.lang.NoSuchMethodException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15.<init>() at java.lang.Class.getConstructor0(Class.java:3084) at java.lang.Class.newInstance(Class.java:413) ... 63 more   Uncaught exception from servlet java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:68) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:330) at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1406) at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1368) at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778) at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262) at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:522) at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.createHandler(AppVersionHandlerMap.java:244) at com.google.apphosting.runtime.jetty9.AppVersionHandlerMap.getHandler(AppVersionHandlerMap.java:182) at com.google.apphosting.runtime.jetty9.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:96) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchServletRequest(JavaRuntime.java:661) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.dispatchRequest(JavaRuntime.java:621) at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:591) at com.google.apphosting.runtime.JavaRuntime$NullSandboxRequestRunnable.run(JavaRuntime.java:787) at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:263) at java.lang.Thread.run(Thread.java:745) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:372) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.web.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:151) at org.springframework.boot.web.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:131) at org.springframework.boot.web.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:86) at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:169) at org.eclipse.jetty.plus.annotation.ContainerInitializer.callStartup(ContainerInitializer.java:140) at org.eclipse.jetty.annotations.ServletContainerInitializersStarter.doStart(ServletContainerInitializersStarter.java:63) ... 17 more Caused by: org.springframework.aop.framework.AopConfigException: Unexpected AOP exception; nested exception is org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:217) at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:109) at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.buildLazyResolutionProxy(ContextAnnotationAutowireCandidateResolver.java:100) at org.springframework.context.annotation.ContextAnnotationAutowireCandidateResolver.getLazyResolutionProxyIfNecessary(ContextAnnotationAutowireCandidateResolver.java:45) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1063) at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:189) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1193) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1095) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208) at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1316) at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1282) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1180) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1096) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:659) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366) ... 37 more Caused by: org.springframework.aop.framework.AopConfigException: Unable to instantiate proxy using Objenesis, and regular proxy instantiation via default constructor fails as well; nested exception is java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:76) at org.springframework.aop.framework.CglibAopProxy.getProxy(CglibAopProxy.java:201) ... 61 more Caused by: java.lang.InstantiationException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15 at java.lang.Class.newInstance(Class.java:428) at org.springframework.aop.framework.ObjenesisCglibAopProxy.createProxyClassAndInstance(ObjenesisCglibAopProxy.java:73) ... 62 more Caused by: java.lang.NoSuchMethodException: org.springframework.boot.autoconfigure.web.HttpMessageConverters$$EnhancerBySpringCGLIB$$3ba87c15.<init>() at java.lang.Class.getConstructor0(Class.java:3084) at java.lang.Class.newInstance(Class.java:413) ... 63 more
          Hide
          henri.tremblay Henri Tremblay added a comment -

          Yes. This class isn't serializable nor has a no-arg constructor. So it won't work on GAE with Objenesis before 2.6. And won't work on GAE on Java 1.7.

          To get GAE 1.7 support, I think a new private constructor should be added.

          private HttpMessageConverters() { this(Collections.emptyList()); }
          

          Show
          henri.tremblay Henri Tremblay added a comment - Yes. This class isn't serializable nor has a no-arg constructor. So it won't work on GAE with Objenesis before 2.6. And won't work on GAE on Java 1.7. To get GAE 1.7 support, I think a new private constructor should be added. private HttpMessageConverters() { this (Collections.emptyList()); }
          Hide
          bclozel Brian Clozel added a comment -

          HttpMessageConverters is part of Spring Boot - and other classes may have the same issue (in Boot or other projects) so I'm not sure fixing that case will really solve the issue.

          Show
          bclozel Brian Clozel added a comment - HttpMessageConverters is part of Spring Boot - and other classes may have the same issue (in Boot or other projects) so I'm not sure fixing that case will really solve the issue.
          Hide
          juergen.hoeller Juergen Hoeller added a comment - - edited

          Phil Webb, since that HttpMessageConverters class lives in Spring Boot: Any chance to add such a default constructor? And why is it being proxied in the first place... What kind of AOP advice is actually being applied to it?

          Henri Tremblay, thanks for reaching out! We are primarily shading Objenesis as a user convenience, avoiding a dependency on an extra artifact, and moving Objenesis out of the user's face to begin with. It also avoids dependency resolution conflicts with Objenesis dependencies from other libraries, guaranteeing that Spring is always running against a current enough Objenesis version for its own purposes. It does come at the price of having to wait for a new Spring Framework version in order to upgrade Objenesis, but well, since most Spring users are not even aware of Objenesis, I do not expect regular Spring users to have a desire to manually upgrade Objenesis there... or be aware of the need to do so for certain new platforms in the first place. We're usually picking up new Objenesis versions within a few weeks, so it's not too bad a compromise. I've been waiting for 2.6 to be released already: cool to have it out now, we'll pick it up for 4.3.10 right away.

          In ConfigurationClassEnhancer, we're only using Objenesis for a very specific purpose (intermediate proxies for FactoryBean references on @Bean methods), so making it explicitly configurable doesn't seem necessary. It's also not explicitly configurable in other places, e.g. in ObjenesisCglibAopProxy.

          It's worth noting that the framework does not strictly require Objenesis to work since we fall back to the default constructor otherwise (assuming that it is a side-effect-free constructor then). The only painful point is a class that doesn't have a default constructor despite being used as a proxy class: Such design effectively makes it require Objenesis, unfortunately...

          Show
          juergen.hoeller Juergen Hoeller added a comment - - edited Phil Webb , since that HttpMessageConverters class lives in Spring Boot: Any chance to add such a default constructor? And why is it being proxied in the first place... What kind of AOP advice is actually being applied to it? Henri Tremblay , thanks for reaching out! We are primarily shading Objenesis as a user convenience, avoiding a dependency on an extra artifact, and moving Objenesis out of the user's face to begin with. It also avoids dependency resolution conflicts with Objenesis dependencies from other libraries, guaranteeing that Spring is always running against a current enough Objenesis version for its own purposes. It does come at the price of having to wait for a new Spring Framework version in order to upgrade Objenesis, but well, since most Spring users are not even aware of Objenesis, I do not expect regular Spring users to have a desire to manually upgrade Objenesis there... or be aware of the need to do so for certain new platforms in the first place. We're usually picking up new Objenesis versions within a few weeks, so it's not too bad a compromise. I've been waiting for 2.6 to be released already: cool to have it out now, we'll pick it up for 4.3.10 right away. In ConfigurationClassEnhancer , we're only using Objenesis for a very specific purpose (intermediate proxies for FactoryBean references on @Bean methods), so making it explicitly configurable doesn't seem necessary. It's also not explicitly configurable in other places, e.g. in ObjenesisCglibAopProxy . It's worth noting that the framework does not strictly require Objenesis to work since we fall back to the default constructor otherwise (assuming that it is a side-effect-free constructor then). The only painful point is a class that doesn't have a default constructor despite being used as a proxy class: Such design effectively makes it require Objenesis, unfortunately...
          Hide
          juergen.hoeller Juergen Hoeller added a comment -

          Phil Webb, while we're at it, can we move the Spring Boot 1.5.5 target date a bit closer to Spring Framework 4.3.10: e.g. to July 18th, going along with Boot 2.0 M3?

          Show
          juergen.hoeller Juergen Hoeller added a comment - Phil Webb , while we're at it, can we move the Spring Boot 1.5.5 target date a bit closer to Spring Framework 4.3.10: e.g. to July 18th, going along with Boot 2.0 M3?
          juergen.hoeller Juergen Hoeller made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Hide
          henri.tremblay Henri Tremblay added a comment -

          Thanks for the explanations Juergen Hoeller. Indeed Objenesis is a mysterious library. I just know that people are not that quick at migrating Spring versions. But it's your call anyway. I thought there was a central point of usage.

          The more people are using constructor injection the less chance there is that they will have a default constructor no? Unless they have the habit of adding a private one.

          Show
          henri.tremblay Henri Tremblay added a comment - Thanks for the explanations Juergen Hoeller . Indeed Objenesis is a mysterious library. I just know that people are not that quick at migrating Spring versions. But it's your call anyway. I thought there was a central point of usage. The more people are using constructor injection the less chance there is that they will have a default constructor no? Unless they have the habit of adding a private one.
          Hide
          snicoll Stéphane Nicoll added a comment -

          Indeed.

          There is really no reason for us to create a default constructor there I am afraid. As Brian Clozel point out, there are probably a lot of other cases like that.

          Show
          snicoll Stéphane Nicoll added a comment - Indeed. There is really no reason for us to create a default constructor there I am afraid. As Brian Clozel point out, there are probably a lot of other cases like that.
          Hide
          juergen.hoeller Juergen Hoeller added a comment -

          Objenesis 2.6 is in Spring Framework master and therefore 5.0.0.BUILD-SNAPSHOT now. I'll keep this ticket open until it's upgraded in the 4.3.x branch as well.

          Show
          juergen.hoeller Juergen Hoeller added a comment - Objenesis 2.6 is in Spring Framework master and therefore 5.0.0.BUILD-SNAPSHOT now. I'll keep this ticket open until it's upgraded in the 4.3.x branch as well.
          Hide
          glaforge Guillaume Laforge added a comment -

          Wonderful, thank you Jürgen!

          Show
          glaforge Guillaume Laforge added a comment - Wonderful, thank you Jürgen!
          Hide
          pwebb Phil Webb added a comment -

          Juergen Hoeller I've moved the 1.5.5 release date to July 20. It might be a bit of a light release, but I think the dependency upgrade alone makes it worthwhile.

          Show
          pwebb Phil Webb added a comment - Juergen Hoeller I've moved the 1.5.5 release date to July 20. It might be a bit of a light release, but I think the dependency upgrade alone makes it worthwhile.
          Hide
          glaforge Guillaume Laforge added a comment -

          Good to know about the associated Boot release! Nice!

          Show
          glaforge Guillaume Laforge added a comment - Good to know about the associated Boot release! Nice!
          Hide
          henri.tremblay Henri Tremblay added a comment -

          While waiting, here is a cute hack to make it work right now. If it can be of any help. It could even go in the real SpringObjenesis.java version. But I'm not sure the shading plugin will like that.

          Show
          henri.tremblay Henri Tremblay added a comment - While waiting, here is a cute hack to make it work right now. If it can be of any help. It could even go in the real SpringObjenesis.java version. But I'm not sure the shading plugin will like that.
          juergen.hoeller Juergen Hoeller made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Complete [ 8 ]
          snicoll Stéphane Nicoll made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          juergen.hoeller Juergen Hoeller made changes -
          Link This issue is related to SPR-16185 [ SPR-16185 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          22d 15h 20m 1 Juergen Hoeller 22/Jun/17 5:03 PM
          In Progress In Progress Resolved Resolved
          7d 20h 39m 1 Juergen Hoeller 30/Jun/17 1:43 PM
          Resolved Resolved Closed Closed
          19d 22h 50m 1 Stéphane Nicoll 20/Jul/17 12:33 PM

            People

            • Assignee:
              juergen.hoeller Juergen Hoeller
              Reporter:
              saturnism Ray Tsang
              Last updater:
              Juergen Hoeller
            • Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                21 weeks ago