You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Chubutin <ra...@gmail.com> on 2013/04/18 17:28:33 UTC

Create a Simple CXF - Http Route

Hi, im trying to register a Camel route in Servicemix 4.x. 

This route is a cxf consumer, xslt and a provider HTTP. I erase the xslt
endpoint to avoid any conflicts because that is not relevant. I dont know
what is wrong in the xml declaration.

<camelcxf:cxfEndpoint id="testBridgeLegacyConsumerEndpoint"
		serviceClass="com.esb.service.VesselVisitorService"
address="/vesselVisitorService"
		endpointName="ns:vesselVisitorServicePort"
serviceName="ns:vesselVisitorService"
		xmlns:ns="http://service.esb.com/" />

<camel:camelContext id="pruebaBridgeLegacyRoute"
		trace="true">
		<camel:route id="rutaLegacy">
			<camel:from uri="cxf:bean:pruebaBridgeLegacyConsumerEndpoint" />
			<camel:to uri="http://localhost/vessel_visitors.xml" />
		</camel:route>

	</camel:camelContext>

The URI http://localhost/vessel_visitors.xml is an XML file that I have in
my apache server in port 80.

Camel regist the route if I duplicate the cxf:endpoint and register the
route with *from* and *to* with both cxf endpoints. 



In this way, the context and the route are not register in karaf, but the
camel logs doesnt indicate a problem. The Camel log in Servicemix is 

