BeanCreationException与我的第一个Maven

BeanCreationException与我的第一个Maven

本文介绍了获得一个org.springframework.beans.factory.BeanCreationException与我的第一个Maven,Spring项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用我的第一个Maven,Spring项目获取org.springframework.beans.factory.BeanCreationException。我已经在eclipse和spring程序了一段时间,但是我正在研究使用maven来帮助。



我在eclipse中有一个maven项目,这里是我的pom。 xml文件:

 < project xmlns =http://maven.apache.org/ POM / 4.0.0xmlns:xsi =http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation =http://maven.apache.org/POM/4.0。 0 http://maven.apache.org/maven-v4_0_0.xsd\">
< modelVersion> 4.0.0< / modelVersion>
< groupId> org.springsource.greenbeans.maven< / groupId>
< artifactId> WebFlowTemplate< / artifactId>
< packaging> war< / packaging>
< version> 0.0.1-SNAPSHOT< / version>
< name> WebFlowTemplate Maven Webapp< / name>
< url> http://maven.apache.org< / url>
<依赖关系>

<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 3.6.3.Final< / version>
< / dependency>

<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-validator< / artifactId>
< version> 4.3.0.Final< / version>
< / dependency>

<依赖关系>
< groupId> junit< / groupId>
< artifactId> junit< / artifactId>
< version> 3.8.1< / version>
< scope> test< / scope>
< / dependency>

<依赖关系>
< groupId> org.springframework< / groupId>
< artifactId> spring-context< / artifactId>
< version> 3.1.2.RELEASE< / version>
< / dependency>

<依赖关系>
< groupId> org.springframework.webflow< / groupId>
< artifactId> spring-webflow< / artifactId>
< version> 2.3.1.RELEASE< / version>
< / dependency>

<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-core< / artifactId>
< version> 3.1.2.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-web< / artifactId>
< version> 3.1.2.RELEASE< / version>
< / dependency>
<依赖关系>
< groupId> org.springframework.security< / groupId>
< artifactId> spring-security-config< / artifactId>
< version> 3.1.2.RELEASE< / version>
< / dependency>


<依赖关系>
< groupId> log4j< / groupId>
< artifactId> log4j< / artifactId>
< version> 1.2.17< / version>
< / dependency>



< / dependencies>
< build>
< finalName> WebFlowTemplate< / finalName>
< / build>
< / project>

但是,如果我尝试运行此Spring WebFlow项目,我将收到以下错误。我的pox.xml中缺少什么?有人可以帮助我这个。

  EVERE:异常发送上下文初始化事件到类org.springframework.web的监听器实例。 context.ContextLoaderListener 
org.springframework.beans.factory.BeanCreationException:创建名为org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0的bean时出错:bean的初始化失败;嵌套异常是org.springframework.beans.factory.CannotLoadBeanClassException:在null中定义名为org.springframework.context.config.internalBeanConfigurerAspect的bean,找不到类[org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect]嵌套异常是java.lang.ClassNotFoundException:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
相关原因:org.springframework.beans.factory.CannotLoadBeanClassException:找不到类[org.springframework.beans.factory.aspectj .AnnotationBeanConfigurerAspect]用于在null中定义的名称为org.springframework.context.config.internalBeanConfigurerAspect的bean;嵌套异常是java.lang.ClassNotFoundException:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:294)
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
在org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
在org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingleton s(DefaultListableBeanFactory.java:609)
在org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext。 java:469)
在org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
在org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
在org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
在org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
在org.apache .catalina.core.StandardHost.start(StandardHost.java:840)
在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
在org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
在org.apache .catalina.core.StandardService.start(StandardService.java:525)
在org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
在org.apache.catalina.startup .Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:616)
在org.apache.catalina.startup.Bootstrap .start(Bootstrap.java:289)
在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
导致:org.springframework.beans.factory.CannotLoadBeanClassException:不能找到类[org.springframework.beans.fact ory.aspectj.AnnotationBeanConfigurerAspect]在null中定义名为org.springframework.context.config.internalBeanConfigurerAspect的bean;嵌套异常是java.lang.ClassNotFoundException:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
在org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:624)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573)
在org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
在org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:341)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:320)
在org.springframework.beans.factory。 support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:307)
在org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1155)
在org.springframework.web.servlet.handler。 AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:105)
在org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initApplicationContext(AbstractHandlerMethodMapping.java:89)
在org.springframework.context.support.ApplicationObjectSupport。 initApplicationContext(ApplicationObjectSupport.java:119)
在org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
在org.springframework.context.support.ApplicationObjectSupport.setApplicationContext( ApplicationObjectSupport.java:73)
在org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareIn terfaces(ApplicationContextAwareProcessor.java:117)
在org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization( AbstractAutowireCapableBeanFactory.java:394)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean( AbstractAutowireCapableBeanFactory.java:519)
... 26更多
导致:java.lang.ClassNotFoundException:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
在org.apache.catalina。 loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClass Loader.java:1526)
在org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
在org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java: 417)
在org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
在org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java: 1254)
... 43更多
相关原因:
org.springframework.beans.factory.CannotLoadBeanClassException:找不到类[org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] for bean在null中定义名称为org.springframework.context.config.internalBeanConfigurerAspect;嵌套异常是java.lang.ClassNotFoundException:org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
在org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:624)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573)
在org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
在org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:341)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:312)
在org.springframework.beans.factory。 support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:420)
在org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1169)
在org.springframework.beans.factory.BeanFactoryUtils。 beanOfTypeIncludingAncestors(BeanFactoryUtils.java:277)
在org.springframework.web.servlet.handler.AbstractHandlerMapping.detectMappedInterceptors(AbstractHandlerMapping.java:212)
在org.springframework.web.servlet.handler.AbstractHandlerMapping。 initApplicationContext(AbstractHandlerMapping.java:186)
在org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initApplicationContext(AbstractHandlerMethodMapping.java:88)
在org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(应用程序对象rt.java:72)
在org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
在org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java: 117)
在org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
在org.springframework.beans.factory.support.AbstractAutowireCapableBeanFa ctory.createBean(AbstractAutowireCapableBeanFactory.java:456)
在org.springframework.beans.factory.support.AbstractBeanFactory $ 1.getObject(AbstractBeanFactory.java:294)
在org.springframework.beans.factory.support .DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
在org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
在org.springframework.beans.factory.support .AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
在org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
在org.springframework.context.support.AbstractApplicationContext .finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
在org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
在org.springframework.web.context.ContextLoa der.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
在org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
在org.springframework.web.context.ContextLoaderListener.contextInitialized( ContextLoaderListener.java:111)
在org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
在org.apache.catalina.core.StandardContext.start(StandardContext.java: 4705)
在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
在org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
在org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
在org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
在org .apache.catalina.core.StandardService.start(StandardService.java:525)
在org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
在org.apache.catalina 。 startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:616)
在org.apache.catalina.startup。 Bootstrap.start(Bootstrap.java:289)
在org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
引起的:java.lang.ClassNotFoundException:org.springframework。 beans.factory.aspectj.AnnotationBeanConfigurerAspect
在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
在org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java :1526)
在org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
在org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass( AbstractBeanDefinition.java:417)
在org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
在org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass( AbstractBeanFactory.java:1254)
... 45更多
2012年9月12日12:37:20 PM org.apache.catalina.core.StandardContext start


