Re: Warning Messages in Logs when camel application running on multiple nodes

2015-05-13 Thread Henryk Konsek
Hi,

You should see in the logs what is the reason for the rename failure. Maybe
problems with IO?

Cheers.

śr., 13.05.2015 o 08:21 użytkownik ravi.4indra ravi.4in...@gmail.com
napisał:

 Hi,

 I have a route using camel file2 to move a file. its working fine with a
 single node but with camel running on three different nodes i am seeing
 below error on 2 nodes and successfully processing in the third server.

 is there a configuration or option on camel to prevent this
 warnings/exception in logs


 org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
 rename file: Generi
 cFile[filename] to: GenericF
 ile[filename]
 at

 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFil
 e(GenericFileProcessStrategySupport.java:115)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.begin(Gene
 ricFileDeleteProcessStrategy.java:42)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsu
 mer.java:348)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer
 .java:211)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:17
 5)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[ca
 mel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[came
 l-core-2.14.0.jar:2.14.0]
 at

 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
 at
 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_45]
 at

 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Sche
 duledThreadPoolExecutor.java:178)[:1.7.0_45]
 at

 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledTh
 readPoolExecutor.java:293)[:1.7.0_45]
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7
 .0_45]
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7
 .0_45]
 at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]



 from(file://RemoteMountedDirectory?doneFileName=${file:name}.donedelay=10maxMessagesPerPoll=200delete=true)
  .to(file://toLocalDirectory+?doneFileName=${file:name}.done);

 Thanks
 Ravi



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Warning-Messages-in-Logs-when-camel-application-running-on-multiple-nodes-tp5767030.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: how to get the soap body from exchange.

2015-05-13 Thread Henryk Konsek
Hi,

Try the following approach:

   SOAPMessage soapMessage = exchange.getIn(SOAPMessage.class);

The message contains the body. The message is not a body :) .

Cheers.

śr., 13.05.2015 o 09:59 użytkownik jainmcs03 tojayendran.in...@gmail.com
napisał:

 Team,

 I tried additional ways below, but getting SOAPMessage as null.

 //  SOAPMessage soapMessage =
 exchange.getIn().getBody(SOAPMessage.class);
 //  SOAPMessage soapMessage =
 exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
 SOAPMessage.class);
 //  SOAPMessage soapMessage = (SOAPMessage)
 exchange.getIn().getBody(List.class).get(0);
 //  System.out.println(Inside RealResFormatProcessor
 :soapMessage :
 +soapMessage);


 Regards
 Jayendran



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050p5767052.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: Warning Messages in Logs when camel application running on multiple nodes

2015-05-13 Thread Reji Mathews
Can you check your file access permissions on the RemoteMountedDirectory.
Apart form read, do you have 'write' rights as well??

Reji

