2016-10-27 37 views
0

我知道這已經被問過很多次了,但是我在批處理:job標記上生成了tomcat服務器錯誤。該應用程序在IntelliJ + tomcat插件中運行良好。代理將不允許服務器下載任何的模式,但似乎並沒有影響到豆或TX標籤匹配的通配符是嚴格的,但是對於元素'batch:job'沒有發現聲明 - 只是在生產服務器上

<tx:annotation-driven mode="aspectj" transaction-manager="transactionManager"/> 
<batch:job id="createCsvForJob"> 
    <batch:step id="createCsvFile"> 
     <batch:tasklet ref="createCsvForTasklet" /> 
    </batch:step> 
</batch:job> 

我可以下載的schemaLocation網址,所以我不認爲有任何怪異字符或錯別字。有什麼明顯的我失蹤了?

<?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:batch="http://www.springframework.org/schema/batch" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:task="http://www.springframework.org/schema/task" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd 
"> 

回答

0

我的修正將包括在的schemaLocation的版本號,即

http://www.springframework.org/schema/batch/spring-batch-2.0.xsd 

所以我現在有

<beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:batch="http://www.springframework.org/schema/batch" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:task="http://www.springframework.org/schema/task" 
    xmlns:tx="http://www.springframework.org/schema/tx" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd 
    http://www.springframework.org/schema/batch http://www.springframework.org/schema/batch/spring-batch-2.0.xsd 
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd 
    http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd 
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd 
"> 

的原因是因爲我的服務器無法訪問互聯網需要使用包含在戰爭文件中的互聯網。要找到正確的版本號,我命令單擊了IntelliJ中的xmlns url

xmlns:batch="http://www.springframework.org/schema/batch" 

並剛讀取版本號。

希望這可以幫助別人。

相關問題