2016-10-27 40 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" 

并刚读取版本号。

希望这可以帮助别人。

相关问题