On Wed, May 13, 2015 at 2:17 PM, Henryk Konsek hekon...@gmail.com wrote:

 Hi,

 You should see in the logs what is the reason for the rename failure. Maybe
 problems with IO?

 Cheers.

 śr., 13.05.2015 o 08:21 użytkownik ravi.4indra ravi.4in...@gmail.com
 napisał:

  Hi,
 
  I have a route using camel file2 to move a file. its working fine with a
  single node but with camel running on three different nodes i am seeing
  below error on 2 nodes and successfully processing in the third server.
 
  is there a configuration or option on camel to prevent this
  warnings/exception in logs
 
 
  org.apache.camel.component.file.GenericFileOperationFailedException:
 Cannot
  rename file: Generi
  cFile[filename] to: GenericF
  ile[filename]
  at
 
 
 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFil
 
 e(GenericFileProcessStrategySupport.java:115)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.begin(Gene
  ricFileDeleteProcessStrategy.java:42)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsu
  mer.java:348)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer
  .java:211)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:17
  5)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[ca
  mel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[came
  l-core-2.14.0.jar:2.14.0]
  at
 
 
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
  at
 
 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_45]
  at
 
 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Sche
  duledThreadPoolExecutor.java:178)[:1.7.0_45]
  at
 
 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledTh
  readPoolExecutor.java:293)[:1.7.0_45]
  at
 
 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7
  .0_45]
  at
 
 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7
  .0_45]
  at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
 
 
 
 
 from(file://RemoteMountedDirectory?doneFileName=${file:name}.donedelay=10maxMessagesPerPoll=200delete=true)
   .to(file://toLocalDirectory+?doneFileName=${file:name}.done);
 
  Thanks
  Ravi
 
 
 
  --
  View this message in context:
 
 http://camel.465427.n5.nabble.com/Warning-Messages-in-Logs-when-camel-application-running-on-multiple-nodes-tp5767030.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 



Re: Schematron component: Not supported: http://saxon.sf.net/feature/linenumbering

2015-05-13 Thread Ayache Khettar
Hi Daniel

I will try to get a working example deployed into SMX this evening and see
if I can reproduce the error. Could you include the source code of your
working example so I could have a look?

Regards,

Ayache
On 12 May 2015 at 23:49, Davis, Daniel davi...@si.edu wrote:

 An update.  I got rid of camel-saxon and the Saxon bundles.  Then
 created a Java DSL route packaged with Saxon-HE-9.6.0-5.jar.  Same error
 message.

 In smx, it looks like camel-schematron is looking for parsers from the
 OSGI framework like - javax.xml.parsers,version=0.0.0
 from org.apache.felix.framework (0)

 I presume if it find Xalan first this is going to be a problem.  Onward
 and upward.

 --
 Dan

 On 05/12/2015 04:49 PM, Davis, Daniel wrote:
  dependency
   +groupIdnet.sf.saxon/groupId
   +artifactIdSaxon-HE/artifactId
   +version${saxon-version}/version
   +/dependency
  




Re: Warning Messages in Logs when camel application running on multiple nodes

2015-05-13 Thread Claus Ibsen
Hi

No its due having multiple nodes compete for the same files on shared
file system. You need a clustered aware read lock to fully support
this. Camel 2.16 alows to use idempotent read locks in cluster such as
a data grid to orchestrate this.


On Wed, May 13, 2015 at 10:47 AM, Henryk Konsek hekon...@gmail.com wrote:
 Hi,

 You should see in the logs what is the reason for the rename failure. Maybe
 problems with IO?

 Cheers.

 śr., 13.05.2015 o 08:21 użytkownik ravi.4indra ravi.4in...@gmail.com
 napisał:

 Hi,

 I have a route using camel file2 to move a file. its working fine with a
 single node but with camel running on three different nodes i am seeing
 below error on 2 nodes and successfully processing in the third server.

 is there a configuration or option on camel to prevent this
 warnings/exception in logs


 org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
 rename file: Generi
 cFile[filename] to: GenericF
 ile[filename]
 at

 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFil
 e(GenericFileProcessStrategySupport.java:115)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.begin(Gene
 ricFileDeleteProcessStrategy.java:42)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsu
 mer.java:348)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer
 .java:211)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:17
 5)[camel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[ca
 mel-core-2.14.0.jar:2.14.0]
 at

 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[came
 l-core-2.14.0.jar:2.14.0]
 at

 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
 at
 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_45]
 at

 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Sche
 duledThreadPoolExecutor.java:178)[:1.7.0_45]
 at

 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledTh
 readPoolExecutor.java:293)[:1.7.0_45]
 at

 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7
 .0_45]
 at

 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7
 .0_45]
 at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]



 from(file://RemoteMountedDirectory?doneFileName=${file:name}.donedelay=10maxMessagesPerPoll=200delete=true)
  .to(file://toLocalDirectory+?doneFileName=${file:name}.done);

 Thanks
 Ravi



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Warning-Messages-in-Logs-when-camel-application-running-on-multiple-nodes-tp5767030.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Claus Ibsen
-
Red Hat, Inc.
Email: cib...@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/


Re: Warning Messages in Logs when camel application running on multiple nodes

2015-05-13 Thread Reji Mathews
Also 'doneFileName' option . Is it applicable for producer endpoints?
Am not sure though but I feel its only for consumer endpoints.

Docs at http://camel.apache.org/file2.html

Regards
Reji

On Wed, May 13, 2015 at 2:17 PM, Henryk Konsek hekon...@gmail.com wrote:

 Hi,

 You should see in the logs what is the reason for the rename failure. Maybe
 problems with IO?

 Cheers.

 śr., 13.05.2015 o 08:21 użytkownik ravi.4indra ravi.4in...@gmail.com
 napisał:

  Hi,
 
  I have a route using camel file2 to move a file. its working fine with a
  single node but with camel running on three different nodes i am seeing
  below error on 2 nodes and successfully processing in the third server.
 
  is there a configuration or option on camel to prevent this
  warnings/exception in logs
 
 
  org.apache.camel.component.file.GenericFileOperationFailedException:
 Cannot
  rename file: Generi
  cFile[filename] to: GenericF
  ile[filename]
  at
 
 
 org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFil
 
 e(GenericFileProcessStrategySupport.java:115)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.begin(Gene
  ricFileDeleteProcessStrategy.java:42)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsu
  mer.java:348)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer
  .java:211)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:17
  5)[camel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[ca
  mel-core-2.14.0.jar:2.14.0]
  at
 
 
 org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[came
  l-core-2.14.0.jar:2.14.0]
  at
 
 
 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
  at
 
 java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_45]
  at
 
 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Sche
  duledThreadPoolExecutor.java:178)[:1.7.0_45]
  at
 
 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledTh
  readPoolExecutor.java:293)[:1.7.0_45]
  at
 
 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7
  .0_45]
  at
 
 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7
  .0_45]
  at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
 
 
 
 
 from(file://RemoteMountedDirectory?doneFileName=${file:name}.donedelay=10maxMessagesPerPoll=200delete=true)
   .to(file://toLocalDirectory+?doneFileName=${file:name}.done);
 
  Thanks
  Ravi
 
 
 
  --
  View this message in context:
 
 http://camel.465427.n5.nabble.com/Warning-Messages-in-Logs-when-camel-application-running-on-multiple-nodes-tp5767030.html
  Sent from the Camel - Users mailing list archive at Nabble.com.
 



Spring versions in camel features file for Karaf

2015-05-13 Thread Svend-Ole Nielsen
Hi

I have installed a plain vanilla Karaf version 2.4 with Camel 2.15. According 
to the release notes Camel 2.15 supports Spring version 4+ which also appears 
to be the version that Karaf is using. According to the feature for example 
camel-spring the version 4 is excluded. See the snippet below.

feature name=camel-spring version=2.15.2 resolver=(obr) start-level=50
   bundle 
dependency=truemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle
   feature version=[3.2,4)spring/feature
   feature version=[1.2,2)spring-dm/feature
   feature version=[3.2,4)spring-tx/feature
   feature version=2.15.2camel-core/feature
   bundlemvn:org.apache.camel/camel-spring/2.15.2/bundle
/feature

According to the pom of camel-spring it is dependent on version 4+ of Spring, 
so I'm a bit confused. So my question is if I am missing something, a bug or 
something different  ??

Anyway - the Karaf is installing 2 versions of Spring and is unable to deploy a 
xml-spring file due to namespace mismatch.

Any help would be greatly appreciated

/Svend



Re: Schematron component: Not supported: http://saxon.sf.net/feature/linenumbering

2015-05-13 Thread Davis, Daniel
I tried with this Java DSL route.  My code is showing a dependency on
Saxon in ServiceMIx but I gather the camel-schematron component is doing
its own binding to Xalan.  So it results in the same exception when
trying to start the route.

http://pastie.org/10187203  (Java and POM)

--
Dan Davis

On 05/13/2015 11:28 AM, Davis, Daniel wrote:
 I have included the XML DSL version.  I am working up a better Java DSL
 version.  I can provoke the issue in a default ServiceMix 5.4.0 install
 with only the camel-schematron feature added.  I have tried it with the
 Apache Saxon-He bundle installed too.  In the ServiceMix log, the route
 fails to start with an exception that points to ServiceMix finding Xalan
 and never finding Saxon (snippet below).  The Schematron rules run
 correctly in Oxygen.  My running theory is that the camel-schematron
 component version needs Saxon for the linenumbering feature but does not
 have it set as a required import, but I am still learning about the
 camel-schematron component.  I am trying to get it working in the Java
 DSL by resolving the Saxon dependencies in that code but that is not
 done yet.

 Thank you for looking at this.

 --
 Dan Davis

 http://pastie.org/10186857   (Contains test XML DSL route, Schematron
 rules, and test xml file)

 Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
 resolve endpoint:
 schematron:///opt/sidora/servicemix/Input/schemas/DeploymentManifest2014.sch
 due to: Not supported: http://saxon.sf.net/feature/linenumbering
 at
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:547)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:72)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:202)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:942)[116:org.apache.camel.camel-core:2.14.1]
 ... 38 more
 Caused by: java.lang.IllegalArgumentException: Not supported:
 http://saxon.sf.net/feature/linenumbering
 at
 org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:571)[:]
 at
 org.apache.camel.component.schematron.processor.TemplatesFactory.newTemplates(TemplatesFactory.java:68)[260:org.apache.camel.camel-schematron:2.14.1]
 at
 org.apache.camel.component.schematron.SchematronEndpoint.doStart(SchematronEndpoint.java:103)[260:org.apache.camel.camel-schematron:2.14.1]
 at
 org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2148)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1032)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:993)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:989)[116:org.apache.camel.camel-core:2.14.1]
 at
 org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:543)[116:org.apache.camel.camel-core:2.14.1]
 ... 47 more

 --
 Dan Davis

 On 05/13/2015 07:21 AM, Ayache Khettar wrote:
 Hi Daniel

 I will try to get a working example deployed into SMX this evening and see
 if I can reproduce the error. Could you include the source code of your
 working example so I could have a look?

 Regards,

 Ayache
 On 12 May 2015 at 23:49, Davis, Daniel davi...@si.edu wrote:

 An update.  I got rid of camel-saxon and the Saxon bundles.  Then
 created a Java DSL route packaged with Saxon-HE-9.6.0-5.jar.  Same error
 message.

 In smx, it looks like camel-schematron is looking for parsers from the
 OSGI framework like - javax.xml.parsers,version=0.0.0
 from org.apache.felix.framework (0)

 I presume if it find Xalan first this is going to be a 

