Spring应用程序没有正确打印异常:找不到FatalBeanException

时间:2016-05-30 07:41:40

标签: java spring

在调试Spring应用程序时,我没有收到详细的BeanCreationException消息,而是

java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException

依赖

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
    </dependency>

在POM中。

更新

mvn dependency:tree包括以下内容:

...
[INFO] +- org.springframework:spring-context:jar:4.2.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:4.2.5.RELEASE:compile
[INFO] |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  +- org.springframework:spring-core:jar:4.2.5.RELEASE:compile
[INFO] |  |  \- commons-logging:commons-logging:jar:1.2:compile
[INFO] |  \- org.springframework:spring-expression:jar:4.2.5.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:4.2.5.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:4.2.5.RELEASE:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:4.2.5.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:4.2.5.RELEASE:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:5.1.0.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:compile
[INFO] |  +- org.hibernate:hibernate-core:jar:5.1.0.Final:compile
[INFO] |  |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  |  +- org.jboss:jandex:jar:2.0.0.Final:compile
[INFO] |  |  \- com.fasterxml:classmate:jar:1.3.0:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:5.0.1.Final:compile
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  +- org.javassist:javassist:jar:3.20.0-GA:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-jta_1.1_spec:jar:1.1.1:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.38:compile
[INFO] +- com.opencsv:opencsv:jar:3.7:compile
[INFO] +- commons-io:commons-io:jar:1.3.2:compile
[INFO] +- org.controlsfx:controlsfx:jar:8.40.10:compile
...

1 个答案:

答案 0 :(得分:0)

检查类路径,可能是由其他错误引起的。显示完整的堆栈strace

list