Re: Issue with ApnsServiceFactory
Hi You may have found a bug in that component. As we love contributions, then feel free to work on a patch and submit it in a JIRA ticket http://camel.apache.org/contributing.html On Fri, Aug 17, 2012 at 3:59 AM, Eli Gelasco eligela...@gmail.com wrote: I found an issue with ApnsServiceFactory class. It will never allow you to create an ApnsService object using gateway.sandbox.push.apple.com, it always changes to gateway.push.apple.com, even if you call ApnsServiceFactory.setGatewayHost(). I was wondering if anyone knew of a work around? The actual issue occurs in ApnsServiceFactory.getApnsService(). getApnsService initially configures ApnsServiceBuild with the gateway host when configureApnsDestination() is called. But the problem is the call to configureApnsCertificate() which is called after configureApnsDestination(). In configureApnsCertificate() the ApnsServiceBuild object (builder) destination is changed when build.withCert(...).withProductionDestination() is called. withProductionDestination overrides the gateway host address. Any help would be appreciated. Thanks Eli -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: jms static broker setup with iptables
Hi This is the Apache Camel mailing list. Your question is more suited at the ActiveMQ mailing list (assuming you use that as a broker). If not then that corresponding mailing list / forum of the given broker is the better place to go. On Thu, Aug 16, 2012 at 9:24 PM, Sean K sk92...@gmail.com wrote: I have two centos machines up and running. When I disable or turn off iptables, the one broker can establish a transport bridge with the other broker on the other centos machine. I noticed that the port number being used changes -- 53033, 53067, etc.. How can I configure each broker in the static network of brokers in a way so that I can re-enable iptables? I prefer to keep iptables running for security reasons -- not that it is the best security out there. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: Bindy : CSV Header is incorrect
It could be easier for use if you can provide a simple test case to reproduce the error. -- Willem Jiang FuseSource Web: http://www.fusesource.com (http://www.fusesource.com/) Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: willemjiang On Thursday, August 16, 2012 at 9:17 PM, houssemgaga wrote: Hello, I use the library Bindy for quite some time, and she is great . However, I recently found a problem. Let me explain: I'm developing on Windows machine, everything goes well. Once deployed on the target machine (Linux), csv files generated are not correct: the header is not good. In fact, I created for each file type csv a model object, in each package separately. There are common fields between the models and the concern comes from there: camel-bindy is lost when generating the header. The generated header contains fields that come from another model. An example : *Model 1 :* @CsvRecord(separator=;, generateHeaderColumns=true, skipFirstLine=true) public class OpportunityDTO implements Serializable{ /** * */ private static final long serialVersionUID = 1L; @DataField(columnName = OpportunityId, pos = 1 ) String opportunityId; @DataField(columnName = AccountId, pos = 2 ) String accountId; @DataField(columnName = Country, pos = 3 ) String country; @DataField(columnName = OpportunityType, pos = 4 ) String opportunityType; @DataField(columnName = ValidStartDate, pos = 5, pattern =\dd/MM/\ ) Date validStartDate; @DataField(columnName = ValidEndDate, pos = 6, pattern =\dd/MM/\ ) Date validEndDate; @DataField(columnName = OpportunityCurrency, pos = 7 ) String opportunityCurrency; @DataField(columnName = ParentOpportunityId, pos = 8 ) String parentOpportunityId; @DataField(columnName = SalesMonitoring, pos = 9 ) String salesMonitoring; // Getter and setter } *Model 2 :* @CsvRecord(separator=;, generateHeaderColumns=true, skipFirstLine=true) public class OpportunityLeaserDTO { @DataField(columnName = OpportunityId, pos = 1 ) String opportunityId; @DataField(columnName = LeaserId, pos = 2 ) String leaserID; @DataField(columnName = ValidStartDate, pos = 3, pattern =\dd/MM/\ ) Date validStartDate; @DataField(columnName = ValidEndDate, pos = 4, pattern =\dd/MM/\ ) Date validEndDate; // Getter and setter } For the first model OpportunityDTO, the header is incorrect and generated as follows: OpportunityId;*LeaserId*;*ValidStartDate*;*ValidEndDate*;Country;ValidStartDate;ValidEndDate;ParentOpportunityId;SalesMonitoring For the second model OpportunityLeaserDTO the generated header is correct I still do not understand where is the problem and why only on linux??? I use the latest release of Bindy: 2.10.0 Thank you for your support. -- View this message in context: http://camel.465427.n5.nabble.com/Bindy-CSV-Header-is-incorrect-tp5717531.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Re: Routing the message to dynamic queue
Thanks a lot michal.warecki, receptionList solved my problem . -- View this message in context: http://camel.465427.n5.nabble.com/Routing-the-message-to-dynamic-queue-tp5717563p5717578.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Bindy : CSV Header is incorrect
I wonder if its related to line terminators on windows vs linux being different. There is an option on bindy to set if its windows, mac or unix. (I think) On Thu, Aug 16, 2012 at 3:17 PM, houssemgaga belhassine.hous...@gmail.com wrote: Hello, I use the library Bindy for quite some time, and she is great . However, I recently found a problem. Let me explain: I'm developing on Windows machine, everything goes well. Once deployed on the target machine (Linux), csv files generated are not correct: the header is not good. In fact, I created for each file type csv a model object, in each package separately. There are common fields between the models and the concern comes from there: camel-bindy is lost when generating the header. The generated header contains fields that come from another model. An example : *Model 1 :* @CsvRecord(separator=;, generateHeaderColumns=true, skipFirstLine=true) public class OpportunityDTO implements Serializable{ /** * */ private static final long serialVersionUID = 1L; @DataField(columnName = OpportunityId, pos = 1 ) String opportunityId; @DataField(columnName = AccountId, pos = 2 ) String accountId; @DataField(columnName = Country, pos = 3 ) String country; @DataField(columnName = OpportunityType, pos = 4 ) String opportunityType; @DataField(columnName = ValidStartDate, pos = 5, pattern =\dd/MM/\ ) Date validStartDate; @DataField(columnName = ValidEndDate, pos = 6, pattern =\dd/MM/\ ) Date validEndDate; @DataField(columnName = OpportunityCurrency, pos = 7 ) String opportunityCurrency; @DataField(columnName = ParentOpportunityId, pos = 8 ) String parentOpportunityId; @DataField(columnName = SalesMonitoring, pos = 9 ) String salesMonitoring; // Getter and setter } *Model 2 :* @CsvRecord(separator=;, generateHeaderColumns=true, skipFirstLine=true) public class OpportunityLeaserDTO { @DataField(columnName = OpportunityId, pos = 1 ) String opportunityId; @DataField(columnName = LeaserId, pos = 2 ) String leaserID; @DataField(columnName = ValidStartDate, pos = 3, pattern =\dd/MM/\ ) Date validStartDate; @DataField(columnName = ValidEndDate, pos = 4, pattern =\dd/MM/\ ) Date validEndDate; // Getter and setter } For the first model OpportunityDTO, the header is incorrect and generated as follows: OpportunityId;*LeaserId*;*ValidStartDate*;*ValidEndDate*;Country;ValidStartDate;ValidEndDate;ParentOpportunityId;SalesMonitoring For the second model OpportunityLeaserDTO the generated header is correct I still do not understand where is the problem and why only on linux??? I use the latest release of Bindy: 2.10.0 Thank you for your support. -- View this message in context: http://camel.465427.n5.nabble.com/Bindy-CSV-Header-is-incorrect-tp5717531.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: jms static broker setup with iptables
You should ask this question on the ActiveMq users list, IMO... Sent from a mobile device Am 16.08.2012 21:25 schrieb Sean K sk92...@gmail.com: I have two centos machines up and running. When I disable or turn off iptables, the one broker can establish a transport bridge with the other broker on the other centos machine. I noticed that the port number being used changes -- 53033, 53067, etc.. How can I configure each broker in the static network of brokers in a way so that I can re-enable iptables? I prefer to keep iptables running for security reasons -- not that it is the best security out there.
Re: [OSGi] JmsComponent config for WebSphere Queue ?
Hello, I managed to realize a connection to the SIBus on WebSphere. The problem is related to package exports / imports in the osgi environment. The Spring JNDI beans are not able to create the initialcontextfactory. This is the osgi blueprint configuration for the jmscomponent: bean id=wasmq class=org.apache.camel.component.jms.JmsComponent property name=configuration ref=jmsConf / property name=destinationResolver ref=jmsDestResolver / /bean bean id=jmsDestResolver class=org.springframework.jms.support.destination.DynamicDestinationResolver /bean bean id=jmsConf class=org.apache.camel.component.jms.JmsConfiguration property name=connectionFactory ref=cfFactory / /bean bean id=cfFactory factory-ref=icBean factory-method=lookup argument value=jms/testConnectionFactory01 / /bean bean id=cfBean class=com.ibm.websphere.naming.WsnInitialContextFactory / bean id=icBean factory-ref=cfBean factory-method=getInitialContext argument props prop key=java.naming.factory.initial value=com.ibm.websphere.naming.WsnInitialContextFactory / prop key=java.naming.provider.url value=iiop://localhost:9001/ / /props /argument /bean -- View this message in context: http://camel.465427.n5.nabble.com/OSGi-JmsComponent-config-for-WebSphere-Queue-tp3380989p5717585.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Bindy : CSV Header is incorrect
Hello, Thank you for your responses. I just found where it comes from the problem. The process of scanning to find the package on Windows models is different on linux (due to classloading, I think). In fact the two models in my example is successively in the following packages: - Model 1: *com. [...].opportunity* - Model 2: *com. [...].opportunity*leaser Scanning the package com. [...].opportunity on Windows return the model OpportrunityDTO by cons on Linux returns the two models (ie it has also scanned the second package). So, we found in the CSV header the fields of the 2nd model they have the same pos as in model 1. I think the classloading policy is différent between Linux and Windows. So to correct the problem, i changed the package names. And here are the logs: - Before: 2012-08-16 16:39:22,164 DEBUG (org.apache.camel.impl.DefaultPackageScanClassResolver:160) - Found: [class com.sfl.dto.csv.opportunity.OpportunitiesDTO, class comsfl.dto.csv.opportunity.OpportunityDTO, class com.sfl.dto.csv.opportunitydealer.OpportunityDealerDTO, class com.sfl.dto.csv.opportunityleaser.OpportunityLeaserDTO] 2012-08-16 16:39:22,164 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:107) - Class retrieved: * com.sfl.dto.csv.opportunity.OpportunitiesDTO* 2012-08-16 16:39:22,165 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 1, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=OpportunityId, required=false, defaultValue=, trim=false, pos=1) 2012-08-16 16:39:22,166 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 2, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=AccountId, required=false, defaultValue=, trim=false, pos=2) 2012-08-16 16:39:22,167 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 3, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=Country, required=false, defaultValue=, trim=false, pos=3) 2012-08-16 16:39:22,167 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 4, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=OpportunityType, required=false, defaultValue=, trim=false, pos=4) 2012-08-16 16:39:22,168 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 5, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=dd/MM/, align=R, paddingChar= , name=, length=0, columnName=ValidStartDate, required=false, defaultValue=, trim=false, pos=5) 2012-08-16 16:39:22,169 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 6, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=dd/MM/, align=R, paddingChar= , name=, length=0, columnName=ValidEndDate, required=false, defaultValue=, trim=false, pos=6) 2012-08-16 16:39:22,169 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 7, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=OpportunityCurrency, required=false, defaultValue=, trim=false, pos=7) 2012-08-16 16:39:22,170 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 8, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=ParentOpportunityId, required=false, defaultValue=, trim=false, pos=8) 2012-08-16 16:39:22,171 DEBUG (org.apache.camel.dataformat.bindy.BindyCsvFactory:114) - Position defined in the class: com.sfl.dto.csv.opportunity.OpportunitiesDTO, position: 9, Field: @org.apache.camel.dataformat.bindy.annotation.DataField(clip=false, position=0, precision=0, pattern=, align=R, paddingChar= , name=, length=0, columnName=SalesMonitoring, required=false, defaultValue=, trim=false, pos=9) 2012-08-16 16:39:22,171 DEBUG
Re: JAXB Data Format
I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more My simple route fails with the above exception. All I have in my pom.xml defined is: dependency groupIdorg.apache.camel/groupId artifactIdcamel-core/artifactId version2.9.2/version /dependency dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version2.9.2/version /dependency Do I need additional dependencies to be added other than this? Regards, Jothi On Thu, Aug 16, 2012 at 3:34 PM, Joe San codeintheo...@gmail.com wrote: I just found that out from Chapter 4. I would have expected this hint that when the bean has only one method, camel invokes it automagically without having to explicitly specifying it in Chapter 3 itself. Regards, Jothi On Thu, Aug 16, 2012 at 3:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 3:16 PM, Joe San codeintheo...@gmail.com wrote: Thanks for pointing me to toe documentation. My actual question got clarified once I had a look into the documentation. From the Camel in Action book: from(quartz://report?cron=0+0+6+*+*+?) .to(http://riders.com/orders/cmd=receiveddate=yesterday;) .bean(new OrderToCsvBean()) .to(file://riders/orders?fileName=report-${header.Date}.csv); How does Camel know which method in the OrderToCsvBean() class to invoke. Unfortunately the book does not mentions this in Chapter 3. Not sure if it is mentioned in Chapter 4 as I'm yet to start with Chapter 4. Yep chapter 4 is all about using beans/pojos with Camel; see for example page 105. But basically if the pojo/bean has 1 method, then Camel knows that it should invoke that method. Its when you have 2+ methods it gets more complicated. You can of course tell Camel the method name to use etc. But its all covered as well in chapter 4, as well you can find pieces of details scattered online in the Camel docs. Regards, Jothi On Thu, Aug 16, 2012 at 2:46 PM, Babak Vahdat babak.vah...@swissonline.chwrote: Check the documentation for this: http://camel.apache.org/bean-binding.html Babak Am 16.08.12 14:32 schrieb Joe San unter codeintheo...@gmail.com : I have decided to use JAXB instead of xStream. My route definition looks like this: final
Re: JAXB Data Format
On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more My simple route fails with the above exception. All I have in my pom.xml defined is: dependency groupIdorg.apache.camel/groupId artifactIdcamel-core/artifactId version2.9.2/version /dependency dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version2.9.2/version /dependency Do I need additional dependencies to be added other than this? Regards, Jothi On Thu, Aug 16, 2012 at 3:34 PM, Joe San codeintheo...@gmail.com wrote: I just found that out from Chapter 4. I would have expected this hint that when the bean has only one method, camel invokes it automagically without having to explicitly specifying it in Chapter 3 itself. Regards, Jothi On Thu, Aug 16, 2012 at 3:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 3:16 PM, Joe San codeintheo...@gmail.com wrote: Thanks for pointing me to toe documentation. My actual question got clarified once I had a look into the documentation. From the Camel in Action book: from(quartz://report?cron=0+0+6+*+*+?) .to(http://riders.com/orders/cmd=receiveddate=yesterday;) .bean(new OrderToCsvBean()) .to(file://riders/orders?fileName=report-${header.Date}.csv); How does Camel know which method in the OrderToCsvBean() class to invoke. Unfortunately the book does not mentions this in Chapter 3. Not sure if it is mentioned in Chapter 4 as I'm yet to start with Chapter 4. Yep chapter 4 is all about using beans/pojos with Camel; see for example page 105. But basically if the pojo/bean has 1 method, then Camel knows that it should invoke that method. Its when you have 2+ methods it gets more complicated. You can of course tell Camel the method name to use etc. But its all covered as well in chapter 4, as well you can find pieces of details scattered online in the Camel docs. Regards, Jothi On Thu, Aug 16, 2012 at 2:46 PM, Babak Vahdat babak.vah...@swissonline.chwrote: Check the documentation for this: http://camel.apache.org/bean-binding.html Babak Am 16.08.12 14:32 schrieb Joe San unter
Re: JAXB Data Format
Just managed to get rid of this issue and I was about to post my solution and saw your message. Added the following as a dependency and it worked! dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.6.6/version /dependency Regards, Jothi On Fri, Aug 17, 2012 at 10:18 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more My simple route fails with the above exception. All I have in my pom.xml defined is: dependency groupIdorg.apache.camel/groupId artifactIdcamel-core/artifactId version2.9.2/version /dependency dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version2.9.2/version /dependency Do I need additional dependencies to be added other than this? Regards, Jothi On Thu, Aug 16, 2012 at 3:34 PM, Joe San codeintheo...@gmail.com wrote: I just found that out from Chapter 4. I would have expected this hint that when the bean has only one method, camel invokes it automagically without having to explicitly specifying it in Chapter 3 itself. Regards, Jothi On Thu, Aug 16, 2012 at 3:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 3:16 PM, Joe San codeintheo...@gmail.com wrote: Thanks for pointing me to toe documentation. My actual question got clarified once I had a look into the documentation. From the Camel in Action book: from(quartz://report?cron=0+0+6+*+*+?) .to(http://riders.com/orders/cmd=receiveddate=yesterday;) .bean(new OrderToCsvBean()) .to(file://riders/orders?fileName=report-${header.Date}.csv); How does Camel know which method in the OrderToCsvBean() class to invoke. Unfortunately the book does not mentions this in Chapter 3. Not sure if it is mentioned in Chapter 4 as I'm yet to start with Chapter 4. Yep chapter 4 is all about using beans/pojos with Camel; see for example page 105. But basically if the pojo/bean has 1 method, then Camel knows that it should
Re: JAXB Data Format
So here comes the next bump! javax.xml.bind.JAXBException: com.example.filexml doesnt contain ObjectFactory.class or jaxb.index Do I have to add a jaxb.index file to my package? Regards, Jothi On Fri, Aug 17, 2012 at 10:24 AM, Joe San codeintheo...@gmail.com wrote: Just managed to get rid of this issue and I was about to post my solution and saw your message. Added the following as a dependency and it worked! dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.6.6/version /dependency Regards, Jothi On Fri, Aug 17, 2012 at 10:18 AM, Claus Ibsen claus.ib...@gmail.comwrote: On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more My simple route fails with the above exception. All I have in my pom.xml defined is: dependency groupIdorg.apache.camel/groupId artifactIdcamel-core/artifactId version2.9.2/version /dependency dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version2.9.2/version /dependency Do I need additional dependencies to be added other than this? Regards, Jothi On Thu, Aug 16, 2012 at 3:34 PM, Joe San codeintheo...@gmail.com wrote: I just found that out from Chapter 4. I would have expected this hint that when the bean has only one method, camel invokes it automagically without having to explicitly specifying it in Chapter 3 itself. Regards, Jothi On Thu, Aug 16, 2012 at 3:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 3:16 PM, Joe San codeintheo...@gmail.com wrote: Thanks for pointing me to toe documentation. My actual question got clarified once I had a look into the documentation. From the Camel in Action book: from(quartz://report?cron=0+0+6+*+*+?) .to(http://riders.com/orders/cmd=receiveddate=yesterday;) .bean(new OrderToCsvBean()) .to(file://riders/orders?fileName=report-${header.Date}.csv); How does Camel know which method in the OrderToCsvBean() class to invoke. Unfortunately the book does not mentions this in Chapter 3.
Re: JAXB Data Format
On Fri, Aug 17, 2012 at 10:46 AM, Joe San codeintheo...@gmail.com wrote: So here comes the next bump! javax.xml.bind.JAXBException: com.example.filexml doesnt contain ObjectFactory.class or jaxb.index Do I have to add a jaxb.index file to my package? Yes, see for example p77 in Camel in Action book. Or google a bit on how to use JAXB with Java. Basically you need to drop a jaxb.index file in the JAR with your JAXB annotated classes. The file should contain a line per class that has JAXB annotations. Regards, Jothi On Fri, Aug 17, 2012 at 10:24 AM, Joe San codeintheo...@gmail.com wrote: Just managed to get rid of this issue and I was about to post my solution and saw your message. Added the following as a dependency and it worked! dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.6.6/version /dependency Regards, Jothi On Fri, Aug 17, 2012 at 10:18 AM, Claus Ibsen claus.ib...@gmail.comwrote: On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more My simple route fails with the above exception. All I have in my pom.xml defined is: dependency groupIdorg.apache.camel/groupId artifactIdcamel-core/artifactId version2.9.2/version /dependency dependency groupIdorg.apache.camel/groupId artifactIdcamel-jaxb/artifactId version2.9.2/version /dependency Do I need additional dependencies to be added other than this? Regards, Jothi On Thu, Aug 16, 2012 at 3:34 PM, Joe San codeintheo...@gmail.com wrote: I just found that out from Chapter 4. I would have expected this hint that when the bean has only one method, camel invokes it automagically without having to explicitly specifying it in Chapter 3 itself. Regards, Jothi On Thu, Aug 16, 2012 at 3:32 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 3:16 PM, Joe San codeintheo...@gmail.com wrote: Thanks for pointing me to toe documentation. My actual question got clarified once I had a look into the documentation. From the Camel in Action book:
Re: exposing different operations under same service in camel + cxf routing.
My bad, I used the dataFormat as MESSAGE and it seems teh operation name is available only in case of dataFormat = PAYLOAD. It works for me with dataFormat = PAYLOAD. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/exposing-different-operations-under-same-service-in-camel-cxf-routing-tp5716944p5717595.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How Do We Specify Operation To Choose In Camel CXf
My bad, I used the dataFormat as MESSAGE and it seems the operation name is available only in case of dataFormat = PAYLOAD. It works for me with dataFormat = PAYLOAD. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/How-Do-We-Specify-Operation-To-Choose-In-Camel-CXf-tp474620p5717596.html Sent from the Camel - Users mailing list archive at Nabble.com.
camle ftp file to activemq message
Hello I am trying to build a route to get a file from a remote ftp , consume it and put the contents of the file into the message. Currently i have this config route descriptionFTP route/description from uri=ftp://someu...@someserver.com/?password=somepwamp;recursive=trueamp;initialDelay=20amp;delete=trueamp;binary=false/ to uri=activemq:somequuee/ /route I do not know if i am attacking this things the right way. It does gets consumed but i basicly have a empty message with some information regarding the file, but i would have espected the contents of the file which is a xml file in this case to be inside the message. Could somebody point me into the right direction? After that i tried something like this route descriptionAsics FTP route/description from uri=ftp://someu...@someserver.com/?password=somepwamp;recursive=trueamp;initialDelay=20amp;delete=trueamp;binary=false/ to uri=file:/somedir/ /route route descriptionAsics File route/description to uri=file:/somedir/ to uri=activemq:somequuee/ /route With the same result. -- View this message in context: http://camel.465427.n5.nabble.com/camle-ftp-file-to-activemq-message-tp5717598.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JAXB Data Format
Thanks! That solved the problem. Now I'm able to successfully get my example running. But I'm not getting Camel do what I wanted. Here is how my route definition looks like! context.addRoutes(new RouteBuilder() { public void configure() { from(file:my.xml).unmarshal(jaxb).bean(new ProcessorBean()).to(file:my.xml); } }); The my.xml is in the same folder where the class containing the above route definition exists. What I'm trying to do is to read the xml, change the value for the name attribute using a processor and write the new xml to the same file. Regards, Jothi On Fri, Aug 17, 2012 at 10:57 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:46 AM, Joe San codeintheo...@gmail.com wrote: So here comes the next bump! javax.xml.bind.JAXBException: com.example.filexml doesnt contain ObjectFactory.class or jaxb.index Do I have to add a jaxb.index file to my package? Yes, see for example p77 in Camel in Action book. Or google a bit on how to use JAXB with Java. Basically you need to drop a jaxb.index file in the JAR with your JAXB annotated classes. The file should contain a line per class that has JAXB annotations. Regards, Jothi On Fri, Aug 17, 2012 at 10:24 AM, Joe San codeintheo...@gmail.com wrote: Just managed to get rid of this issue and I was about to post my solution and saw your message. Added the following as a dependency and it worked! dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.6.6/version /dependency Regards, Jothi On Fri, Aug 17, 2012 at 10:18 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more My simple route fails with the above exception. All I have in my pom.xml defined is: dependency groupIdorg.apache.camel/groupId artifactIdcamel-core/artifactId version2.9.2/version /dependency dependency groupIdorg.apache.camel/groupId
Re: camle ftp file to activemq message
Do you want to send the content (string) of files to queue? You can try in that way: from uri=ftp://someu...@someserver.com/?password=somepwamp;recursive=trueamp;initialDelay=20amp;delete=trueamp;binary=false/ *convertBodyTo type=java.lang.String/* to uri=activemq:somequuee/ -- View this message in context: http://camel.465427.n5.nabble.com/camle-ftp-file-to-activemq-message-tp5717598p5717599.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JAXB Data Format
On Fri, Aug 17, 2012 at 11:26 AM, Joe San codeintheo...@gmail.com wrote: Thanks! That solved the problem. Now I'm able to successfully get my example running. But I'm not getting Camel do what I wanted. Here is how my route definition looks like! context.addRoutes(new RouteBuilder() { public void configure() { from(file:my.xml).unmarshal(jaxb).bean(new ProcessorBean()).to(file:my.xml); } }); The my.xml is in the same folder where the class containing the above route definition exists. What I'm trying to do is to read the xml, change the value for the name attribute using a processor and write the new xml to the same file. The file component in Camel http://camel.apache.org/file2 Requires to be configured with a *starting directory*. If you want to pickup a single file by its name, you need to use the fileName option for that from(file:startingDir?fileName=my.xml)... You may use dot as starting directory to say current dir (a bit odd though) from(file:.?fileName=my.xml)... Regards, Jothi On Fri, Aug 17, 2012 at 10:57 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:46 AM, Joe San codeintheo...@gmail.com wrote: So here comes the next bump! javax.xml.bind.JAXBException: com.example.filexml doesnt contain ObjectFactory.class or jaxb.index Do I have to add a jaxb.index file to my package? Yes, see for example p77 in Camel in Action book. Or google a bit on how to use JAXB with Java. Basically you need to drop a jaxb.index file in the JAR with your JAXB annotated classes. The file should contain a line per class that has JAXB annotations. Regards, Jothi On Fri, Aug 17, 2012 at 10:24 AM, Joe San codeintheo...@gmail.com wrote: Just managed to get rid of this issue and I was about to post my solution and saw your message. Added the following as a dependency and it worked! dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.6.6/version /dependency Regards, Jothi On Fri, Aug 17, 2012 at 10:18 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com wrote: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at
Re: How Do We Specify Operation To Choose In Camel CXf
When you chose MESSAGE data format, camel-cxf will not read the content and it is impossible to know the operation name without help of the soap action header. If you chose PAYLOAD or POJO, you should be able to get the operation name from the message header. -- Willem Jiang FuseSource Web: http://www.fusesource.com (http://www.fusesource.com/) Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: willemjiang On Friday, August 17, 2012 at 5:10 PM, anupamsen wrote: My bad, I used the dataFormat as MESSAGE and it seems the operation name is available only in case of dataFormat = PAYLOAD. It works for me with dataFormat = PAYLOAD. Thanks. -- View this message in context: http://camel.465427.n5.nabble.com/How-Do-We-Specify-Operation-To-Choose-In-Camel-CXf-tp474620p5717596.html Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
Custom Component Query
Hi I have a custom component which has a ScheduledPollConsumer. The custom component pushes and consumes messages to/from a vendor product via a proprietary network API which the vendor has provided. If I have a network failure my consumer picks up on this straight away as it is polling a network connection. When the network failure does occur my consumer tries to correct itself by re-establishing connectivity. If the connectivity is not restored after N attempts the consumers stops itself. If there is a network related issue and the consumer is trying to correct itself, it is very possible during this time that my producer for this endpoint will be invoked. It will obviously also fail if there is a network connectivity issue. The producer will be referenced in a different route to the consumer. I am wondering how best to handle this. Should I try to suspend any route that references the effected endpoint during the period in which I am attempting to re-establish connectivity and then subsequently stop the effected routes if I cannot re-establish connectivity? Presently I am just stopping the consumer for the efffected endpoint Thanks Joe -- View this message in context: http://camel.465427.n5.nabble.com/Custom-Component-Query-tp5717603.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: JAXB Data Format
Thanks for the pointer. I made the necessary changes to my route but still unable to make it work! from(file:.?fileName=my.xml).unmarshal(jaxb).bean(new ProcessorBean()).to(file:.?fileName=my1.xml); For convenient sake, I changed the name of the target file (my1.xml). Why would my ProcessorBean not invoked? Also how can I see that my.xml was picked up by Camel in the from clause? Regards, Jothi On Fri, Aug 17, 2012 at 12:19 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 11:26 AM, Joe San codeintheo...@gmail.com wrote: Thanks! That solved the problem. Now I'm able to successfully get my example running. But I'm not getting Camel do what I wanted. Here is how my route definition looks like! context.addRoutes(new RouteBuilder() { public void configure() { from(file:my.xml).unmarshal(jaxb).bean(new ProcessorBean()).to(file:my.xml); } }); The my.xml is in the same folder where the class containing the above route definition exists. What I'm trying to do is to read the xml, change the value for the name attribute using a processor and write the new xml to the same file. The file component in Camel http://camel.apache.org/file2 Requires to be configured with a *starting directory*. If you want to pickup a single file by its name, you need to use the fileName option for that from(file:startingDir?fileName=my.xml)... You may use dot as starting directory to say current dir (a bit odd though) from(file:.?fileName=my.xml)... Regards, Jothi On Fri, Aug 17, 2012 at 10:57 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:46 AM, Joe San codeintheo...@gmail.com wrote: So here comes the next bump! javax.xml.bind.JAXBException: com.example.filexml doesnt contain ObjectFactory.class or jaxb.index Do I have to add a jaxb.index file to my package? Yes, see for example p77 in Camel in Action book. Or google a bit on how to use JAXB with Java. Basically you need to drop a jaxb.index file in the JAR with your JAXB annotated classes. The file should contain a line per class that has JAXB annotations. Regards, Jothi On Fri, Aug 17, 2012 at 10:24 AM, Joe San codeintheo...@gmail.com wrote: Just managed to get rid of this issue and I was about to post my solution and saw your message. Added the following as a dependency and it worked! dependency groupIdorg.slf4j/groupId artifactIdslf4j-api/artifactId version1.6.6/version /dependency Regards, Jothi On Fri, Aug 17, 2012 at 10:18 AM, Claus Ibsen claus.ib...@gmail.com wrote: On Fri, Aug 17, 2012 at 10:06 AM, Joe San codeintheo...@gmail.com wrote: I've tried to get rid of this issue but unfortunately could not. What I do not understand is the following: The Error says: Exception in thread main java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at org.apache.camel.support.ServiceSupport.clinit(ServiceSupport.java:38) at org.example.filexml.CamelWithFileAndXML.main(CamelWithFileAndXML.java:23) Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory I have a dependency as: dependency groupIdorg.slf4j/groupId artifactIdslf4j-log4j12/artifactId version1.6.6/version /dependency When I checked the slf4j jar file, the package structure is different from what the error says. There is no org.slf4j.LoggerFactory but rather org\slf4j\impl\Log4jLoggerFactory. Am I using wrong libraries? And you got slf4j-api JAR as well? Its needed as dependency. Regards, Jothi On Thu, Aug 16, 2012 at 5:37 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Aug 16, 2012 at 4:08 PM, Joe San codeintheo...@gmail.com wrote: Even with the al4j-log4j dependecy added in the libraries, I get this error. Are you sure they are on the classpath when you run the app form within Eclipse. And you may want to add slf4j-log4j12 or some other logging bridge so you can use log4j, or maybe some other log kit to log. Then you can see logs in the console in eclipse etc, if you configure logging to output to std out. If you create a new Camel project using the maven archetypes it does that. camel.apache.org/camel-maven-archetypes.html Or see some of the Camel examples in the examples dir Regards, Jothi On Thu, Aug 16, 2012 at 3:59 PM, Claus Ibsen claus.ib...@gmail.com wrote: Hi See this FAQ http://camel.apache.org/what-jars-do-i-need.html On Thu, Aug 16, 2012 at 3:50 PM, Joe San codeintheo...@gmail.com
Re: intercept exchange after transaction retry failure
Hi The TX error handler is working together with a TX manager. And thus you cannot enrich the exchange before it rollback etc. The idea is that the TX manager issues a rollback, and the external system (which delivered the message in the first place) can act accordingly. Often this external system keeps track of redelivery attempts and have its way of moving messages to a dead letter queue if its a poison message (eg would redeliver forever). If you use the Camel DeadLetterChannel error handler instead, then its not using a TX manager per see. And you can enrich the message, and move it to your custom dead letter queue. On Fri, Aug 17, 2012 at 9:43 AM, Gabriel Chan gabriel.c...@middleware360.com wrote: Hi, I'm somewhat new to camel. I have my camel context using the spring TransactionErrorHandlerBuilder to handle transactions. This seems to be working ok and I'm seeing transactions retry and fail out as expected. What I would like to do now is intercept the exchange after all the retries fail and before it goes to the dead letter queue but I can't seem to find a way to do that. It seems the only time I can process the exchange is prior to each retry. Is this correct? Ultimately, what I'm trying to do is to add additional information to the exchange, such as the route it was on when it failed or serializing the exchange and putting it in the message body.for later processing. Is this the correct approach or is there a better way? thanks, gabe -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Re: Camel Build Error
I ran the build using -Dmaven.test.skip=true but unfortunately that did not work but -Dtest=false worked. Not sure what the difference is? But anyways thanks for the support. I can now try running the unit tests to get used to the source code. Regards, Jothi On Thu, Aug 16, 2012 at 3:04 AM, Willem jiang willem.ji...@gmail.comwrote: How did you run the build? As camel-spring has the test dependency of camel-core test jar, you need to install the test.jar when you run the build. You need to use mvn clean install -Dtest=false from the root to run the build. -- Willem Jiang FuseSource Web: http://www.fusesource.com (http://www.fusesource.com/) Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: willemjiang On Thursday, August 16, 2012 at 12:42 AM, Joe San wrote: [ERROR] Failed to execute goal on project camel-spring: Could not resolve dependencies for project org.apache.camel:camel-spring:bundle:2.11-SNAPSHOT: Could not find artifact org.apache.camel:camel-core:jar:tests:2.11-SNAPSHOT in apache.snapshots ( http://repository.apache.org/snapshots/) - [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn goals -rf :camel-spring Is this a known issue? I did delete my -m2 cache before I started the Camel build. Regards, Jothi
Re: Camel Build Error
You may need to run mvn -Pfastinstall and not -Dtest=false. While the Surefire JUnit test plugin will work, the Failsafe plugin will not support the -Dtest=false switch. On Fri, Aug 17, 2012 at 11:55 AM, Joe San codeintheo...@gmail.com wrote: I ran the build using -Dmaven.test.skip=true but unfortunately that did not work but -Dtest=false worked. Not sure what the difference is? But anyways thanks for the support. I can now try running the unit tests to get used to the source code. Regards, Jothi On Thu, Aug 16, 2012 at 3:04 AM, Willem jiang willem.ji...@gmail.com wrote: How did you run the build? As camel-spring has the test dependency of camel-core test jar, you need to install the test.jar when you run the build. You need to use mvn clean install -Dtest=false from the root to run the build. -- Willem Jiang FuseSource Web: http://www.fusesource.com (http://www.fusesource.com/) Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.javaeye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: willemjiang On Thursday, August 16, 2012 at 12:42 AM, Joe San wrote: [ERROR] Failed to execute goal on project camel-spring: Could not resolve dependencies for project org.apache.camel:camel-spring:bundle:2.11-SNAPSHOT: Could not find artifact org.apache.camel:camel-core:jar:tests:2.11-SNAPSHOT in apache.snapshots ( http://repository.apache.org/snapshots/) - [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn goals -rf :camel-spring Is this a known issue? I did delete my -m2 cache before I started the Camel build. Regards, Jothi -- -- Scott England-Sullivan -- FuseSource Web: http://www.fusesource.com Blog: http://sully6768.blogspot.com Twitter: sully6768
Aggregator not propagating exception back in camel version 1.6.2
I am calling a route from Aggregator using direct component once aggregation is complete. When the called direct route throws any Exception I expect that aggregator *should not handle* that exception, but the problem I am facing is that the exception is being getting handled by the aggregator which i dont require. I am using camel *1.6.2 version* and i can't ugrade to newer versions. Following is code snippet i am using route id=splitterRoute errorHandlerRef=noErrorHandlerBuilder splitter xpath/ord:orderSet/ord:orders/ord:order/xpath process ref=myProcessor / to uri=direct:aggregatorRoute / /splitter /route route id=aggregatorRoute errorHandlerRef=noErrorHandlerBuilder from uri=direct:aggregatorRoute / aggregator strategyRef=aggregatorStrategy simpleheader.JMSCorrelationID/simple to uri=direct:responseGenerationRoute/ completedPredicate methodCall bean=aggregationCompletionStrategy method=aggregationComplete / /completedPredicate /aggregator /route route id=responseGenerationRoute errorHandlerRef=noErrorHandlerBuilder from uri=direct:responseGenerationRoute / process ref=responseGenerationProcessor / recipientList headerresponseDestination/header /recipientList /route It will be helpfull, If someone can provide any direction on this. Thanks in Advance Neeraj -- View this message in context: http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629.html Sent from the Camel - Users mailing list archive at Nabble.com.
ProducerTemplate and Exception Management
Hi, I used a producer template to send a body. I have found a method which is void *sendBody*(String http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true endpointUri, Object http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true body) throws CamelExecutionException http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/CamelExecutionException.html I have done some tests and only catch this exception as written in the documentation. But during my testing i had a configuration issue due to dynamic endpoint and I have seen that another exception can be thrown by this method which were not managed by the code. The following Exception is : NoSuchEndpointException I have seen thas this exception can be a usual error : http://camel.apache.org/exception-orgapachecamelnosuchendpointexception.html My question is why this exception is not intercepted by the producer template and wrapped in a CamelExecutionException as defined in the prototype of the method ? I know that I am using an old version of camel (2.4.0-fuse-00-00) but I looked to sources and the method which throws the exception has not change since 2.4.0. DefaultProducerTemplate.java protected Endpoint resolveMandatoryEndpoint(String endpointUri) { Endpoint endpoint = context.getEndpoint(endpointUri); if (endpoint == null) { throw new NoSuchEndpointException(endpointUri); } return endpoint; } Could it be a good idea to wrap this exception or add it in the documentation in order to avoid missing error cases ? Regards Hervé
Re: Aggregator not propagating exception back in camel version 1.6.2
Camel 1.x is EOL and no longer supported at Apache. in your custom aggregatorStrategy you should be able to get the caused exception on the exchange. And decide what to do. On Fri, Aug 17, 2012 at 6:05 PM, Neeraj Mahajan neeraj.maha...@specsavers.com wrote: I am calling a route from Aggregator using direct component once aggregation is complete. When the called direct route throws any Exception I expect that aggregator *should not handle* that exception, but the problem I am facing is that the exception is being getting handled by the aggregator which i dont require. I am using camel *1.6.2 version* and i can't ugrade to newer versions. Following is code snippet i am using route id=splitterRoute errorHandlerRef=noErrorHandlerBuilder splitter xpath/ord:orderSet/ord:orders/ord:order/xpath process ref=myProcessor / to uri=direct:aggregatorRoute / /splitter /route route id=aggregatorRoute errorHandlerRef=noErrorHandlerBuilder from uri=direct:aggregatorRoute / aggregator strategyRef=aggregatorStrategy simpleheader.JMSCorrelationID/simple to uri=direct:responseGenerationRoute/ completedPredicate methodCall bean=aggregationCompletionStrategy method=aggregationComplete / /completedPredicate /aggregator /route route id=responseGenerationRoute errorHandlerRef=noErrorHandlerBuilder from uri=direct:responseGenerationRoute / process ref=responseGenerationProcessor / recipientList headerresponseDestination/header /recipientList /route It will be helpfull, If someone can provide any direction on this. Thanks in Advance Neeraj -- View this message in context: http://camel.465427.n5.nabble.com/Aggregator-not-propagating-exception-back-in-camel-version-1-6-2-tp5717629.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
Intercept processor/bean
Hey all, Is there a way to intercept custom processor execution? For example my route is following: process(new LoggingProcessor()) or processRef(loggingProcessor) Also, is it's even possible to use interceptSendToEndpoint with bean or beanRef DSL elements? Kind regards, Lukasz