InOut MEP

2015-05-13 Thread akoufoudakis
Dear all!

I am sure that this questions has been already asked. Apologies that you
have to look at it again.

I have a very trivial route, which uses InOut MEP:

@Component
public class InOutRouter extends RouteBuilder {

public void configure() {
from(jms:incomingOrders)
.inOut(jms:validate);

from(jms:validate)
.bean(ValidatorBean.class);
}

}

The bean is also very trivial:
public class ValidatorBean {

private static Logger logger = Logger.getLogger(ValidatorBean.class);

public void validateSmth(Exchange exchange) {
logger.info(bean invoked!!!);
String body = exchange.getIn().getBody(String.class);
if(body.contains(SOMETHING)) {
exchange.getOut().setBody(Valid);
} else {
exchange.getOut().setBody(Invalid);
}
}

}

The bean is invoked and I can see the logging output.
I can also see that the route works. The number of enqueued/dequeued
messages grows in both incomingOrders and validate queues.

However, I cannot see any kind of output after the bean execution is over.

Please, help me to find out what I am doing wrong or recommend what should I
do to process the reply (i.e., how and where can process the Valid/Invalid
bodies).

Thank you in advance.



--
View this message in context: 
http://camel.465427.n5.nabble.com/InOut-MEP-tp5767079.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: InOut MEP

