2013-02-27 1 views
0

Я получил эту ошибку, когда я перезапустить кот «инициализация контекста не удалась»Я получил эту ошибку, когда я перезапустить кот «инициализация контекста не удалась»

[ERROR][2013-02-26 15:48:49,432][ContextLoader] - [Context initialization failed] 
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration   problem: Failed to import bean definitions from relative location [applications\applications.xml] 
Offending resource: ServletContext resource [/WEB-INF/config/context/appContext.xml]; nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [..\..\..\..\schema\ab- products\common\resources\appContext-services.xml] 
Offending resource: ServletContext resource [/WEB-INF/config/context/applications/applications.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/schema/ab-products/common/resources/appContext-services.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/schema/ab-products/common/resources/appContext-services.xml] 

Вот-services.xml контекста приложения, она существует в/схемы/AB-продукты/общие/ресурсы/контекст приложения-services.xml

<?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:p="http://www.springframework.org/schema/p" 
xmlns:util="http://www.springframework.org/schema/util" 
xmlns:security="http://www.springframework.org/schema/security" 
xsi:schemaLocation=" 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.xsd 
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd 
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> 

<!-- ========================= Start of SERVICE DEFINITIONS ========================= --> 

<!-- 
    Per-activity configuration bean. 
--> 
<bean id="AbCommonResources-configuration" 
    class="com.archibus.service.cost.Configuration"> 
    <property name="defaultDateStart" value="1980-01-01" /> 
    <property name="defaultDateEnd" value="2099-12-31" /> 
</bean> 

<!-- 
    Remote version of CostService. This service is not used when the client calls WFRs. 
    TODO: fix proxyInterfaces="com.archibus.utility.Immutable": define and use ICostService interface. 
--> 
<bean id="CostService-remote" 
    class="org.springframework.aop.framework.ProxyFactoryBean" 
    p:proxyInterfaces="com.archibus.utility.Immutable" 
    p:target-ref="CostService"> 
    <property name="interceptorNames"> 
     <list> 
      <value>securityInterceptor</value> 
      <value>exceptionHandlingInterceptor</value> 
     </list> 
    </property> 
</bean> 

<!-- 
    Local version of CostService, used by WFRs. 
--> 
<bean id="CostService" 
    class="com.archibus.service.cost.CostService" 
    scope="prototype" 
    p:configuration-ref="AbCommonResources-configuration"> 
</bean> 

<!-- 
    Cost beans. 
--> 
<bean id="actualCost" 
    class="com.archibus.app.common.finance.domain.ActualCost" 
    scope="prototype"> 
</bean> 
<bean id="scheduledCost" 
    class="com.archibus.app.common.finance.domain.ScheduledCost" 
    scope="prototype"> 
</bean> 
<bean id="recurringCost" 
    class="com.archibus.app.common.finance.domain.RecurringCost" 
    p:configuration-ref="AbCommonResources-configuration" 
    scope="prototype"> 
</bean> 

здесь applications.xml

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation=" 
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd 
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"> 

<import resource="..\..\..\..\schema\ab-products\common\resources\appContext-services.xml" /> 

+0

можно показать appContext-services.xml.I думаю, что может быть проблема – PSR

ответ

0

Совершенство - вот ваша задача:

java.io.FileNotFoundException: Could not open ServletContext resource [/schema/ab-products/common/resources/appContext-services.xml] 

Spring не удалось найти, что контекст приложения XML в CLASSPATH.

Проверьте местоположение и способ, которым вы указали его в web.xml. Один или оба ошибаются.

+0

как кажется, оба они правильные –

+0

"кажется"? Томкат не согласен с вами. Я бы просто прослушиватель загрузчика контекста сервлета загрузил эти XML-контексты контекста приложения. – duffymo

0

проблема может быть местом Вашего файла XML

FileNotFoundException означает, что он не может найти файл в этом пути.

0

Ошибка стека довольно ясна. инициализации контекста терпит неудачу, когда он загружает /WEB-INF/config/context/applications/applications.xml

Я догадывался импортировать следующий файл, /schema/ab-products/common/resources/appContext-services.xml

переместить файл в /WEB-INF/config/context/applications/ и обновление импорта заявление в applications.xml

0

Проблема, как представляется:

nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/schema/ab-products/common/resources/appContext-services.xml] at 

appContext-services.xml присутствует в указанном месте и читается (т. Е. Имеет право разрешения)?

1

Благодарим вас за ответ, я решаю эту проблему. Это примерно в java-версии. Я изменил версию Java версии 1.4 на 1.6, так что теперь нет проблем.