12:22:03,931 | DEBUG | mix-4.4.2/deploy | Activator                        |
91 - org.apache.camel.camel-core - 2.8.5 | Bundle started:
PruebaBridgeLegacy
12:22:03,938 | DEBUG | rint Extender: 3 | CxfNamespaceHandler              |
150 - org.apache.camel.camel-cxf - 2.8.5 | parsing the cxfEndpoint element
12:22:03,944 | DEBUG | rint Extender: 3 | OsgiCamelContextHelper           |
152 - org.apache.camel.camel-blueprint - 2.8.5 | Setting up OSGi
ServiceRegistry
12:22:03,944 | DEBUG | rint Extender: 3 | BlueprintComponentResolver       |
152 - org.apache.camel.camel-blueprint - 2.8.5 | Ignored error looking up
bean: properties. Error: org.apache.camel.RuntimeCamelException:
org.osgi.service.blueprint.container.NoSuchComponentException: No component
with id 'properties' could be found
12:22:03,944 | DEBUG | rint Extender: 3 | BlueprintComponentResolver       |
152 - org.apache.camel.camel-blueprint - 2.8.5 | Ignored error looking up
bean: properties. Error: org.apache.camel.RuntimeCamelException:
org.osgi.service.blueprint.container.NoSuchComponentException: No component
with id '.camelBlueprint.componentResolver.properties' could be found
12:22:03,944 | DEBUG | rint Extender: 3 | Activator                        |
91 - org.apache.camel.camel-core - 2.8.5 | The entry properties's url is
bundle://91.0:0/META-INF/services/org/apache/camel/component/properties
12:22:03,945 | DEBUG | rint Extender: 3 | AbstractCamelContextFactoryBean  |
152 - org.apache.camel.camel-blueprint - 2.8.5 | Found JAXB created routes:
[Route[[From[cxf:bean:pruebaBridgeLegacyConsumerEndpoint]] ->
[To[http://localhost/vessel_visitors.xml]]]]
12:22:03,945 | DEBUG | rint Extender: 3 | CamelContextFactoryBean          |
152 - org.apache.camel.camel-blueprint - 2.8.5 | Set the application context
classloader to: BundleDelegatingClassLoader(PruebaBridgeLegacy [205])
12:22:03,945 | INFO  | rint Extender: 3 | BlueprintCamelContext            |
91 - org.apache.camel.camel-core - 2.8.5 | JMX enabled. Using
ManagedManagementStrategy.
12:22:03,946 | DEBUG | rint Extender: 3 | DefaultManagementAgent           |
91 - org.apache.camel.camel-core - 2.8.5 | Starting JMX agent on server:
com.sun.jmx.mbeanserver.JmxMBeanServer@2808b3
12:22:03,946 | DEBUG | rint Extender: 3 | CamelContextFactoryBean          |
152 - org.apache.camel.camel-blueprint - 2.8.5 | EventAdmin package is not
available, just don't use it

The dependencies of my project are camel 2.8.5

		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-spring</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-blueprint</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-jms</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-http</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.activemq</groupId>
			<artifactId>activemq-core</artifactId>
		</dependency>
		<dependency>
			<groupId>org.apache.camel</groupId>
			<artifactId>camel-jetty</artifactId>
		</dependency>


There is a example to create a Route cxf -> http ? (BTW, i couldn't create a
HTTP -> HTTP route)

Thank you!



--
View this message in context: http://camel.465427.n5.nabble.com/Create-a-Simple-CXF-Http-Route-tp5731090.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Create a Simple CXF - Http Route

Posted by Chubutin <ra...@gmail.com>.
I resolved putting direct in the *to* route.

So, my route is now 

<camel:camelContext id="pruebaBridgeLegacyRoute"
		trace="true">
		<camel:route id="rutaLegacy">
			<camel:from uri="cxf:bean:pruebaBridgeLegacyConsumerEndpoint" />
			<camel:to uri="direct:http://localhost/vessel_visitors.xml" />
		</camel:route>

</camel:camelContext>

Thank you!



--
View this message in context: http://camel.465427.n5.nabble.com/Create-a-Simple-CXF-Http-Route-tp5731090p5731100.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Create a Simple CXF - Http Route

Posted by Chubutin <ra...@gmail.com>.
I resolved the route problem. This is my CamelContext 

<camelcxf:cxfEndpoint id="pruebaBridgeLegacyConsumerEndpoint"
		serviceClass="com.tecplata.esb.service.VesselVisitorService"
address="/vesselVisitorService"
		endpointName="ns:vesselVisitorServicePort"
serviceName="ns:vesselVisitorService"
		xmlns:ns="http://service.esb.tecplata.com/" />



	<camel:camelContext id="pruebaBridgeLegacyRoute"
		trace="true">
		<camel:endpoint id="legacyEndpoint"
			uri="http://localhost:80/vessel_visitors.xml" />
		<camel:route id="rutaLegacy">
			<camel:from uri="cxf:bean:pruebaBridgeLegacyConsumerEndpoint" />
			<camel:to uri="ref:legacyEndpoint" />
			<camel:to uri="xslt:xslt/transformationXSLT.xslt" />
		</camel:route>

	</camel:camelContext>


The route is exported and publicated. 

This configuration doesnt transmit correctly the message, but that is not
the old problem.

Thank to all!

Bye!



--
View this message in context: http://camel.465427.n5.nabble.com/Create-a-Simple-CXF-Http-Route-tp5731090p5731103.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Create a Simple CXF - Http Route

Posted by Chubutin <ra...@gmail.com>.
I have my Bridge CXF - HTTP working. This is my configuration for all who has
the same problems


<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	xmlns:cxf="http://cxf.apache.org/blueprint/core"
xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
	xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf"
	xmlns:camel="http://camel.apache.org/schema/blueprint"
	xsi:schemaLocation="
  http://www.osgi.org/xmlns/blueprint/v1.0.0
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://www.osgi.org/xmlns/blueprint-ext/v1.1.0
https://svn.apache.org/repos/asf/aries/tags/blueprint-0.3.1/blueprint-core/src/main/resources/org/apache/aries/blueprint/ext/blueprint-ext.xsd  
  http://cxf.apache.org/blueprint/jaxws
http://cxf.apache.org/schemas/blueprint/jaxws.xsd
  http://cxf.apache.org/blueprint/jaxrs
http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
  http://cxf.apache.org/blueprint/core
http://cxf.apache.org/schemas/blueprint/core.xsd
  http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
  http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0
http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd">


	<camelcxf:cxfEndpoint id="pruebaBridgeLegacyConsumerEndpoint"
		serviceClass="com.esb.service.VesselVisitorService"
address="/vesselVisitorService"
		endpointName="ns:vesselVisitorServicePort"
serviceName="ns:vesselVisitorService"
		xmlns:ns="http://service.esb.com/" />

	<camel:camelContext id="pruebaBridgeLegacyRoute"
		trace="true">
                 
		<camel:endpoint id="legacyEndpoint"
			uri="http://localhost:80/vessel_visitors.xml" />
		<camel:route id="rutaLegacy">
			<camel:from
uri="cxf:bean:pruebaBridgeLegacyConsumerEndpoint?dataFormat=PAYLOAD" />
			<camel:to uri="ref:legacyEndpoint" />
			<camel:to uri="xslt:xslt/transformationXSLT.xslt" />
		</camel:route>

	</camel:camelContext>

</blueprint>



--
View this message in context: http://camel.465427.n5.nabble.com/Create-a-Simple-CXF-Http-Route-tp5731090p5731158.html
Sent from the Camel - Users mailing list archive at Nabble.com.