Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-8862

org.springframework.beans.factory.BeanCreationException while doing Spring portlet

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Expired
    • Affects Version/s: 5.2.3
    • Fix Version/s: 5.2.3
    • Component/s: WCM
    • Labels:
      None
    • Environment:
      tomcat-6.0.18 ,apache-ant-1.7.1-bin

      Description

      Hi,

      I am trying to do a spring Portlet.
      I am getting some exception while running the tomcat server.
      11:39:00,714 ERROR [ContextLoader:215] Context initialization failed
      org.springframework.beans.factory.BeanCreationException: Error creating bean wit
      h name 'com.liferay.portal.kernel.captcha.CaptchaUtil' defined in class path res
      ource [META-INF/util-spring.xml]: Cannot create inner bean 'com.liferay.portal.c
      aptcha.CaptchaImpl#cc7439' of type [com.liferay.portal.captcha.CaptchaImpl] whil
      e setting bean property 'captcha'; nested exception is org.springframework.beans
      .factory.BeanCreationException: Error creating bean with name 'com.liferay.porta
      l.captcha.CaptchaImpl#cc7439' defined in class path resource [META-INF/util-spri
      ng.xml]: Instantiation of bean failed; nested exception is org.springframework.b
      eans.BeanInstantiationException: Could not instantiate bean class [com.liferay.p
      ortal.captcha.CaptchaImpl]: Constructor threw exception; nested exception is jav
      a.lang.NullPointerException
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver
      .resolveInnerBean(BeanDefinitionValueResolver.java:230)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver
      .resolveValueIfNecessary(BeanDefinitionValueResolver.java:117)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getOb
      ject(AbstractBeanFactory.java:264)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr
      y.getSingleton(DefaultSingletonBeanRegistry.java:222)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBe
      an(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.beans.factory.support.DefaultListableBeanFactory.
      preInstantiateSingletons(DefaultListableBeanFactory.java:429)
      at org.springframework.context.support.AbstractApplicationContext.finish
      BeanFactoryInitialization(AbstractApplicationContext.java:728)
      at org.springframework.context.support.AbstractApplicationContext.refres
      h(AbstractApplicationContext.java:380)
      at org.springframework.web.context.ContextLoader.createWebApplicationCon
      text(ContextLoader.java:255)
      at org.springframework.web.context.ContextLoader.initWebApplicationConte
      xt(ContextLoader.java:199)
      at org.springframework.web.context.ContextLoaderListener.contextInitiali
      zed(ContextLoaderListener.java:45)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContex
      t.java:3843)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4
      342)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
      .java:791)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
      1)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)

      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
      va:627)
      at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
      ava:553)
      at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488
      )
      at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
      at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
      :311)
      at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
      eSupport.java:117)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

      at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443
      )
      at org.apache.catalina.core.StandardService.start(StandardService.java:5
      16)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710
      )
      at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: org.springframework.beans.factory.BeanCreationException: Error creati
      ng bean with name 'com.liferay.portal.captcha.CaptchaImpl#cc7439' defined in cla
      ss path resource [META-INF/util-spring.xml]: Instantiation of bean failed; neste
      d exception is org.springframework.beans.BeanInstantiationException: Could not i
      nstantiate bean class [com.liferay.portal.captcha.CaptchaImpl]: Constructor thre
      w exception; nested exception is java.lang.NullPointerException
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.instantiateBean(AbstractAutowireCapableBeanFactory.java:883)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:839)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory$1.run(AbstractAutowireCapableBeanFactory.java:409)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.createBean(AbstractAutowireCapableBeanFactory.java:380)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver
      .resolveInnerBean(BeanDefinitionValueResolver.java:219)
      ... 42 more
      Caused by: org.springframework.beans.BeanInstantiationException: Could not insta
      ntiate bean class [com.liferay.portal.captcha.CaptchaImpl]: Constructor threw ex
      ception; nested exception is java.lang.NullPointerException
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:1
      15)
      at org.springframework.beans.factory.support.SimpleInstantiationStrategy
      .instantiate(SimpleInstantiationStrategy.java:61)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBean
      Factory.instantiateBean(AbstractAutowireCapableBeanFactory.java:877)
      ... 48 more
      Caused by: java.lang.NullPointerException
      at com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil.getC
      onfiguration(ConfigurationFactoryUtil.java:36)
      at com.liferay.portal.captcha.CaptchaImpl.<init>(CaptchaImpl.java:61)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
      orAccessorImpl.java:39)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
      onstructorAccessorImpl.java:27)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:1
      00)
      ... 50 more
      Apr 8, 2010 11:39:00 AM org.apache.catalina.core.StandardContext start
      SEVERE: Error listenerStart
      Apr 8, 2010 11:39:00 AM org.apache.catalina.core.StandardContext start
      SEVERE: Context [] startup failed due to previous errors
      Apr 8, 2010 11:39:01 AM org.apache.coyote.http11.Http11Protocol start
      INFO: Starting Coyote HTTP/1.1 on http-8080
      Apr 8, 2010 11:39:01 AM org.apache.jk.common.ChannelSocket init
      INFO: JK: ajp13 listening on /0.0.0.0:8009
      Apr 8, 2010 11:39:01 AM org.apache.jk.server.JkMain start
      INFO: Jk running ID=0 time=0/15 config=null
      Apr 8, 2010 11:39:01 AM org.apache.catalina.startup.Catalina start
      INFO: Server startup in 13520 ms

      In the same environment struts portlet is working fine.

      Please tell me where is the problem.

      Thanks

        Attachments

          Activity

            People

            • Assignee:
              samuel.kong Samuel Kong
              Reporter:
              sudheeshvp sudh (Inactive)
              Participants of an Issue:
              Recent user:
              Esther Sanz
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                9 years, 23 weeks, 1 day ago

                Packages

                Version Package
                5.2.3