2017-07-06 51 views
1

我設法完成了我的網頁應用程序與澤西島和Mybatis,現在我必須整合春天它,但我得到這個錯誤:org.apache.catalina .LifecycleException:子容器在啓動過程中失敗 考慮到這是我第一次與春天我相信我做了錯誤的事情。 這是我AppContext.xml未能整合mybatis +球衣網頁應用上的彈簧

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" 
xmlns:c="http://www.springframework.org/schema/c" xmlns:cache="http://www.springframework.org/schema/cache" 
xmlns:context="http://www.springframework.org/schema/context" 
xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee" 
xmlns:lang="http://www.springframework.org/schema/lang" 
xmlns:mybatis-spring="http://mybatis.org/schema/mybatis-spring" 
xmlns:p="http://www.springframework.org/schema/p" xmlns:task="http://www.springframework.org/schema/task" 
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.3.xsd 
    http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache-4.3.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd 
    http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-4.1.xsd 
    http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.3.xsd 
    http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-4.3.xsd 
    http://mybatis.org/schema/mybatis-spring http://mybatis.org/schema/mybatis-spring-1.2.xsd 
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.3.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.1.xsd 
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.3.xsd"> 



<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" 
    destroy-method="close" p:driverClass="${app.jdbc.driverClassName}" 
    p:jdbcUrl="${app.jdbc.url}" p:user="${app.jdbc.username}" p:password="${app.jdbc.password}" 
    p:acquireIncrement="10" p:idleConnectionTestPeriod="60" p:maxPoolSize="100" 
    p:maxStatements="50" p:minPoolSize="10" /> 

<tx:annotation-driven transaction-manager="transactionManager" /> 

<bean id="transactionManager" 
    class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> 
    <property name="dataSource" ref="dataSource" /> 
</bean> 

<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> 
    <property name="dataSource" ref="dataSource" /> 
    <property name="configLocation" value="dao/config.xml" /> 
</bean> 

<bean id="test" class="org.mybatis.spring.mapper.MapperScannerConfigurer"> 
    <property name="basePackage" value="dao" /> 
</bean> 
</beans> 

,因爲我已經和我要連接的服務器的信息file.properties數據源(和OBV。加入C3P0 JAR)

我已經使用與.xml映射文件相同名稱的接口,並且這些方法與select/insert/update ecc的id具有相同的名稱。

然後我做了誰@Autowire上述接口

我缺少什麼經理?在此先感謝

編輯:我的web.xml的結構類似:

<display-name>MostraPersone</display-name> 
<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:AppContext.xml</param-value> 
</context-param> 
<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 
<servlet> 
    <servlet-name>TestJersey</servlet-name> 
    <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> 
    <init-param> 
     <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> 
     <param-value>true</param-value> 
    </init-param> 
    <init-param> 
     <param-name>jersey.config.server.provider.packages</param-name> 
     <param-value>logic</param-value> 
    </init-param> 
    <load-on-startup>1</load-on-startup> 
</servlet> 
<servlet-mapping> 
    <servlet-name>TestJersey</servlet-name> 
    <url-pattern>/mostra/*</url-pattern> 
</servlet-mapping> 
<welcome-file-list> 
    <welcome-file>/Index.html</welcome-file> 
</welcome-file-list> 

回答

0

此異常的原因通常是由和錯誤在web.xml中造成的,或者沒有相應的或字錯誤或其他原因,而且,與Servlet>和對應的都不錯,它不應該出現這個異常