【发布时间】:2014-06-18 03:09:57
【问题描述】:
我正在尝试使用 Camel 路由配置针对 XSD 验证传入的请求顺序(xml 格式)。但是我不断收到以下错误。谁能帮忙,我的代码如下。
@Override
public void configure() {
//Other code
onException(ValidationException.class)
.to("{{jms.queue.invalidRequestQueue}}");
from("{{jms.queue.fulfilmentRequest}}")
.routeId(ROUTE_ID)
.to("validation:src/main/resources/xml/OrderCanonical.xsd", "{{jms.queue.fulfilmentRequest}}")
.transacted(PROPAGATION_REQUIRED)
.setHeader(ORDER_ID, xpath(XPATH_FOR_ORDERLINE).namespaces(nm).stringResult())
.beanRef("indiciaService", "getIndicias")
.choice()
.when(header(BOLPMessageHeaders.STATUS).isEqualTo(BOLPFulfilmentStatuses.FAILED))
.log(LoggingLevel.DEBUG, "Indicia call failed. Skipping call to Adobe.")
.to("{{jms.queue.fulfilmentResponse}}")
.otherwise()
.beanRef("adobePostageService", "generatePdf")
.setHeader(BOLPMessageHeaders.STATUS, simple(BOLPFulfilmentStatuses.FULFILLED))
.convertBodyTo(String.class)
.log(LoggingLevel.DEBUG, PRINT_HEADERS)
.log(LoggingLevel.DEBUG, PRINT_BODY)
.to("{{jms.queue.fulfilmentResponse}}");
}
这是错误:
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route BOLPFulfilmentRoute at: >>> To[validator:src/main/resources/xml/OrderCanonical.xsd] <<< in route: Route(BOLPFulfilmentRoute)[[From[{{jms.queue.fulfilmentReque... because of Failed to resolve endpoint: validator://src/main/resources/xml/OrderCanonical.xsd due to: Cannot find resource: src/main/resources/xml/OrderCanonical.xsd in classpath for URI: src/main/resources/xml/OrderCanonical.xsd
【问题讨论】:
标签: java xml spring xsd apache-camel