解决方案

只需添加:

 < dependency> 
< groupId> org.springframework< / groupId>
< artifactId> spring-aspects< / artifactId>
< version> 3.1.2.RELEASE< / version>
< / dependency>


Getting a org.springframework.beans.factory.BeanCreationException with my first Maven, Spring Project. I been program for some time now with eclipse and Spring but I am looking into using maven to help out.

I have a maven project in eclipse and here is my pom.xml file:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.springsource.greenbeans.maven</groupId>
    <artifactId>WebFlowTemplate</artifactId>
    <packaging>war</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>WebFlowTemplate Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <dependencies>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>3.6.3.Final</version>
        </dependency>

        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>4.3.0.Final</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.webflow</groupId>
            <artifactId>spring-webflow</artifactId>
            <version>2.3.1.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>3.1.2.RELEASE</version>
        </dependency>


        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>



    </dependencies>
    <build>
        <finalName>WebFlowTemplate</finalName>
    </build>
</project>

but I am getting the following error if I try to run this Spring WebFlow Project. what am I missing in my pox.xml. can someone please help me with this.

EVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] for bean with name 'org.springframework.context.config.internalBeanConfigurerAspect' defined in null; nested exception is java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
Related cause: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] for bean with name 'org.springframework.context.config.internalBeanConfigurerAspect' defined in null; nested exception is java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] for bean with name 'org.springframework.context.config.internalBeanConfigurerAspect' defined in null; nested exception is java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:624)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:341)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:320)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:307)
    at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:1155)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:105)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initApplicationContext(AbstractHandlerMethodMapping.java:89)
    at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
    at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
    at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
    at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:117)
    at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    ... 26 more
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
    ... 43 more
Related cause:
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect] for bean with name 'org.springframework.context.config.internalBeanConfigurerAspect' defined in null; nested exception is java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1262)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:624)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:573)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1331)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:341)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:420)
    at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1169)
    at org.springframework.beans.factory.BeanFactoryUtils.beansOfTypeIncludingAncestors(BeanFactoryUtils.java:277)
    at org.springframework.web.servlet.handler.AbstractHandlerMapping.detectMappedInterceptors(AbstractHandlerMapping.java:212)
    at org.springframework.web.servlet.handler.AbstractHandlerMapping.initApplicationContext(AbstractHandlerMapping.java:186)
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initApplicationContext(AbstractHandlerMethodMapping.java:88)
    at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)
    at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)
    at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)
    at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:117)
    at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:92)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1448)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:609)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4206)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
    at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
    at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:417)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1283)
    at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1254)
    ... 45 more
Sep 12, 2012 12:37:20 PM org.apache.catalina.core.StandardContext start
解决方案

just add:

<dependency>
     <groupId>org.springframework</groupId>
     <artifactId>spring-aspects</artifactId>
     <version>3.1.2.RELEASE</version>
</dependency>

这篇关于获得一个org.springframework.beans.factory.BeanCreationException与我的第一个Maven,Spring项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-29 16:50