初始化上下文

时间:2015-08-11 15:15:40

标签: java spring spring-mvc annotations

使用mvn exec:java命令

启动项目时出现异常

跟踪:

2015-08-11 16:57:58 INFO  DatabaseBeansConfig:60 - Creating bean connectionFactory
Exception in thread "main" java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:798)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:530)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:771)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:735)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:259)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:405)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:372)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.phistory.app.jetty.JettyInitializer.startJetty(JettyInitializer.java:41)
    at com.phistory.app.Main.main(Main.java:13)
2015-08-11 16:57:58 ERROR ContextLoader:358 - Context initialization failed
java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1018)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:834)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:798)
    at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:530)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:771)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:342)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:735)
    at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:259)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
    at org.eclipse.jetty.server.Server.start(Server.java:405)
    at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:106)
    at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
    at org.eclipse.jetty.server.Server.doStart(Server.java:372)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
    at com.phistory.app.jetty.JettyInitializer.startJetty(JettyInitializer.java:41)
    at com.phistory.app.Main.main(Main.java:13)

- 我的课程中的Jars:

    mvn dependency:tree
    [INFO] Scanning for projects...
    [INFO]
    [INFO]      ------------------------------------------------------------------------
    [INFO] Building XXXXXX 1.0.61
    [INFO]  ------------------------------------------------------------------------
    [INFO]
    [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ XXXXXX -
    --
    [INFO] XXXXXX:war:1.0.61
    [INFO] +- javax:javaee-web-api:jar:7.0:provided
    [INFO] +- javax:javaee-web-api:jar:javadoc:7.0:compile
    [INFO] +- com.the-carpedia:the-carpedia-data:jar:1.2.11:compile
    [INFO] |  +- javax.servlet:javax.servlet-api:jar:javadoc:3.1.0:compile
    [INFO] |  +- org.hibernate:hibernate-entitymanager:jar:4.3.10.Final:compile
    [INFO] |  |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
    [INFO] |  |  +- org.hibernate:hibernate-core:jar:4.3.10.Final:compile
    [INFO] |  |  |  +- antlr:antlr:jar:2.7.7:compile
    [INFO] |  |  |  \- org.jboss:jandex:jar:1.1.0.Final: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:4.0.5.Final:compile
    [INFO] |  |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
    [INFO] |  |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec: jar:1.0.0.Final:compile
    [INFO] |  |  \- org.javassist:javassist:jar:3.18.1-GA:compile
    [INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:javadoc:1.0.0.Final:compile
    [INFO] |  +- org.hibernate:hibernate-search-orm:jar:5.3.0.Final:compile
    [INFO] |  |  \- org.hibernate:hibernate-search-engine:jar:5.3.0.Final:compile
    [INFO] |  |     +- org.apache.lucene:lucene-core:jar:4.10.4:compile
    [INFO] |  |     +- org.apache.lucene:lucene-analyzers-common:jar:4.10.4:compile
    [INFO] |  |     \- org.apache.lucene:lucene-facet:jar:4.10.4:compile
    [INFO] |  |        \- org.apache.lucene:lucene-queries:jar:4.10.4:compile
    [INFO] |  +- org.hibernate:hibernate-search-orm:jar:javadoc:5.3.0.Final:compile
    [INFO] |  +- org.hibernate:hibernate-validator:jar:5.2.1.Final:compile
    [INFO] |  |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
    [INFO] |  |  \- com.fasterxml:classmate:jar:1.1.0:compile
    [INFO] |  +- org.apache.lucene:lucene-core:jar:javadoc:5.2.1:compile
    [INFO] |  +- org.springframework:spring-web:jar:4.2.0.RELEASE:compile
    [INFO] |  |  \- org.springframework:spring-aop:jar:4.2.0.RELEASE:compile
    [INFO] |  |     \- aopalliance:aopalliance:jar:1.0:compile
    [INFO] |  +- org.springframework:spring-web:jar:javadoc:4.2.0.RELEASE:compile
    [INFO] |  +- org.springframework:spring-orm:jar:4.2.0.RELEASE:compile
    [INFO] |  |  +- org.springframework:spring-jdbc:jar:4.2.0.RELEASE:compile
    [INFO] |  |  \- org.springframework:spring-tx:jar:4.2.0.RELEASE:compile
    [INFO] |  +- org.springframework:spring-orm:jar:javadoc:4.2.0.RELEASE:compile
    [INFO] |  +- org.springframework:spring-context:jar:javadoc:4.2.0.RELEASE:compile
    [INFO] |  +- org.apache.commons:commons-dbcp2:jar:2.1:compile
    [INFO] |  |  +- org.apache.commons:commons-pool2:jar:2.3:compile
    [INFO] |  |  \- commons-logging:commons-logging:jar:1.2:compile
    [INFO] |  +- org.apache.commons:commons-dbcp2:jar:javadoc:2.1:compile
    [INFO] |  +- org.slf4j:slf4j-api:jar:1.7.10:compile
    [INFO] |  +- org.slf4j:slf4j-api:jar:javadoc:1.7.10:compile
    [INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.6.0:compile
    [INFO] |  \- com.fasterxml.jackson.core:jackson-annotations:jar:javadoc:2.6.0:compile
    [INFO] +- org.springframework:spring-webmvc:jar:4.2.0.RELEASE:compile
    [INFO] |  +- org.springframework:spring-context:jar:4.2.0.RELEASE:compile
    [INFO] |  +- org.springframework:spring-core:jar:4.2.0.RELEASE:compile
    [INFO] |  \- org.springframework:spring-expression:jar:4.2.0.RELEASE:compile
    [INFO] +- org.springframework:spring-webmvc:jar:javadoc:4.2.0.RELEASE:compile
    [INFO] +- org.springframework:spring-context-support:jar:4.2.0.RELEASE:runtime
    [INFO] +- org.springframework:spring-beans:jar:4.2.0.RELEASE:runtime
    [INFO] +- org.freemarker:freemarker:jar:2.3.23:compile
    [INFO] +- org.freemarker:freemarker:jar:javadoc:2.3.23:compile
    [INFO] +- commons-collections:commons-collections:jar:3.2.1:runtime
    [INFO] +- mysql:mysql-connector-java:jar:5.1.36:runtime
    [INFO] +- org.jboss.logging:jboss-logging:jar:3.3.0.Final:provided
    [INFO] +- org.eclipse.jetty:jetty-webapp:jar:9.3.2.v20150730:compile
    [INFO] |  +- org.eclipse.jetty:jetty-xml:jar:9.3.2.v20150730:compile
    [INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:9.3.2.v20150730:compile
    [INFO] |  \- org.eclipse.jetty:jetty-servlet:jar:9.3.2.v20150730:compile
    [INFO] +- org.eclipse.jetty:jetty-webapp:jar:javadoc:9.3.2.v20150730:compile
    [INFO] +- org.eclipse.jetty:jetty-servlet:jar:javadoc:9.3.2.v20150730:compile
    [INFO] |  \- org.eclipse.jetty:jetty-security:jar:9.3.2.v20150730:compile
    [INFO] |     \- org.eclipse.jetty:jetty-server:jar:9.3.2.v20150730:compile
    [INFO] +- org.eclipse.jetty:jetty-server:jar:javadoc:9.3.2.v20150730:compile
    [INFO] |  +- javax.servlet:javax.servlet-api:jar:3.1.0:compile
    [INFO] |  +- org.eclipse.jetty:jetty-http:jar:9.3.2.v20150730:compile
    [INFO] |  \- org.eclipse.jetty:jetty-io:jar:9.3.2.v20150730:compile
    [INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.12:compile
    [INFO] |  \- log4j:log4j:jar:1.2.17:compile
    [INFO] \- org.slf4j:slf4j-log4j12:jar:javadoc:1.7.12:compile
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.317 s
    [INFO] Finished at: 2015-08-11T17:01:19+02:00
    [INFO] Final Memory: 17M/222M
    [INFO] ------------------------------------------------------------------------

的pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>XXXX</groupId>
<artifactId>XXXXX</artifactId>
<version>1.0.61</version>
<packaging>war</packaging>
<name>XXXX</name>   
<inceptionYear>2014</inceptionYear> 

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

    <java.source.version>1.8</java.source.version>
    <maven.compiler.plugin.version>3.1</maven.compiler.plugin.version>
    <maven.war.plugin.version>2.3</maven.war.plugin.version>
    <maven.clean.plugin.version>2.5</maven.clean.plugin.version>        

    <javax.ee.version>7.0</javax.ee.version>
    <com.thecarpedia.data.version>1.2.11</com.thecarpedia.data.version>
    <org.springframework.version>4.2.0.RELEASE</org.springframework.version>
    <org.freemarker.version>2.3.23</org.freemarker.version>     
    <org.eclipse.jetty.version>9.3.2.v20150730</org.eclipse.jetty.version>
    <org.slf4j-log4j12.version>1.7.12</org.slf4j-log4j12.version>
    <commons.collection.version>3.2.1</commons.collection.version>
    <mysql.connector.version>5.1.36</mysql.connector.version>   
    <jboss-logging.version>3.3.0.Final</jboss-logging.version>  
</properties>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>${maven.compiler.plugin.version}</version>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <source>${java.source.version}</source>
                <target>${java.source.version}</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>${maven.war.plugin.version}</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
                <outputDirectory>deployments</outputDirectory>
                <packagingExcludes>WEB-INF/lib/*-javadoc.jar</packagingExcludes>
                <warName>ROOT</warName>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>${maven.clean.plugin.version}</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>deployments</directory>
                        <includes>
                            <include>**/*.war</include>
                            <followSymlinks>false</followSymlinks>
                        </includes>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>
    </plugins>
</build>

<dependencies>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>${javax.ee.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-web-api</artifactId>
        <version>${javax.ee.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>com.the-carpedia</groupId>
        <artifactId>the-carpedia-data</artifactId>
        <version>${com.thecarpedia.data.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
            </exclusion>
        </exclusions>
    </dependency>       
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.springframework</groupId>
                <artifactId>spring-beans</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${org.springframework.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${org.springframework.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>${org.springframework.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${org.springframework.version}</version>
        <scope>runtime</scope>
    </dependency>       
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>${org.freemarker.version}</version>
    </dependency>
    <dependency>
        <groupId>org.freemarker</groupId>
        <artifactId>freemarker</artifactId>
        <version>${org.freemarker.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>${commons.collection.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>${mysql.connector.version}</version>
        <scope>runtime</scope>
    </dependency>
    <dependency>
        <groupId>org.jboss.logging</groupId>
        <artifactId>jboss-logging</artifactId>
        <version>${jboss-logging.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${org.eclipse.jetty.version}</version>
    </dependency>       
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>${org.eclipse.jetty.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-servlet</artifactId>
        <version>${org.eclipse.jetty.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-server</artifactId>
        <version>${org.eclipse.jetty.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${org.slf4j-log4j12.version}</version>
    </dependency>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${org.slf4j-log4j12.version}</version>
        <classifier>javadoc</classifier>
    </dependency>
</dependencies>

正如您所看到的,我的类路径中有org.springframework:spring-beans:jar:4.2.0.RELEASE jar。直到最近这个项目一直很好,但我不知道我必须做出哪些改变才能引入这个错误。

我尝试在Jetty和Wildfly 8.2上运行它,输出相同。

问题已解决 我发现我的数据库bean @Configuration有问题,我有一个像这样的循环引用:

    2015-08-15 18:50:07 INFO  DatabaseBeansConfig:60 - Creating bean connectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:74 - Creating bean poolableConnectionFactory
2015-08-15 18:50:07 INFO  DatabaseBeansConfig:88 - Creating bean objectPool

直到它抛出NoClassDefFoundError异常才发生这种情况。

2 个答案:

答案 0 :(得分:3)

尝试将spring-beans:jar:4.2.0.RELEASE Jar添加到您的IDE build path

Eclipse转到: 窗口&gt;偏好&gt; Java&gt;构建路径&gt;用户库。

答案 1 :(得分:0)

像这样将pom.xml中的Spring版本更改为最新版本

    version 2.1.3.RELEASE version