【发布时间】:2017-01-31 22:33:05
【问题描述】:
我试图使用 camel-hl7 组件在骆驼中创建一个 hl7 侦听器。当我在骆驼弹簧中使用相同的东西时,它正在工作。但是当我尝试在 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: 找不到合适的属性设置器:编解码器,因为没有相同类型的设置器方法: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 方法: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)
【问题讨论】:
标签: apache-camel hl7