How can I deploy Camel application on JbossFuse server? - java

I`m trying to deploy camel application to jbossfuse server. It deployed but camel does not works.
I have simple apache camel application which creating "inbox" folder and after u add some file into this folder it will be copied in "outbox". When Im running application with mavens camel plugin it works fine "mvn camel:run".
But if I deploy bundle through redhatfuse directly it does not works.
my steps to deploy:
run fuse.bat;
install mvn:${path to local maven repository}
BundleID: 233
start 233
I can see my bundle started in "list" command but camel does not works.
What can be the problem?
My applicationContext.xml which is under resources/META-INF/spring
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:cxf="http://camel.apache.org/schema/cxf"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi.xsd http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf-2.8.3.xsd">
<camelContext id="camelId" xmlns="http://camel.apache.org/schema/spring">
<camel:route>
<camel:from uri="file:C:/inbox" />
<camel:to uri="file:C:/outbox" />
</camel:route>
</camelContext>
</beans>

Related

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/ip

Hi Can you please help me about it? I am using Spring 4.3.8 in Spring STS IDE. I get this exception: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/integration/ip]
Offending resource: class path resource [spring-config.xml]
Maven config:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
My Spring config is:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:int="http://www.springframework.org/schema/integration"
xmlns:int-ip="http://www.springframework.org/schema/integration/ip"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd
http://www.springframework.org/schema/integration/ip http://www.springframework.org/schema/integration/ip/spring-integration-ip.xsd">
<context:property-placeholder location="classpath:udp-server.properties" />
<bean id="udpConsumer" class="com.example.udp.UDPConsumer" />
<int:channel id="inputChannel">
<int:queue />
</int:channel>
<int-ip:udp-inbound-channel-adapter id="udpReceiver"
channel="inputChannel"
port="${udp-server.port}"
pool-size="${udp-server.threads}"
receive-buffer-size="${udp-server.buffer-size}"
multicast="false"
check-length="true"/>
<int:service-activator input-channel="inputChannel"
ref="udpConsumer" />
<int:poller default="true" fixed-rate="500" />
The integration starter only brings in the spring-integration-core jar, to avoid classpath bloat for jars you don't need; you need to add
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-ip</artifactId>
</dependency>
Boot/Maven will bring in the right version to match the core.

Tomcat hangs on shutdown

We started to use spring-data-solr within our project for some admin use-cases that we need to implement.
Setup
Our setup for spring-data-solr is very simple:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:solr="http://www.springframework.org/schema/data/solr"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/data/solr http://www.springframework.org/schema/data/solr/spring-solr.xsd">
<solr:repositories base-package="com.any.package" solr-template-ref="solrTemplate"/>
<solr:solr-server id="solrServer" url="http://${solr.host}:${solr.port}${solr.contextPath}" />
<bean id="solrTemplate" class="org.springframework.data.solr.core.SolrTemplate">
<constructor-arg ref="solrServer" />
<constructor-arg value="${solr.storeCore.name}" />
</bean>
Currently we are using one Repository which extends the SolrCrudRepository and which is autowired to a Controller.
Problem
When shutdown Tomcat, it hangs for 10 minutes on Destroying the ProtocolHandler.
A Threaddump does not provide much more information, except that a searcherExecutor-Thread is parked.
Any Ideas?
Versions
Solr: 4.7.2
Spring-Data-Solr: 1.5.4.RELEASE
Spring: 4.2.5.RELEASE
Tomcat 7.0.53
Java 1.8.0u65
Win 7 and CentOS 6.6
As mentioned in the comment: Everything fine with spring-data-solr... as expected ;-) There was a solr component, which did not close the core after usage.

Camel Http proxy to Web services

I've been reading a bit about Camel and going through some of the examples in the download directory.
I would like to know if I can configure the route to accept an incoming Http request with a parameter name=fred using jetty: or servlet:
I then need to convert this to a real secured SOAP request (HTTPS) and get back the SOAP response.
Do I have to write Java code to send the SOAP request? The examples I've seen so far is using SOAP as input, modify some values and send it on as SOAP...
Anyone please provide some guidance with minimal code?
Thanks & regards
Tin
Here is what I've done and it works..
velocity_template.vm contains the entire SOAP request with dynamic fields substituted at runtime eg. ${in.headers.name}
<?xml version="1.0" encoding="UTF-8"?>
<!-- START SNIPPET: e1 -->
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xmlns:cxf="http://camel.apache.org/schema/cxf"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
http://camel.apache.org/schema/cxf http://camel.apache.org/schema/cxf/camel-cxf.xsd">
<cxf:cxfEndpoint id="real_webservice"
address="url_to_wsdl?wsdl"
endpointName="s:Real_impl_class"
xmlns:s="real_namespace"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route id="helloRoute">
<from uri="servlet:///hello"/>
<to uri="velocity:etc/velocity_template.vm"/>
<to uri="cxf:bean:real_webservice?dataFormat=MESSAGE"/>
</route>
</camelContext>
</beans>
<!-- END SNIPPET: e1 -->

Embedding Restlets in Mule can't work in Mule 3.1.2

I configure a flow in mule-config.xml based on the documentation(click here). Here is the content in mule-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:tcp="http://www.mulesoft.org/schema/mule/tcp"
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:restlet="http://www.mulesource.org/schema/mule/restlet"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.1/mule.xsd
http://www.mulesoft.org/schema/mule/tcp http://www.mulesoft.org/schema/mule/tcp/3.1/mule-tcp.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.1/mule-vm.xsd
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.1/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.1/mule-http.xsd
http://www.mulesoft.org/schema/mule/restlet http://www.mulesoft.org/schema/mule/restlet/3.1/mule-restlet.xsd">
<description>
This configuration uses an HTTP endpoint to receive requests.
</description>
<flow name="fuxk">
<inbound-endpoint address="http://localhost:9002">
</inbound-endpoint>
<restlet:component restlet-ref="helloWorld"/>
</flow>
<spring:bean id="helloWorld" class="com.ggd543.mulerestletdemo.HelloWorldApplication"/>
</mule>
This configuration uses an HTTP endpoint to receive requests.But when I start up the mule instance , I got the following error:
It seams that the documentation is based on mule 2.x . How do I change the configuration in mule-config.xml for Mule 3.1.2 ?
Replace mulesource.org with mulesoft.org in all your Restlet namespace definitions.

Spring and JMS Integration Configuration file error

I keep having this error when I'm trying to integrate Spring JMS into my current project. It's driving me up the wall and I'm not entirely sure how to fix it as I'm new to Spring.
The prefix "jms" for element "jms:listener-container" is not bound.
The code in question is this,
<jms:listener-container container-type="default" connection-factory="connectionFactory" acknowledge="auto">
<jms:listener destination="TESTQUEUE" ref="simpleMessageListener" method="onMessage" />
</jms:listener-container>
I'm pretty sure it has to do with the jms: namespace but I don't know how to fix it as before my program was complaining about the p: namespace so I had to change it to property name="some value" reference="someReference"
Make sure you have the jms namespace in your context file:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jms="http://www.springframework.org/schema/jms"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-3.0.xsd">
<!-- <bean/> definitions here -->
</beans>
See http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jms.html for details.

Categories

Resources