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

NPE in GenericTypeResolver when using Spring 2.5 on IBM JDK 1.6

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5.4
    • Fix Version/s: 2.5.5
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      (spring2.5 && ibm jdk5) ||( spring2.0.8 && ibm jdk6) is fine.

      spring2.5 && ibm jdk6 will produce a NPE

      2008-05-08 15:27:54,739 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] [org.springframework.web.context.ContextLoader] [ERROR] – Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Initialization of bean failed; nested exception is java.lang.NullPointerException
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(AccessController.java:224)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
      at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:363)
      at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
      at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
      at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
      at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
      at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
      at java.lang.Thread.run(Thread.java:735)
      Caused by: java.lang.NullPointerException
      at org.springframework.core.GenericTypeResolver.getTypeVariableMap(GenericTypeResolver.java:144)
      at org.springframework.core.GenericTypeResolver.resolveReturnType(GenericTypeResolver.java:93)
      at org.springframework.beans.GenericTypeAwarePropertyDescriptor.getPropertyType(GenericTypeAwarePropertyDescriptor.java:58)
      at java.beans.PropertyDescriptor.setWriteMethod(Unknown Source)
      at java.beans.PropertyDescriptor.<init>(Unknown Source)
      at org.springframework.beans.GenericTypeAwarePropertyDescriptor.<init>(GenericTypeAwarePropertyDescriptor.java:47)
      at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:250)
      at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:144)
      at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:252)
      at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:380)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1287)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1248)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1008)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:470)
      ... 29 more

        Activity

        Hide
        juergen.hoeller Juergen Hoeller added a comment -

        This seems to be caused by a slightly different implementation of the "java.beans.PropertyDescriptor" class in IBM's JDK class libraries... breaking an assumption in Spring's GenericTypeAwarePropertyDescriptor subclass. I've revised this for Spring 2.5.5, hopefully being compatible with IBM's JDK 1.6 as well now (again).

        This will be available in tonight's 2.5.5 snapshot (build 489 or higher; available from http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR). Please give it a try and let us know whether it works for you on IBM's JDK 1.6...

        Juergen

        Show
        juergen.hoeller Juergen Hoeller added a comment - This seems to be caused by a slightly different implementation of the "java.beans.PropertyDescriptor" class in IBM's JDK class libraries... breaking an assumption in Spring's GenericTypeAwarePropertyDescriptor subclass. I've revised this for Spring 2.5.5, hopefully being compatible with IBM's JDK 1.6 as well now (again). This will be available in tonight's 2.5.5 snapshot (build 489 or higher; available from http://static.springframework.org/downloads/nightly/snapshot-download.php?project=SPR ). Please give it a try and let us know whether it works for you on IBM's JDK 1.6... Juergen
        Hide
        quaff zhouyanming added a comment -

        you just add some assumption,but didn't resolve this problem actually.

        2008-05-09 14:06:58,794 ERROR [org.springframework.web.context.ContextLoader] – Context initialization failed
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Class must not be null
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBe
        anFactory.java:478)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFacto
        ry.java:409)
        at java.security.AccessController.doPrivileged(AccessController.java:224)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBean
        Factory.java:380)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.ja
        va:220)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
        at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationC
        ontext.java:516)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:363)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:735)
        Caused by: java.lang.IllegalArgumentException: Class must not be null
        at java.lang.Throwable.<init>(Throwable.java:67)
        at org.springframework.util.Assert.notNull(Assert.java:112)
        at org.springframework.core.GenericTypeResolver.resolveReturnType(GenericTypeResolver.java:98)
        at org.springframework.beans.GenericTypeAwarePropertyDescriptor.getPropertyType(GenericTypeAwarePropertyDescriptor.jav
        a:58)
        at java.beans.PropertyDescriptor.setWriteMethod(Unknown Source)
        at java.beans.PropertyDescriptor.<init>(Unknown Source)
        at org.springframework.beans.GenericTypeAwarePropertyDescriptor.<init>(GenericTypeAwarePropertyDescriptor.java:47)
        at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:250)
        at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:144)
        at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:252)
        at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:380)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCap
        ableBeanFactory.java:1287)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCa
        pableBeanFactory.java:1248)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBe
        anFactory.java:1008)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBe
        anFactory.java:470)
        ... 29 more

        Show
        quaff zhouyanming added a comment - you just add some assumption,but didn't resolve this problem actually. 2008-05-09 14:06:58,794 ERROR [org.springframework.web.context.ContextLoader] – Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0': Initialization of bean failed; nested exception is java.lang.IllegalArgumentException: Class must not be null at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBe anFactory.java:478) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFacto ry.java:409) at java.security.AccessController.doPrivileged(AccessController.java:224) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBean Factory.java:380) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.ja va:220) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationC ontext.java:516) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:363) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:829) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:718) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490) at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:735) Caused by: java.lang.IllegalArgumentException: Class must not be null at java.lang.Throwable.<init>(Throwable.java:67) at org.springframework.util.Assert.notNull(Assert.java:112) at org.springframework.core.GenericTypeResolver.resolveReturnType(GenericTypeResolver.java:98) at org.springframework.beans.GenericTypeAwarePropertyDescriptor.getPropertyType(GenericTypeAwarePropertyDescriptor.jav a:58) at java.beans.PropertyDescriptor.setWriteMethod(Unknown Source) at java.beans.PropertyDescriptor.<init>(Unknown Source) at org.springframework.beans.GenericTypeAwarePropertyDescriptor.<init>(GenericTypeAwarePropertyDescriptor.java:47) at org.springframework.beans.CachedIntrospectionResults.<init>(CachedIntrospectionResults.java:250) at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:144) at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:252) at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:380) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCap ableBeanFactory.java:1287) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCa pableBeanFactory.java:1248) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBe anFactory.java:1008) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBe anFactory.java:470) ... 29 more
        Hide
        quaff zhouyanming added a comment -

        I am sorry,I didn't update GenericTypeAwarePropertyDescriptor too, you can close this issue now,thanks.

        Show
        quaff zhouyanming added a comment - I am sorry,I didn't update GenericTypeAwarePropertyDescriptor too, you can close this issue now,thanks.

          People

          • Assignee:
            juergen.hoeller Juergen Hoeller
            Reporter:
            quaff zhouyanming
            Last updater:
            Trevor Marshall
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              8 years, 21 weeks, 2 days ago