2015-05-13 Thread Anton Hughes
Please take a look at http://camel.apache.org/content-based-router.html

I think this will help.

On Wed, May 13, 2015 at 9:57 PM, akoufoudakis akoufoudaki...@gmail.com
wrote:

 Dear all!

 I am sure that this questions has been already asked. Apologies that you
 have to look at it again.

 I have a very trivial route, which uses InOut MEP:

 @Component
 public class InOutRouter extends RouteBuilder {

 public void configure() {
 from(jms:incomingOrders)
 .inOut(jms:validate);

 from(jms:validate)
 .bean(ValidatorBean.class);
 }

 }

 The bean is also very trivial:
 public class ValidatorBean {

 private static Logger logger =
 Logger.getLogger(ValidatorBean.class);

 public void validateSmth(Exchange exchange) {
 logger.info(bean invoked!!!);
 String body = exchange.getIn().getBody(String.class);
 if(body.contains(SOMETHING)) {
 exchange.getOut().setBody(Valid);
 } else {
 exchange.getOut().setBody(Invalid);
 }
 }

 }

 The bean is invoked and I can see the logging output.
 I can also see that the route works. The number of enqueued/dequeued
 messages grows in both incomingOrders and validate queues.

 However, I cannot see any kind of output after the bean execution is over.

 Please, help me to find out what I am doing wrong or recommend what should
 I
 do to process the reply (i.e., how and where can process the
 Valid/Invalid
 bodies).

 Thank you in advance.



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/InOut-MEP-tp5767079.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



javax.management.InstanceNotFoundException

2015-05-13 Thread dphan
Hi,

I'm checking out the JMX feature of Camel to monitor routes.  And I got this
exception:

JBossFuse:karaf@root Exception in thread SpringOsgiExtenderThread-4
org.apache.camel.RuntimeCamelException:
javax.management.InstanceNotFoundException:
org.apache.camel:name=monitorRoute,context=localhost/monitorCamelContext,type=routes
at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1363)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:303)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at
org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at
org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:132)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.management.InstanceNotFoundException:
org.apache.camel:name=monitorRoute,context=localhost/monitorCamelContext,type=routes
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1095)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getAttribute(DefaultMBeanServerInterceptor.java:643)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.getAttribute(JmxMBeanServer.java:678)
at
org.apache.camel.component.jmx.JMXMonitorConsumer.convertNumberToAttributeType(JMXMonitorConsumer.java:109)
at
org.apache.camel.component.jmx.JMXMonitorConsumer.addNotificationListener(JMXMonitorConsumer.java:59)
at 
org.apache.camel.component.jmx.JMXConsumer.doStart(JMXConsumer.java:109)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1929)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:2223)
at
org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:2159)
at
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2089)
at
org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1868)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1740)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1579)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1547)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:221)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
... 10 more

Here is a simple Camel context I got from the Apache Camel Developer's
Cookbook:

?xml version=1.0 encoding=UTF-8?



beans xmlns=http://www.springframework.org/schema/beans;
   xmlns:camel=http://camel.apache.org/schema/spring;
   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
   xsi:schemaLocation=
 http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
 http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
   

  camelContext id=monitorCamelContext
xmlns=http://camel.apache.org/schema/spring;
jmxAgent id=agent
connectorPort=11223
createConnector=false
usePlatformMBeanServer=true
serviceUrlPath=/jmxrmi/camel
loadStatisticsEnabled=true
statisticsLevel=All/

route id=monitorRoute
  
  from uri=timer:foo?period=2 /
  transform
simpleMonitoring ${body}/simple
  /transform
  log message=${body}/
  to uri=mock:result/
/route
 
route id=jmxMonitor
  from

Re: Schematron component: Not supported: http://saxon.sf.net/feature/linenumbering

2015-05-13 Thread Davis, Daniel
I have included the XML DSL version.  I am working up a better Java DSL
version.  I can provoke the issue in a default ServiceMix 5.4.0 install
with only the camel-schematron feature added.  I have tried it with the
Apache Saxon-He bundle installed too.  In the ServiceMix log, the route
fails to start with an exception that points to ServiceMix finding Xalan
and never finding Saxon (snippet below).  The Schematron rules run
correctly in Oxygen.  My running theory is that the camel-schematron
component version needs Saxon for the linenumbering feature but does not
have it set as a required import, but I am still learning about the
camel-schematron component.  I am trying to get it working in the Java
DSL by resolving the Saxon dependencies in that code but that is not
done yet.

Thank you for looking at this.

--
Dan Davis

http://pastie.org/10186857   (Contains test XML DSL route, Schematron
rules, and test xml file)

Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint:
schematron:///opt/sidora/servicemix/Input/schemas/DeploymentManifest2014.sch
due to: Not supported: http://saxon.sf.net/feature/linenumbering
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:547)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:72)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:202)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:107)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:113)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.model.SendDefinition.resolveEndpoint(SendDefinition.java:61)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.model.SendDefinition.createProcessor(SendDefinition.java:55)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:942)[116:org.apache.camel.camel-core:2.14.1]
... 38 more
Caused by: java.lang.IllegalArgumentException: Not supported:
http://saxon.sf.net/feature/linenumbering
at
org.apache.xalan.processor.TransformerFactoryImpl.setAttribute(TransformerFactoryImpl.java:571)[:]
at
org.apache.camel.component.schematron.processor.TemplatesFactory.newTemplates(TemplatesFactory.java:68)[260:org.apache.camel.camel-schematron:2.14.1]
at
org.apache.camel.component.schematron.SchematronEndpoint.doStart(SchematronEndpoint.java:103)[260:org.apache.camel.camel-schematron:2.14.1]
at
org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2148)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:1032)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:993)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:989)[116:org.apache.camel.camel-core:2.14.1]
at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:543)[116:org.apache.camel.camel-core:2.14.1]
... 47 more

--
Dan Davis

On 05/13/2015 07:21 AM, Ayache Khettar wrote:
 Hi Daniel

 I will try to get a working example deployed into SMX this evening and see
 if I can reproduce the error. Could you include the source code of your
 working example so I could have a look?

 Regards,

 Ayache
 On 12 May 2015 at 23:49, Davis, Daniel davi...@si.edu wrote:

 An update.  I got rid of camel-saxon and the Saxon bundles.  Then
 created a Java DSL route packaged with Saxon-HE-9.6.0-5.jar.  Same error
 message.

 In smx, it looks like camel-schematron is looking for parsers from the
 OSGI framework like - javax.xml.parsers,version=0.0.0
 from org.apache.felix.framework (0)

 I presume if it find Xalan first this is going to be a problem.  Onward
 and upward.

 --
 Dan

 On 05/12/2015 04:49 PM, Davis, Daniel wrote:
 dependency
 +groupIdnet.sf.saxon/groupId
 +artifactIdSaxon-HE/artifactId
 +version${saxon-version}/version
 +/dependency





Warning Messages in Logs when camel application running on multiple nodes

2015-05-13 Thread ravi.4indra
Hi,

I have a route using camel file2 to move a file. its working fine with a
single node but with camel running on three different nodes i am seeing
below error on 2 nodes and successfully processing in the third server.

is there a configuration or option on camel to prevent this
warnings/exception in logs


org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file: Generi 
   
cFile[filename] to: GenericF


ile[filename]
at
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFil


e(GenericFileProcessStrategySupport.java:115)[camel-core-2.14.0.jar:2.14.0]
at
org.apache.camel.component.file.strategy.GenericFileDeleteProcessStrategy.begin(Gene


ricFileDeleteProcessStrategy.java:42)[camel-core-2.14.0.jar:2.14.0]
at
org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsu


mer.java:348)[camel-core-2.14.0.jar:2.14.0]
at
org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer


.java:211)[camel-core-2.14.0.jar:2.14.0]
at
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:17


5)[camel-core-2.14.0.jar:2.14.0]
at
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187)[ca


mel-core-2.14.0.jar:2.14.0]
at
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114)[came


l-core-2.14.0.jar:2.14.0]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_45]
at
java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)[:1.7.0_45]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Sche


duledThreadPoolExecutor.java:178)[:1.7.0_45]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledTh


readPoolExecutor.java:293)[:1.7.0_45]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7


.0_45]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7


.0_45]
at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]


from(file://RemoteMountedDirectory?doneFileName=${file:name}.donedelay=10maxMessagesPerPoll=200delete=true)
 .to(file://toLocalDirectory+?doneFileName=${file:name}.done);

Thanks
Ravi



--
View this message in context: 
http://camel.465427.n5.nabble.com/Warning-Messages-in-Logs-when-camel-application-running-on-multiple-nodes-tp5767030.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Handle Soap1.1 and Soap1.2 payloads in a single CXF WS Endpoint

2015-05-13 Thread Gnanaguru S
The same question is posted here as well:

http://stackoverflow.com/questions/30204063/handle-multiple-soap-versions-in-camel
http://stackoverflow.com/questions/30204063/handle-multiple-soap-versions-in-camel
  



--
View this message in context: 
http://camel.465427.n5.nabble.com/Handle-Soap1-1-and-Soap1-2-payloads-in-a-single-CXF-WS-Endpoint-tp5766947p5767034.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Data Corruption in SFTP in Parallel Multicast branches

2015-05-13 Thread Franz Paul Forsthofer
Hello Lakshmi,

it could be that this issue is related to
https://issues.apache.org/jira/browse/CAMEL-8688

There we have made a patch in the current snapshot (version 2.16)

Can you try to reproduce your problem on the current snapshot?

Regards Franz

On Tue, May 12, 2015 at 11:39 AM, lakshmi.prashant
lakshmi.prash...@gmail.com wrote:
 Hi,

  If direct is changed to SEDA, the multiple branches still fail.

 /Error processing exchange. Exchange[Message: [Body is instance of
 org.apache.camel.StreamCache]]. Caused by: [org.quartz.JobExecutionException
 - org.apache.camel.CamelExchangeException: Parallel processing failed for
 number 0. Exchange[Message: [Body is instance of
 org.apache.camel.StreamCache]].

  Caused by: [org.apache.camel.builder.xml.InvalidXPathExpression - Invalid
 xpath: /queryCompoundEmployeeResponse/CompoundEmployee.
 Reason: javax.xml.xpath.XPathExpressionException: Failure converting a node
 of class javax.xml.transform.sax.SAXSource: I/O error reported by XML parser
 processing null: Invalid byte 2 of 4-byte UTF-8 sequence.]]|/


  If I convert the streamcache to String / byte[] after the stream cache
 producer  before the multicast, the issue does not arise.


 camel:to  uri=myProducer/ *
 camel:convertBodyTo type=java.lang.String charset=UTF-8 /  *
 camel:multicast id=ParallelGateway_1 parallelProcessing=true
 stopOnException=true
 camel:to uri=direct://SequenceFlow_5/
 camel:to uri=direct://SequenceFlow_7/
 /camel:multicast
 /camel:route

 Thanks,
 Lakshmi



 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/Data-Corruption-in-SFTP-in-Parallel-Multicast-branches-tp5761673p5767007.html
 Sent from the Camel - Users mailing list archive at Nabble.com.


Re: xmljson - utf-8 fails

2015-05-13 Thread Gnanaguru S
Hello Reji, 

Interesting, did it try hitting the service with your standalone client with
the payload coming out of your processor ?

Cheers
Guru
@tallguru



--
View this message in context: 
http://camel.465427.n5.nabble.com/xmljson-utf-8-fails-tp5767014p5767033.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: xmljson - utf-8 fails

2015-05-13 Thread contactreji
Hey Guru

The very next step I did was trying a http POST using the linux CURL
command. 

Surprisingly it worked :-) . The very same data which came out of the
processor was posted successfully into end system via curl utility.

The problem is seen only from the camel flow.


Cheers
Reji



-
Reji Mathews
Sr. Developer - Middleware Integration / SOA ( Open Source - Apache Camel  
Jboss Fuse ESB | Mule ESB )
LinkedIn - http://in.linkedin.com/pub/reji-mathews/31/9a2/40a
Twitter - reji_mathews
--
View this message in context: 
http://camel.465427.n5.nabble.com/xmljson-utf-8-fails-tp5767014p5767035.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Handle white space - JSON to XML using XMLJSON component

2015-05-13 Thread Gnanaguru S
Hi Guys,

I recently got impressed with xmljson component, it does pretty good job in
transforming JSON to XML and vice versa. 

I have a JSON payload which has keys with white space, xmljson doesnt accept
JSON keys with whitespaces and it throws the exception shown below. 

This is my JSON payload:

{
  Format: JSON,
  TestData: {
   * Key with Spaces in it*: {
  And Again: {
ChildKey1: Financial,
ChildKey2: null
  },
.
.

Is there a camel way to handle this ? Or I have to write a processor to
remove white spaces only on the keys ?

nu.xom.IllegalNameException: 0x20 is not a legal NCName character
at nu.xom.Verifier.throwIllegalNameException(Unknown Source)
at nu.xom.Verifier.checkNCName(Unknown Source)
at nu.xom.Element._setLocalName(Unknown Source)
at nu.xom.Element.init(Unknown Source)
at nu.xom.Element.init(Unknown Source)
at net.sf.json.xml.XMLSerializer.newElement(XMLSerializer.java:869)
at 
net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:989)
at 
net.sf.json.xml.XMLSerializer.processJSONValue(XMLSerializer.java:1040)
at 
net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:990)
at net.sf.json.xml.XMLSerializer.write(XMLSerializer.java:605)
at net.sf.json.xml.XMLSerializer.write(XMLSerializer.java:570)
at
org.apache.camel.dataformat.xmljson.XmlJsonDataFormat.convertToXMLUsingEncoding(XmlJsonDataFormat.java:191)
at
org.apache.camel.dataformat.xmljson.XmlJsonDataFormat.unmarshal(XmlJsonDataFormat.java:186)
at
org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:65)
at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
at org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:378)
at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:346)
at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:242)
at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:346)
at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:201)
at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:128)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:132)
at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:149)
at
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:297)
at 

Regards
Guru



--
View this message in context: 
http://camel.465427.n5.nabble.com/Handle-white-space-JSON-to-XML-using-XMLJSON-component-tp5767042.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: QueueReplyManager - reply received for unknown correlationID

2015-05-13 Thread Willem Jiang
Can you show us the camel route that you have?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On May 11, 2015 at 4:46:02 PM, MS (matija.slivo...@gmail.com) wrote:
 CXF uses Http transport. Message is afterwords forwarded to ActiveMQ request
 queue.
 After response is read from 'response' queue message is relayed back to WS
 endpoint.
  
  serviceClass=proxy.bridge.amq.AmqBridgePortType
 address=http://localhost:{{port}}/bridge/amq;
 wsdlURL=wsdl/amq-bridge.wsdl
 endpointName=s:amqBridge
 serviceName=s:BridgeService
 xmlns:s=http://proxy/bridge/amq/
  
  
  class=org.apache.activemq.ActiveMQConnectionFactory
  /
  
  
  class=org.apache.camel.component.jms.JmsConfiguration
  
  
  
  
  class=org.apache.activemq.camel.component.ActiveMQComponent
  
  
  
  
  
 --
 View this message in context: 
 http://camel.465427.n5.nabble.com/QueueReplyManager-reply-received-for-unknown-correlationID-tp5766856p5766956.html
   
 Sent from the Camel - Users mailing list archive at Nabble.com.
  



how to get the soap body from exchange.

2015-05-13 Thread jainmcs03

Team,

