You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Bharath <bh...@gmail.com> on 2013/08/26 08:08:57 UTC
Failed to create route when using Mina2
Hi,
I have a route defined in my routebuilder class as
from("mina2:tcp://127.0.0.1:8888?sync=true&codec=#hl7codec").process(new
Processor() {....
and my camel-context.xml as
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<routeBuilder ref="myBuilder" />
</camelContext>
<bean id="myBuilder" class="org.test.poc.HL7MinaRouteBuilder" />
<bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec">
<property name="charset" value="iso-8859-1" />
</bean>
and i added the following dependencies in my pom.xml
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-hl7</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-core</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jms</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-mina2</artifactId>
<version>2.10.0</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v23</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-structures-v23</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi</groupId>
<artifactId>hapi-osgi-base</artifactId>
<version>1.2</version>
</dependency>
I tried to deploy this bundle in Fuse 7.1.0 and am getting the following
exception
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: mina2://tcp://127.0.0.1:8888?codec=%23hl7codec&sync=true
due to: Could not find a suitable setter for property: codec as there isn't
a setter method with same type: org.apache.camel.component.hl7.HL7MLLPCodec
nor type conversion possible: No type converter available to convert from
type: org.apache.camel.component.hl7.HL7MLLPCodec to the required type:
org.apache.mina.filter.codec.ProtocolCodecFactory with value
org.apache.camel.component.hl7.HL7MLLPCodec@6f434f5f
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:480)
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)
at
org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
at
org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:857)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)
... 19 more
any suggestions???
--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-when-using-Mina2-tp5737923.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Failed to create route when using Mina2
Posted by Bharath <bh...@gmail.com>.
cool!!
It works perfectly now
Thank you so much Claus for your suggestion.I used 7 edit hl7 tool and
validated the message before giving request
Cheers!!!
Bharath
--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-when-using-Mina2-tp5737923p5737947.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Failed to create route when using Mina2
Posted by Claus Ibsen <cl...@gmail.com>.
You need to send valid HL7 data. There is HL7 simulator apps you can
find on the internet to use for testing.
Or just check the source code for camel-hl7 for some examples we use
for testing.
On Mon, Aug 26, 2013 at 9:54 AM, Bharath <bh...@gmail.com> wrote:
> aaah!!
>
> Thanks Claus,I changed my endpoint from Mina2 to Mina and the bundle has
> been deployed and route has started successfully
>
> Now I gave request to the TCP endpoint mentioned above using TCP client java
> program but there was no response.
>
> Is there any other way to test this route??
>
>
> Cheers!!!
> Bharath
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-when-using-Mina2-tp5737923p5737930.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: Failed to create route when using Mina2
Posted by Bharath <bh...@gmail.com>.
aaah!!
Thanks Claus,I changed my endpoint from Mina2 to Mina and the bundle has
been deployed and route has started successfully
Now I gave request to the TCP endpoint mentioned above using TCP client java
program but there was no response.
Is there any other way to test this route??
Cheers!!!
Bharath
--
View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-when-using-Mina2-tp5737923p5737930.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Failed to create route when using Mina2
Posted by Claus Ibsen <cl...@gmail.com>.
Camel 2.10 uses mina 1.x for hl7.
You need Camel 2.11 or newer for mina 2.x using hl7
Check out the release notes
http://camel.apache.org/camel-2110-release.html
On Mon, Aug 26, 2013 at 8:08 AM, Bharath <bh...@gmail.com> wrote:
> Hi,
>
> I have a route defined in my routebuilder class as
>
> from("mina2:tcp://127.0.0.1:8888?sync=true&codec=#hl7codec").process(new
> Processor() {....
>
> and my camel-context.xml as
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
> <routeBuilder ref="myBuilder" />
> </camelContext>
>
> <bean id="myBuilder" class="org.test.poc.HL7MinaRouteBuilder" />
> <bean id="hl7codec" class="org.apache.camel.component.hl7.HL7MLLPCodec">
> <property name="charset" value="iso-8859-1" />
> </bean>
>
> and i added the following dependencies in my pom.xml
>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-hl7</artifactId>
> <version>2.10.0</version>
> </dependency>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-core</artifactId>
> <version>2.10.0</version>
> </dependency>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-jms</artifactId>
> <version>2.10.0</version>
> </dependency>
> <dependency>
> <groupId>org.apache.camel</groupId>
> <artifactId>camel-mina2</artifactId>
> <version>2.10.0</version>
> </dependency>
> <dependency>
> <groupId>ca.uhn.hapi</groupId>
> <artifactId>hapi-structures-v23</artifactId>
> <version>1.2</version>
> </dependency>
> <dependency>
> <groupId>ca.uhn.hapi</groupId>
> <artifactId>hapi-structures-v23</artifactId>
> <version>1.2</version>
> </dependency>
> <dependency>
> <groupId>ca.uhn.hapi</groupId>
> <artifactId>hapi-osgi-base</artifactId>
> <version>1.2</version>
> </dependency>
>
> I tried to deploy this bundle in Fuse 7.1.0 and am getting the following
> exception
>
> Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
> resolve endpoint: mina2://tcp://127.0.0.1:8888?codec=%23hl7codec&sync=true
> due to: Could not find a suitable setter for property: codec as there isn't
> a setter method with same type: org.apache.camel.component.hl7.HL7MLLPCodec
> nor type conversion possible: No type converter available to convert from
> type: org.apache.camel.component.hl7.HL7MLLPCodec to the required type:
> org.apache.mina.filter.codec.ProtocolCodecFactory with value
> org.apache.camel.component.hl7.HL7MLLPCodec@6f434f5f
> at
> org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:480)
> at
> org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:50)
> at
> org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:187)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:108)
> at
> org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:114)
> at
> org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
> at
> org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:90)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:857)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:172)
> ... 19 more
>
> any suggestions???
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Failed-to-create-route-when-using-Mina2-tp5737923.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen