我正在嘗試使用camel-hl7組件在駱駝中創建一個hl7偵聽器。當我在駱駝春天使用它時,它正在工作。但是,當我嘗試使用同一個Java中的DSL如下,Camel HL7codec在Java中不工作DSL
HL7MLLPCodec hl7codec = new HL7MLLPCodec();
hl7codec.setCharset("iso-8859-1");
camelContext.addRoutes(new RouteBuilder() {
public void configure() {
from("mina:tcp://localhost:4444?sync=true&codec=hl7codec").to("file://test");
}
});
它拋出異常,
java.lang.IllegalArgumentException異常:找不到財產合適的setter方法:編解碼器,因爲ISN '相同類型的setter方法:java.lang.String也可以進行類型轉換:沒有類型轉換器可用於從類型java.lang.String轉換爲所需類型:org.apache.mina.filter.codec.ProtocolCodecFactory價值hl7codec !在org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:588) !在org.apache.camel.util.IntrospectionSupport.setProperty(IntrospectionSupport.java:616) !在org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:473) !在org.apache.camel.util.IntrospectionSupport.setProperties(IntrospectionSupport.java:483) !在org.apache.camel.util.EndpointHelper.setProperties(EndpointHelper.java:255) !在org.apache.camel.impl.DefaultComponent.setProperties(DefaultComponent.java:257) !在org.apache.camel.component.mina.MinaComponent.createEndpoint(MinaComponent.java:92) !在org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:114) !在org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:568) ! ...省略了33個常用框架 !導致:org.apache.camel.ResolveEndpointFailedException:無法解析端點:mina:// tcp:// localhost:4444?codec = hl7codec & sync = true由於:無法找到合適的setter屬性:codec as theren沒有類型轉換器:java.lang.String也沒有類型轉換:沒有類型轉換器可用於從類型java.lang.String轉換爲所需類型:org.apache.mina.filter.codec.ProtocolCodecFactory價值hl7codec !在org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:588) !在org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:79)