【问题标题】:What's wrong with my Spring Batch context?我的 Spring Batch 上下文有什么问题?
【发布时间】:2011-05-18 19:37:51
【问题描述】:

这是 Spring Batch 的上下文:

<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
  xmlns:b="http://www.springframework.org/schema/batch"
  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.5.xsd
    http://www.springframework.org/schema/batch
    http://www.springframework.org/schema/batch/spring-batch-2.1.xsd">
  <b:job id="bar" job-repository="my-job-repository">
    <b:step id="foo">
      <b:tasklet transaction-manager="my-transaction-manager">
        <b:chunk reader="itemReader" writer="itemWriter"/>
      <b:tasklet>
    </b:step>
  </b:job>
</beans:beans>

这是 Spring Batch 所说的:

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found
starting with element 'b:tasklet'. One of
'{"http://www.springframework.org/schema/batch":transaction-attributes,
"http://www.springframework.org/schema/batch":no-rollback-exception-classes,
"http://www.springframework.org/schema/batch":listeners,
"http://www.springframework.org/schema/beans":bean,
"http://www.springframework.org/schema/beans":ref}' is expected.

我的 XML 有什么问题?

ps。我正在使用org.springframework.batch:spring-batch-core:2.1.7.RELEASE

【问题讨论】:

  • 也许你应该阅读错误信息......它几乎解释了你的错误。 (缺少必需的标签)

标签: java xml spring xsd spring-batch


【解决方案1】:

您忘记关闭 tasklet 标记。可能是从here 复制并复制了错误

【讨论】:

  • 斜杠。斜杠。斜杠。
猜你喜欢
  • 2016-06-04
  • 1970-01-01
  • 1970-01-01
  • 2016-05-13
  • 1970-01-01
  • 1970-01-01
  • 2012-11-06
  • 1970-01-01
  • 2015-09-18
相关资源
最近更新 更多