我是spring的天真用户。我刚刚开始学习它。我想通过理解例子来学习spring。所以我尝试从链接https://github.com/SpringSource/spring-petclinic安装 spring 的 petclicnic 示例应用程序。当我尝试运行 mvn install 命令时,出现以下错误 java.lang.NoClassDefFoundError: org/springframework/beans/factory/NoUniqueBeanDe finitionException。我尝试使用https://jira.springsource.org/browse/SPR-10218中提供的信息来解决它。我添加了所有依赖项。现在我收到以下错误。请帮忙
ERROR ContextLoader - Context initialization failed
java.lang.NoClassDefFoundError: org/springframework/asm/ClassVisitor
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.<init>(AbstractAutowireCapableBeanFactory. java:121) ~[spring-beans-3.1.4
.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.beans.factory.support.Abstract AutowireCapableBean
Factory.<init>(AbstractAutowireCapableBeanFactory. java:168) ~[spring-beans-3.1.4
.RELEASE.jar:3.1.4.RELEASE]
at org.springframework.beans.factory.support.DefaultL istableBeanFactory.
<init>(DefaultListableBeanFactory.java:163) ~[spring-beans-3.1.4.RELEASE.jar:3.1
.4.RELEASE]
at org.springframework.context.support.AbstractRefres hableApplicationCon
text.createBeanFactory(AbstractRefreshableApplicat ionContext.java:194) ~[spring-
context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.context.support.AbstractRefres hableApplicationCon
text.refreshBeanFactory(AbstractRefreshableApplica tionContext.java:127) ~[spring
-context-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.obtain
FreshBeanFactory(AbstractApplicationContext.java:5 37) ~[spring-context-3.2.2.REL
EASE.jar:3.2.2.RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.refres
h(AbstractApplicationContext.java:451) ~[spring-context-3.2.2.RELEASE.jar:3.2.2.
RELEASE]
at org.springframework.web.context.ContextLoader.conf igureAndRefreshWebA
pplicationContext(ContextLoader.java:389) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.R
ELEASE]
at org.springframework.web.context.ContextLoader.init WebApplicationConte
xt(ContextLoader.java:294) ~[spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.web.context.ContextLoaderListe ner.contextInitiali
zed(ContextLoaderListener.java:112) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.apache.catalina.core.StandardContext.listenerS tart(StandardContex
t.java:4791) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardContext.startInte rnal(StandardContex
t.java:5285) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:150)
[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.
java:1559) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.
java:1549) [tomcat-embed-core-7.0.30.jar:7.0.30]
at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303) [n
a:1.6.0_20]
at java.util.concurrent.FutureTask.run(FutureTask.jav a:138) [na:1.6.0_20
]
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
utor.java:886) [na:1.6.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
.java:908) [na:1.6.0_20]
at java.lang.Thread.run(Thread.java:619) [na:1.6.0_20]
Caused by: java.lang.ClassNotFoundException: org.springframework.asm.ClassVisito
r
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoa
der.java:1714) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.loader.WebappClassLoader.loadC lass(WebappClassLoa
der.java:1559) ~[tomcat-embed-core-7.0.30.jar:7.0.30]
... 20 common frames omitted
INFO XmlWebApplicationContext - Closing Root WebApplicationContext: startup dat
e [Wed Mar 27 11:31:56 CDT 2013]; root of context hierarchy
WARN XmlWebApplicationContext - Exception thrown from ApplicationListener handl
ing ContextClosedEvent
java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - c
all 'refresh' before multicasting events via the context: Root WebApplicationCon
text: startup date [Wed Mar 27 11:31:56 CDT 2013]; root of context hierarchy
at org.springframework.context.support.AbstractApplic ationContext.getApp
licationEventMulticaster(AbstractApplicationContex t.java:347) [spring-context-3.
2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.publis
hEvent(AbstractApplicationContext.java:334) [spring-context-3.2.2.RELEASE.jar:3.
2.2.RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.doClos
e(AbstractApplicationContext.java:1049) [spring-context-3.2.2.RELEASE.jar:3.2.2.
RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.close(
AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RE
LEASE]
at org.springframework.web.context.ContextLoader.clos eWebApplicationCont
ext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.web.context.ContextLoaderListe ner.contextDestroye
d(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.apache.catalina.core.StandardContext.listenerS top(StandardContext
.java:4831) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardContext.stopInter nal(StandardContext
.java:5478) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.util.LifecycleBase.stop(Lifecy cleBase.java:232) [
tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:160)
[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.
java:1559) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.
java:1549) [tomcat-embed-core-7.0.30.jar:7.0.30]
at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303) [n
a:1.6.0_20]
at java.util.concurrent.FutureTask.run(FutureTask.jav a:138) [na:1.6.0_20
]
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
utor.java:886) [na:1.6.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
.java:908) [na:1.6.0_20]
at java.lang.Thread.run(Thread.java:619) [na:1.6.0_20]
WARN XmlWebApplicationContext - Exception thrown from LifecycleProcessor on con
text close
java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refr
esh' before invoking lifecycle methods via the context: Root WebApplicationConte
xt: startup date [Wed Mar 27 11:31:56 CDT 2013]; root of context hierarchy
at org.springframework.context.support.AbstractApplic ationContext.getLif
ecycleProcessor(AbstractApplicationContext.java:36 0) [spring-context-3.2.2.RELEA
SE.jar:3.2.2.RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.doClos
e(AbstractApplicationContext.java:1057) [spring-context-3.2.2.RELEASE.jar:3.2.2.
RELEASE]
at org.springframework.context.support.AbstractApplic ationContext.close(
AbstractApplicationContext.java:1010) [spring-context-3.2.2.RELEASE.jar:3.2.2.RE
LEASE]
at org.springframework.web.context.ContextLoader.clos eWebApplicationCont
ext(ContextLoader.java:558) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.springframework.web.context.ContextLoaderListe ner.contextDestroye
d(ContextLoaderListener.java:143) [spring-web-3.2.2.RELEASE.jar:3.2.2.RELEASE]
at org.apache.catalina.core.StandardContext.listenerS top(StandardContext
.java:4831) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.StandardContext.stopInter nal(StandardContext
.java:5478) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.util.LifecycleBase.stop(Lifecy cleBase.java:232) [
tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.util.LifecycleBase.start(Lifec ycleBase.java:160)
[tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.
java:1559) [tomcat-embed-core-7.0.30.jar:7.0.30]
at org.apache.catalina.core.ContainerBase$StartChild. call(ContainerBase.
java:1549) [tomcat-embed-core-7.0.30.jar:7.0.30]
at java.util.concurrent.FutureTask$Sync.innerRun(Futu reTask.java:303) [n
a:1.6.0_20]
at java.util.concurrent.FutureTask.run(FutureTask.jav a:138) [na:1.6.0_20
]
at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
utor.java:886) [na:1.6.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
.java:908) [na:1.6.0_20]
at java.lang.Thread.run(Thread.java:619) [na:1.6.0_20]