In Webservice proxy(MESSAGE format) , want to separate the soap body alone.
How to do it?

I tried below but its not worked. advise pls.

//  SOAPMessage soapMessage = (SOAPMessage)
exchange.getIn().getBody(List.class).get(0);
//  System.out.println(Inside RealResFormatProcessor :SOAPMessage :
+soapMessage);
//try {
//SOAPPart sp = soapMessage.getSOAPPart();
//SOAPEnvelope se = sp.getEnvelope();
//SOAPBody sb = se.getBody();
//String responseText = sb.getTextContent();
//System.out.println(Inside RealResFormatProcessor :String :
+responseText);
//} catch (Exception e) {
//e.printStackTrace(); 
//}

Regards
Jayendran



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Handle white space - JSON to XML using XMLJSON component

2015-05-13 Thread Reji Mathews
Hi Guru

I really wonder if XML element name supports white spaces and if its
legal.. If not, it shudn't be for json either.

Anything which comes with a space might be interpreted as XML attribute.

Think this way! What will a classname look like when it gets converted to
equivalent java classes :-)

Cheers
Reji


On Wed, May 13, 2015 at 12:39 PM, Gnanaguru S gnanagu...@gmail.com wrote:

 Hi Guys,

 I recently got impressed with xmljson component, it does pretty good job in
 transforming JSON to XML and vice versa.

 I have a JSON payload which has keys with white space, xmljson doesnt
 accept
 JSON keys with whitespaces and it throws the exception shown below.

 This is my JSON payload:

 {
   Format: JSON,
   TestData: {
* Key with Spaces in it*: {
   And Again: {
 ChildKey1: Financial,
 ChildKey2: null
   },
 .
 .

 Is there a camel way to handle this ? Or I have to write a processor to
 remove white spaces only on the keys ?

 nu.xom.IllegalNameException: 0x20 is not a legal NCName character
 at nu.xom.Verifier.throwIllegalNameException(Unknown Source)
 at nu.xom.Verifier.checkNCName(Unknown Source)
 at nu.xom.Element._setLocalName(Unknown Source)
 at nu.xom.Element.init(Unknown Source)
 at nu.xom.Element.init(Unknown Source)
 at net.sf.json.xml.XMLSerializer.newElement(XMLSerializer.java:869)
 at
 net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:989)
 at
 net.sf.json.xml.XMLSerializer.processJSONValue(XMLSerializer.java:1040)
 at
 net.sf.json.xml.XMLSerializer.processJSONObject(XMLSerializer.java:990)
 at net.sf.json.xml.XMLSerializer.write(XMLSerializer.java:605)
 at net.sf.json.xml.XMLSerializer.write(XMLSerializer.java:570)
 at

 org.apache.camel.dataformat.xmljson.XmlJsonDataFormat.convertToXMLUsingEncoding(XmlJsonDataFormat.java:191)
 at

 org.apache.camel.dataformat.xmljson.XmlJsonDataFormat.unmarshal(XmlJsonDataFormat.java:186)
 at

 org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:65)
 at

 org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
 at
 org.apache.camel.processor.interceptor.Debug$1.process(Debug.java:50)
 at

 org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:91)
 at

 org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
 at

 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 at

 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at

 org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
 at

 org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 at

 org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73)
 at
 org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:378)
 at
 org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:346)
 at
 org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:242)
 at
 org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:346)
 at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:201)
 at

 org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:128)
 at

 org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:132)
 at

 org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:149)
 at

 org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:297)
 at

 Regards
 Guru



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Handle-white-space-JSON-to-XML-using-XMLJSON-component-tp5767042.html
 Sent from the Camel - Users mailing list archive at Nabble.com.



Re: how to get the soap body from exchange.

2015-05-13 Thread jainmcs03
Team,

I tried additional ways below, but getting SOAPMessage as null.

//  SOAPMessage soapMessage = 
exchange.getIn().getBody(SOAPMessage.class);
//  SOAPMessage soapMessage =
exchange.getIn().getHeader(CxfConstants.CAMEL_CXF_MESSAGE,
SOAPMessage.class);
//  SOAPMessage soapMessage = (SOAPMessage)
exchange.getIn().getBody(List.class).get(0);
//  System.out.println(Inside RealResFormatProcessor :soapMessage :
+soapMessage);


Regards
Jayendran



--
View this message in context: 
http://camel.465427.n5.nabble.com/how-to-get-the-soap-body-from-exchange-tp5767050p5767052.html
Sent from the Camel - Users mailing list archive at Nabble.com.