Announcement Announcement Module
Collapse
No announcement yet.
Bean initialization failure...worked fine yesterday, not today Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bean initialization failure...worked fine yesterday, not today

    Quite strange, I wasn't experiencing any problems yesterday and today I came into work and ran 'mvn tomcat:run' and now I'm getting bean initialization failures. Any ideas? Maybe I just haven't had enough coffee yet.

    Versions:
    Code:
    <properties>
    	<java-version>1.6</java-version>
    	<org.springframework-version>3.1.0.BUILD-SNAPSHOT</org.springframework-version>		
    	<org.springframework.security-version>3.1.0.CI-SNAPSHOT</org.springframework.security-version>		
    	<org.springframework.social-version>1.0.0.BUILD-SNAPSHOT</org.springframework.social-version>			
    	<org.aspectj-version>1.6.10</org.aspectj-version>
    	<org.slf4j-version>1.6.1</org.slf4j-version>
    </properties>
    Rest of stack trace is attached since it was too big to put in message.

    Code:
    ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0': Cannot create inner bean '(inner bean)' of type [org.springframework.security.web.access.expression.ExpressionBasedFilterInvocationSecurityMetadataSource] while setting bean property 'securityMetadataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.SecurityConfig] while setting constructor argument with key [Root bean: class [org.springframework.security.web.util.AntPathRequestMatcher]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7': Initialization of bean failed; nested exception is org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [java.util.ArrayList]; nested exception is java.beans.IntrospectionException: bad property name
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:900)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:455)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:294)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:215)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	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.start(ContainerBase.java:1045)
    	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.startup.Embedded.start(Embedded.java:825)
    	at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:385)
    	at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:144)
    	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
    	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
    	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:553)
    	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:523)
    	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371)
    	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
    	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
    	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
    	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
    	at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
    	at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:41)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:597)
    	at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
    	at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
    	at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
    	at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6': Cannot create inner bean '(inner bean)' of type [org.springframework.security.access.SecurityConfig] while setting constructor argument with key [Root bean: class [org.springframework.security.web.util.AntPathRequestMatcher]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7': Initialization of bean failed; nested exception is org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [java.util.ArrayList]; nested exception is java.beans.IntrospectionException: bad property name
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:125)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:378)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:161)
    	at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:616)
    	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:148)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1003)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:907)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
    	... 43 more

  • #2
    Maybe you have a different spring snapshot and some consistency issue, with other modules in your project (which maven won't pick up).

    Did you run a "clean install" from the project root before running tomcat? And have you checked the classpath to make sure you don't have duplicate spring jars on it?

    Comment


    • #3
      My project doesn't use modules. Ran 'clean install'...no luck. Cleared out my entire local Maven repo just in case as well and ran another 'clean install'...no luck. There aren't any jars in my project folder, they're all coming from my Maven repo.

      Checked all the jars in the build path config in STS and I'm not seeing any duplicates or wrong versions either.

      Any other ideas?
      Last edited by mattupstate; Apr 1st, 2011, 11:51 AM.

      Comment


      • #4
        Build a war file with maven and check the jars in the WEB-INF/lib directory. Then try deploying the war in standalone tomcat and see if you get the same error.

        Failing that run maven in debug mode (mvnDebug) and put a breakpoint where the problem occurs.

        Comment


        • #5
          Tried deploying the war file to a standalone Tomcat install on my VM and got the same here. Here is the list of jars in my /WEB-INF/lib folder...

          Code:
          -rw-r--r--  1 mattwright  staff    62983 Apr  1 11:15 activation-1.1.jar
          -rw-r--r--  1 mattwright  staff   445288 Apr  1 11:15 antlr-2.7.7.jar
          -rw-r--r--  1 mattwright  staff     4467 Apr  1 11:15 aopalliance-1.0.jar
          -rw-r--r--  1 mattwright  staff   116226 Apr  1 11:14 aspectjrt-1.6.10.jar
          -rw-r--r--  1 mattwright  staff  1675810 Apr  1 11:15 aspectjweaver-1.6.10.jar
          -rw-r--r--  1 mattwright  staff     4782 Apr  1 11:15 atmosphere-compat-jbossweb-0.7.jar
          -rw-r--r--  1 mattwright  staff     5423 Apr  1 11:15 atmosphere-compat-tomcat-0.7.jar
          -rw-r--r--  1 mattwright  staff     6060 Apr  1 11:15 atmosphere-compat-weblogic-0.7.jar
          -rw-r--r--  1 mattwright  staff     4353 Apr  1 11:15 atmosphere-ping-0.7.jar
          -rw-r--r--  1 mattwright  staff   195124 Apr  1 11:15 atmosphere-runtime-0.7.jar
          -rw-r--r--  1 mattwright  staff   322362 Apr  1 11:15 cglib-nodep-2.2.jar
          -rw-r--r--  1 mattwright  staff   231320 Apr  1 11:15 commons-beanutils-1.8.0.jar
          -rw-r--r--  1 mattwright  staff    46725 Apr  1 11:15 commons-codec-1.3.jar
          -rw-r--r--  1 mattwright  staff   148783 Apr  1 11:15 commons-digester-2.0.jar
          -rw-r--r--  1 mattwright  staff    59590 Apr  1 11:15 commons-fileupload-1.2.2.jar
          -rw-r--r--  1 mattwright  staff   305001 Apr  1 11:15 commons-httpclient-3.1.jar
          -rw-r--r--  1 mattwright  staff   109043 Apr  1 11:15 commons-io-1.4.jar
          -rw-r--r--  1 mattwright  staff  1114265 Apr  1 11:15 guava-r08.jar
          -rw-r--r--  1 mattwright  staff  1190462 Apr  1 11:15 h2-1.2.143.jar
          -rw-r--r--  1 mattwright  staff   287706 Apr  1 11:15 hibernate-validator-4.1.0.Final.jar
          -rw-r--r--  1 mattwright  staff   207383 Apr  1 11:15 jackson-core-asl-1.7.2.jar
          -rw-r--r--  1 mattwright  staff   624821 Apr  1 11:15 jackson-mapper-asl-1.7.2.jar
          -rw-r--r--  1 mattwright  staff    18215 Apr  1 11:15 java-xmlbuilder-0.3.jar
          -rw-r--r--  1 mattwright  staff     2497 Apr  1 11:15 javax.inject-1.jar
          -rw-r--r--  1 mattwright  staff    17308 Apr  1 11:15 jcl-over-slf4j-1.6.1.jar
          -rw-r--r--  1 mattwright  staff   153253 Apr  1 11:15 jdom-1.0.jar
          -rw-r--r--  1 mattwright  staff   417141 Apr  1 11:15 jets3t-0.7.4.jar
          -rw-r--r--  1 mattwright  staff   543044 Apr  1 11:15 joda-time-1.6.2.jar
          -rw-r--r--  1 mattwright  staff    33999 Apr  1 11:15 joda-time-jsptags-1.0.2.jar
          -rw-r--r--  1 mattwright  staff   414240 Apr  1 11:15 jstl-1.2.jar
          -rw-r--r--  1 mattwright  staff   481535 Apr  1 11:15 log4j-1.2.16.jar
          -rw-r--r--  1 mattwright  staff   447676 Apr  1 11:15 mail-1.4.1.jar
          -rw-r--r--  1 mattwright  staff   223374 Apr  1 11:15 mongo-java-driver-2.3.jar
          -rw-r--r--  1 mattwright  staff   252115 Apr  1 11:15 morphia-0.99.jar
          -rw-r--r--  1 mattwright  staff   208025 Apr  1 11:15 rome-0.9.jar
          -rw-r--r--  1 mattwright  staff    25496 Apr  1 11:15 slf4j-api-1.6.1.jar
          -rw-r--r--  1 mattwright  staff     9753 Apr  1 11:15 slf4j-log4j12-1.6.1.jar
          -rw-r--r--  1 mattwright  staff   329794 Apr  1 11:14 spring-aop-3.1.0.BUILD-20110401.080329-200.jar
          -rw-r--r--  1 mattwright  staff    53086 Apr  1 11:14 spring-asm-3.1.0.BUILD-20110401.080256-202.jar
          -rw-r--r--  1 mattwright  staff    46552 Apr  1 11:14 spring-aspects-3.1.0.BUILD-20110401.080422-199.jar
          -rw-r--r--  1 mattwright  staff   585370 Apr  1 11:14 spring-beans-3.1.0.BUILD-20110401.080323-200.jar
          -rw-r--r--  1 mattwright  staff   800152 Apr  1 11:14 spring-context-3.1.0.BUILD-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff    97960 Apr  1 11:14 spring-context-support-3.1.0.BUILD-20110401.080417-199.jar
          -rw-r--r--  1 mattwright  staff   412624 Apr  1 11:14 spring-core-3.1.0.BUILD-20110401.080312-200.jar
          -rw-r--r--  1 mattwright  staff   174910 Apr  1 11:14 spring-expression-3.1.0.BUILD-20110401.080318-200.jar
          -rw-r--r--  1 mattwright  staff   514150 Apr  1 11:14 spring-integration-core-2.0.3.RELEASE.jar
          -rw-r--r--  1 mattwright  staff    52841 Apr  1 11:14 spring-integration-http-2.0.3.RELEASE.jar
          -rw-r--r--  1 mattwright  staff    42676 Apr  1 11:14 spring-integration-mail-2.0.3.RELEASE.jar
          -rw-r--r--  1 mattwright  staff   393234 Apr  1 11:14 spring-jdbc-3.1.0.BUILD-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff    31652 Apr  1 11:15 spring-mobile-device-1.0.0.M3.jar
          -rw-r--r--  1 mattwright  staff    81140 Apr  1 11:14 spring-security-acl-3.1.0.CI-20110331.170401-383.jar
          -rw-r--r--  1 mattwright  staff   198564 Apr  1 11:14 spring-security-config-3.1.0.CI-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff   339278 Apr  1 11:14 spring-security-core-3.1.0.CI-20110331.170421-384.jar
          -rw-r--r--  1 mattwright  staff   316955 Apr  1 11:14 spring-security-oauth-1.0.0.BUILD-20110401.110013-255.jar
          -rw-r--r--  1 mattwright  staff    20544 Apr  1 11:14 spring-security-taglibs-3.1.0.CI-20110331.170437-381.jar
          -rw-r--r--  1 mattwright  staff   251289 Apr  1 11:14 spring-security-web-3.1.0.CI-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff    43972 Apr  1 11:14 spring-social-core-1.0.0.BUILD-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff    15228 Apr  1 11:14 spring-social-facebook-1.0.0.BUILD-20110401.080137-110.jar
          -rw-r--r--  1 mattwright  staff    12255 Apr  1 11:14 spring-social-web-1.0.0.BUILD-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff   243597 Apr  1 11:14 spring-tx-3.1.0.BUILD-20110401.080341-200.jar
          -rw-r--r--  1 mattwright  staff   419262 Apr  1 11:14 spring-web-3.1.0.BUILD-20110401.080405-199.jar
          -rw-r--r--  1 mattwright  staff   443010 Apr  1 11:14 spring-webmvc-3.1.0.BUILD-SNAPSHOT.jar
          -rw-r--r--  1 mattwright  staff   148627 Apr  1 11:15 stringtemplate-3.2.1.jar
          -rw-r--r--  1 mattwright  staff    35898 Apr  1 11:15 tiles-api-2.2.2.jar
          -rw-r--r--  1 mattwright  staff   161001 Apr  1 11:15 tiles-core-2.2.2.jar
          -rw-r--r--  1 mattwright  staff    21175 Apr  1 11:15 tiles-el-2.2.2.jar
          -rw-r--r--  1 mattwright  staff    50740 Apr  1 11:15 tiles-jsp-2.2.2.jar
          -rw-r--r--  1 mattwright  staff    59739 Apr  1 11:15 tiles-servlet-2.2.2.jar
          -rw-r--r--  1 mattwright  staff    24466 Apr  1 11:15 tiles-template-2.2.2.jar
          -rw-r--r--  1 mattwright  staff    47433 Apr  1 11:15 validation-api-1.0.0.GA.jar

          And unfortunately I'm a bit of a novice when it comes to debugging. Do I run 'mvnDebug tomcat:run' ? I'm using STS if that helps.
          Last edited by mattupstate; Apr 1st, 2011, 03:48 PM.

          Comment


          • #6
            So, on another note. I was using the Greenhouse project (http://git.springsource.org/greenhouse) as a starting point for my project and now the Greenhouse project gets the same exact errors. Must be a problem with the nightly builds?
            Last edited by mattupstate; Apr 1st, 2011, 04:13 PM.

            Comment


            • #7
              I believe that it was a problem in the latest spring-beans snapshot. I have submitted a JIRA along with a patch

              Comment


              • #8
                Thanks for the update.

                Comment

                Working...
                X