Re: Transactional Camel Bean component : Should we define a transacted camel route or not ?
I would say so only if the scope of the transaction is beyond the DAO (presuming the bean is a DAO). Most, actually all, of what I've done ends up having the transactions atomically scoped by DAO methods (which in turn use the Spring @Transaction annotation). -- View this message in context: http://old.nabble.com/Transactional-Camel-Bean-component-%3A-Should-we-define-a-transacted--camel-route-or-not---tp28513052p2878.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camel route logging
Hi See the RedeliveryPolicy http://camel.apache.org/maven/camel-2.2.0/camel-core/apidocs/org/apache/camel/processor/RedeliveryPolicy.html On Thu, May 13, 2010 at 7:53 PM, usha Kanteti u_kant...@yahoo.com wrote: I use camel 2.2 I need the exception errors to go the log file that I specified in log4j.properties file so how and where I have to specify logStackTrace and log level I have the following route defined camelContext xmlns=http://camel.apache.org/schema/spring; onException useOriginalMessage=true exception java.net.ConnectException/exception exception our User defined excetion /exception redeliveryPolicy maximumRedeliveries=-1 / handledconstanttrue/constant/handled /onException route from uri= / bean ref=handleMessage method=processIncoming/ to uri=cxf:bean: / /route /camelContext usha Kanteti wrote: I included the dependencies for log4j in my pom file dependency groupIdcommons-logging/groupId artifactIdcommons-logging/artifactId version1.1/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency and I use the following log4j.properties log4j.rootLogger=INFO, out log4j.logger.org.apache.camel=DEBUG,ERROR log4j.appender.out=org.apache.log4j.ConsoleAppender log4j.appender.out.layout=org.apache.log4j.PatternLayout log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern =%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.appender.R = org.apache.log4j.RollingFileAppender log4j.appender.R.File = my_log.log log4j.appender.R.MaxFileSize = 100KB with this configuration, I see my logging statements from java code are getting into the log file but not any errors from camel (routing process). I am getting some errors in camel routing process,these errors also should go into the log file. how can we do that. Thanks. -- View this message in context: http://old.nabble.com/camel-route--logging-tp28548848p28550639.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Camel Hyperic Agent plugin anyone?
Just wondering if anyone has created some plugin xml for a Hyperic Agent that they'd be willing to share... Kind regards, Christopher -- View this message in context: http://old.nabble.com/Camel-Hyperic-Agent-plugin-anyone--tp28555615p28555615.html Sent from the Camel - Users mailing list archive at Nabble.com.
Monitoring tools for Camel/JMX applications
Hi there, Any recommendations for monitoring Camel applications i.e. JMX based applications? I've been playing around with the open source version of Hyperic but haven't quite managed to make it report on my Camel application. Kind regards, Christopher -- View this message in context: http://old.nabble.com/Monitoring-tools-for-Camel-JMX-applications-tp28555630p28555630.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: XPath Spliiter Problem
Thanks a lot for helping me out. What is the release date of Camel 2.3 ? Claus Ibsen-2 wrote: Hi I have implemented this in Camel 2.3 so it can do your example out of the box. On Thu, Apr 22, 2010 at 12:10 PM, Claus Ibsen claus.ib...@gmail.com wrote: On Thu, Apr 22, 2010 at 12:00 PM, mitul1411 mitul.1...@gmail.com wrote: I used file output for testing the values. My requirement is that I have to send the values from the nodes to the CXF endpoint. Adding a bean would mean an overhead to the route. I need your suggestions on it. There is not much overhead in a bean / processor than the convertBodyTo You gotta do the same, convert the XPath result to something that can be streamed to a file. I have created a ticket to create type converters out of the box in Camel https://issues.apache.org/activemq/browse/CAMEL-2669 Claus Ibsen-2 wrote: Hi You can convert that yourself in a processor / bean // use iterator to walk the XML Iterator it = exchange.getIn().getBody(Iterator.class); while (it.hasNext()) { Object value = it.next(); String s = exchange.getContext().getTypeConverter().convertTo(String.class, value); // now add the str to something } // and replace the body exchange.getIn().setBody(myStringWithXml); But we should maybe add some default type converter to Camel that can work with the XPath types On Thu, Apr 22, 2010 at 11:13 AM, mitul1411 mitul.1...@gmail.com wrote: When I do not provide any resultType (i.e. using the default one) , I get the following error. No type converter available to convert from type: com.sun.org.apache.xerces.internal.dom.DeferredElementNSImpl to the required type: java.io.InputStream with value [cone: null] The above statement is one of the excerpts from the whole stack trace. Claus Ibsen-2 wrote: Do not use resultType=java.lang.String By default it uses some XPath standard type (NODESET) which is defined in javax.xml.xpath.XPathConstants The NODESET should be able to contain multiple nodes in the result. On Thu, Apr 22, 2010 at 10:56 AM, mitul1411 mitul.1...@gmail.com wrote: Hello everyone, I am not an advanced user of Camel. When I use XPath Splitter , I get only one record in the result. How do I get multiple records ? For example : My XML file is coneabc/cone ctwoxyz/ctwo coneabc123/cone ctwoxyz123/ctwo coneabcqqq/cone ctwoxyzqqq/ctwo /c I use the following configuration in the xml file : camelContext xmlns=http://camel.apache.org/schema/spring; id=xpathrouter route from uri=activemq:queue:myqueue / split xpath resultType=java.lang.String/a/b/cone/xpath to uri=file:/abc/messages/test / /split /route /camelContext The result I get is : abc I also want abc123 and abcqqq in the result. Can anyone help me out ? Thank You. -- View this message in context: http://old.nabble.com/XPath-Spliiter-Problem-tp28325959p28325959.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- View this message in context: http://old.nabble.com/XPath-Spliiter-Problem-tp28325959p28326122.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- View this message in context: http://old.nabble.com/XPath-Spliiter-Problem-tp28325959p28326725.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- View this message in context: http://old.nabble.com/XPath-Splitter-Problem-tp28325959p28555777.html Sent from the Camel - Users mailing list archive at Nabble.com.
FTP creating connection based on domain, username, password
Hello All, I have got a problem with FTP connections, as it is creating a connection for every URI even it is for the same domain. so it is ending up using all the connections at some point of time even though it is for same doman! In our case , we may need to send the no of files to the same domain with diferrent user name and password but other parameters may vary. is there any way that we can make sure that the component should open a single connection based on domain, username, password. Many thanks for the suggestions. Regards Sri -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557459p28557459.html Sent from the Camel - Users mailing list archive at Nabble.com.
FTP creating connection based on domain, username, password
Hello All, I have got a problem with FTP connections, as it is creating a connection for every URI even it is for the same domain. so it is ending up using all the connections at some point of time even though it is for same doman! In our case , we may need to send the no of files to the same domain with diferrent user name and password but other parameters may vary. is there any way that we can make sure that the component should open a single connection based on domain, username, password. Many thanks for the suggestions. Regards Sri -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557482p28557482.html Sent from the Camel - Users mailing list archive at Nabble.com.
FTP creating connection based on domain, username, password
Hello All, I have got a problem with FTP connections, as it is creating a connection for every URI even it is for the same domain. so it is ending up using all the connections at some point of time even though it is for same doman! In our case , we may need to send the no of files to the same domain with diferrent user name and password but other parameters may vary. is there any way that we can make sure that the component should open a single connection based on domain, username, password. Many thanks for the suggestions. Regards Sri -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557488p28557488.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Ommiting XML declaration when converting from Dom to String
Hi Dragisa, I just committed a quick fix for it, please check the latest Camel 2.3-SNAPSHOT and look up the usage on the JIRA. Willem Dragisa Krsmanovic wrote: https://issues.apache.org/activemq/browse/CAMEL-2720 On Thu, 2010-05-13 at 09:23 +0200, Claus Ibsen wrote: On Wed, May 12, 2010 at 11:23 PM, Dragisa Krsmanovic dkrsmano...@plos.org wrote: XmlConverter is hardcoded to omit XML declarations when serializing Dom documents. The information about document's character encoding is lost this way. What is the reason for this and is there a way to override default transformer properties in XmlConverter ? Could you create a JIRA ticket for this. See: http://fisheye6.atlassian.com/browse/camel/trunk/camel-core/src/main/java/org/apache/camel/converter/jaxp/XmlConverter.java?r=HEAD#l101 -- Dragisa Krsmanovic Java Developer Public Library of Science
Re: Camel + Spring +JMX + Authentication
On Fri, May 14, 2010 at 2:06 AM, daytaa nathan.mccar...@macquarie.com wrote: Thanks for the links. I'm trying to setup JMX to use the password and access properties files. Passing in arguments to the JVM (i.e. -Dcom.sun.management.jmxremote.access.file=fullpath) but doesnt seem to work. Does Camel actually disable RMI authentication? I dont hink so. Some other users have used authentication with JMX and Camel. Maybe you can find that user thread about it? Cheers. -- View this message in context: http://old.nabble.com/Camel-%2B-Spring-%2BJMX-%2B-Authentication-tp28543268p28553960.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: Camel Hyperic Agent plugin anyone?
On Fri, May 14, 2010 at 8:07 AM, huntc hu...@mac.com wrote: Just wondering if anyone has created some plugin xml for a Hyperic Agent that they'd be willing to share... A side note is that FUSE subscribers can use FUSE HQ which can manage Camel and the other FUSE products from Hyperic. So its doable. Kind regards, Christopher -- View this message in context: http://old.nabble.com/Camel-Hyperic-Agent-plugin-anyone--tp28555615p28555615.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: FTP creating connection based on domain, username, password
On Fri, May 14, 2010 at 12:09 PM, Srini97 sri.tec...@googlemail.com wrote: Hello All, I have got a problem with FTP connections, as it is creating a connection for every URI even it is for the same domain. so it is ending up using all the connections at some point of time even though it is for same doman! In our case , we may need to send the no of files to the same domain with diferrent user name and password but other parameters may vary. is there any way that we can make sure that the component should open a single connection based on domain, username, password. I really doubt you can share a connection between different usernames (eg a connection is private to a given user). Many thanks for the suggestions. Regards Sri -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557488p28557488.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: Camel XSLT, how to pass a Map param to XSL
Hi Have you checked the Camel documentation? http://camel.apache.org/xslt.html There is a section titled - Getting Parameters into the XSLT to work with On Thu, May 13, 2010 at 6:57 PM, Vikas Kumar Arora vikas_kumar...@yahoo.com wrote: Hi, Is there a way to pass Map as a param to XSLT component? Camel 1.6.2 (As we run on Jdk1.4, no other choice) Requirement: I've location maps(Properties file) M1, M2 etc from Partners P1, P2. And before forwarding the request to WS, I have to apply the XSL Transforamtion to convert P1, P2 etc format to our WS format. But in this process I've to apply Location Code transformation as well. xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ws=http://ws.xx.com; xmlns:spml=urn:oasis:names:tc:SPML:2:0 xmlns:udc=urn:x:enterprise:domain:identity:1.0 xmlns:xalan=http://xml.apache.org/xalan; xmlns:map=java:java.util.Map exclude-result-prefixes=xalan spml ws soapenv version=2.0 xsl:output method=xml omit-xml-declaration=yes/ !--xsl:param name=title/-- xsl:param name=map/ xsl:template match=@* | node() xsl:copy xsl:apply-templates select=@* | node() / /xsl:copy /xsl:template xsl:template match=udc:UDCIdentity !--xsl:value-of select=$title/-- xsl:value-of select=map:get($map, 'locationCode')/ xsl:copy xsl:apply-templates select=@* | node() / /xsl:copy /xsl:template /xsl:stylesheet Sample Camel Config that I'm experimenting for now: camel:route camel:from uri=jetty:http://localhost:8081/AuthN/esb/ camel:setHeader headerName=myParam1camel:constant1/camel:constant/camel:setHeader camel:setHeader headerName=myParam2camel:constant2/camel:constant/camel:setHeader camel:setHeader headerName=myParam3camel:constant3/camel:constant/camel:setHeader camel:setHeader headerName=myParam4camel:constant4/camel:constant/camel:setHeader camel:setProperty propertyName=routeId camel:header1/camel:header /camel:setProperty camel:to uri=xslt:transfomer.xsl/ camel:to uri=bean:someBean/ camel:to uri=http://login.dev2..edu/AuthN/services/Service/ !-- camel:filter camel:mvelrequest.headers.foo == 'bar'/camel:mvel camel:to uri=http://login.dev2..edu/AuthN/services/Service/ /camel:filter-- /camel:route /camel:camelContext Some Spring Util config: util:properties id=P1 location=classpath:LocationCodes.properties/ (I'm not sure how could i inject into Camel SetProperty somewhere). Any suggestions would help. Thanks, Vikas -- View this message in context: http://old.nabble.com/Camel-XSLT%2C-how-to-pass-a-Map-param-to-XSL-tp28550003p28550003.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Embedded ActiveMQ error (Unable to validate using XSD)
Hi guys, I am trying to run an embedded activemq in my web application using eclipse. I am certain I have all the right jars and versions as well, the error below keep coming up: org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.xerces.jaxp.documentbuilderfactoryi...@7b37df] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) However, if I start d same web application from tomcat windows service, I get the following error: 11:55:53,266 INFO DefaultListableBeanFactory:421 - Destroying singletons in org.springframework.beans.factory.support.defaultlistablebeanfact...@2006a0: defining beans [incomingSMSListener,jmsExceptionListener,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor,org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor,threadPoolExecutor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,broker,redeliveryPolicy,jmsFactory,cachingConnectionFactory,transactionManager,outgoingSMSQueueJmsTemplate,IncomingSMSListene r]; root of factory hierarchy 11:55:53,266 DEBUG DisposableBeanAdapter:172 - Invoking destroy() on bean with name 'org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor' 11:55:53,266 ERROR ContextLoader:219 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'broker' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 31 in XML document from ServletContext resource [/WEB-INF/activemq-broker.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'broker'. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196) Kindly help out! -- View this message in context: http://old.nabble.com/Embedded-ActiveMQ-error-%28Unable-to-validate-using-XSD%29-tp28557976p28557976.html Sent from the Camel - Users (activemq) mailing list archive at Nabble.com.
Re: FTP creating connection based on domain, username, password
My requirement is to share the connection for the same domain , username and password. For other username for the same domain we can have different connection , thats not an issue Claus Ibsen-2 wrote: On Fri, May 14, 2010 at 12:09 PM, Srini97 sri.tec...@googlemail.com wrote: Hello All, I have got a problem with FTP connections, as it is creating a connection for every URI even it is for the same domain. so it is ending up using all the connections at some point of time even though it is for same doman! In our case , we may need to send the no of files to the same domain with diferrent user name and password but other parameters may vary. is there any way that we can make sure that the component should open a single connection based on domain, username, password. I really doubt you can share a connection between different usernames (eg a connection is private to a given user). Many thanks for the suggestions. Regards Sri -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557488p28557488.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557459p28558479.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: FTP creating connection based on domain, username, password
On Fri, May 14, 2010 at 1:57 PM, Srini97 sri.tec...@googlemail.com wrote: My requirement is to share the connection for the same domain , username and password. For other username for the same domain we can have different connection , thats not an issue Well the Apache Commons FTP library cannot handle concurrency on the same Session. Claus Ibsen-2 wrote: On Fri, May 14, 2010 at 12:09 PM, Srini97 sri.tec...@googlemail.com wrote: Hello All, I have got a problem with FTP connections, as it is creating a connection for every URI even it is for the same domain. so it is ending up using all the connections at some point of time even though it is for same doman! In our case , we may need to send the no of files to the same domain with diferrent user name and password but other parameters may vary. is there any way that we can make sure that the component should open a single connection based on domain, username, password. I really doubt you can share a connection between different usernames (eg a connection is private to a given user). Many thanks for the suggestions. Regards Sri -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557488p28557488.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- View this message in context: http://old.nabble.com/FTP-creating-connection-based-on-domain%2C-username%2C-password-tp28557459p28558479.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: camel route logging
Hi Just use ERROR, INFO, DEBUG etc. etc ERROR On Fri, May 14, 2010 at 3:00 PM, usha Kanteti u_kant...@yahoo.com wrote: HI As suggested in the URL http://camel.apache.org/maven/camel-2.2.0/camel-core/apidocs/org/apache/camel/processor/RedeliveryPolicy.html I am trying to set logStackTrace and retryAttemptedLogLevel in the following code onException useOriginalMessage=true exception java.net.ConnectException/exception redeliveryPolicy maximumRedeliveries=-1 logStackTrace = true retryAttemptedLogLevel=LoggingLevel.ERROR / handledconstanttrue/constant/handled /onException I am getting the following build error cvc-enumeration-valid: Value 'LoggingLevel.ERROR' is not facet-valid with respect to enumeration '[DEBUG, ERROR, FATAL, INFO, TRACE, WARN, OFF]'. It must be a value from the enumeration. I tried LoggingLevel.DEBUG and LoggingLevel.WARN also. I am getting the same error message. Please advise. Thanks. Claus Ibsen-2 wrote: Hi See the RedeliveryPolicy http://camel.apache.org/maven/camel-2.2.0/camel-core/apidocs/org/apache/camel/processor/RedeliveryPolicy.html On Thu, May 13, 2010 at 7:53 PM, usha Kanteti u_kant...@yahoo.com wrote: I use camel 2.2 I need the exception errors to go the log file that I specified in log4j.properties file so how and where I have to specify logStackTrace and log level I have the following route defined camelContext xmlns=http://camel.apache.org/schema/spring; onException useOriginalMessage=true exception java.net.ConnectException/exception exception our User defined excetion /exception redeliveryPolicy maximumRedeliveries=-1 / handledconstanttrue/constant/handled /onException route from uri= / bean ref=handleMessage method=processIncoming/ to uri=cxf:bean: / /route /camelContext usha Kanteti wrote: I included the dependencies for log4j in my pom file dependency groupIdcommons-logging/groupId artifactIdcommons-logging/artifactId version1.1/version /dependency dependency groupIdlog4j/groupId artifactIdlog4j/artifactId version1.2.13/version /dependency and I use the following log4j.properties log4j.rootLogger=INFO, out log4j.logger.org.apache.camel=DEBUG,ERROR log4j.appender.out=org.apache.log4j.ConsoleAppender log4j.appender.out.layout=org.apache.log4j.PatternLayout log4j.appender.out.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n #log4j.appender.out.layout.ConversionPattern=%d [%-15.15t] %-5p %-30.30c{1} - %m%n # Pattern to output the caller's file name and line number. log4j.appender.stdout.layout.ConversionPattern =%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.appender.R = org.apache.log4j.RollingFileAppender log4j.appender.R.File = my_log.log log4j.appender.R.MaxFileSize = 100KB with this configuration, I see my logging statements from java code are getting into the log file but not any errors from camel (routing process). I am getting some errors in camel routing process,these errors also should go into the log file. how can we do that. Thanks. -- View this message in context: http://old.nabble.com/camel-route--logging-tp28548848p28550639.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus -- View this message in context: http://old.nabble.com/camel-route--logging-tp28548848p28559038.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
Re: Camel XSLT, how to pass a Map param to XSL
Hi Claus, Actually I looked into that doc on XSLT and also browsed google, but was not able to find the way. From the doc, and based on the experiments i did, looks like we can set only constant within constant/constant under setParameter (i guess lives more life than header) or setHeader element. Although i changed the approach, rather then reading the properties file (the purpose of which in this case is to hold Mapping), to this one: 1. in camel context: call camel:to uri=xslt:transfomer.xsl/ 2. then later in the transformer.xsl file, load the mapping.xml (XML file now instead of properties file) xsl:variable name=mapping-file select='mapping.xml'/ xsl:variable name=locations-mapping select=document($mapping-file)/LocationsMappings / so then wherever I want the translation of location code, xsl:variable name=locTranslated xsl:call-template name=location-mapping xsl:with-param name=locAbbr select=$loc / /xsl:call-template /xsl:variable and have the template defined in the xsl itself: xsl:template name=location-mapping xsl:param name=locAbbr / xsl:for-each select=$locations-mapping/Mapping/Location xsl:if test=@name = $locAbbr xsl:value-of select=./ /xsl:if /xsl:for-each /xsl:template 3. mapping.xml: LocationsMappings Mapping Location name=ILIllinois/Location Location name=NYNew York/Location /Mapping /LocationsMappings Boom, right on target, solves the issue. I'm not sure if above is the neat solution or if there could be other choice like loading from DB or anyother. Any way I'll keep trying. Thanks for your time. Vikas Claus Ibsen-2 wrote: Hi Have you checked the Camel documentation? http://camel.apache.org/xslt.html There is a section titled - Getting Parameters into the XSLT to work with On Thu, May 13, 2010 at 6:57 PM, Vikas Kumar Arora vikas_kumar...@yahoo.com wrote: Hi, Is there a way to pass Map as a param to XSLT component? Camel 1.6.2 (As we run on Jdk1.4, no other choice) Requirement: I've location maps(Properties file) M1, M2 etc from Partners P1, P2. And before forwarding the request to WS, I have to apply the XSL Transforamtion to convert P1, P2 etc format to our WS format. But in this process I've to apply Location Code transformation as well. xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:ws=http://ws.xx.com; xmlns:spml=urn:oasis:names:tc:SPML:2:0 xmlns:udc=urn:x:enterprise:domain:identity:1.0 xmlns:xalan=http://xml.apache.org/xalan; xmlns:map=java:java.util.Map exclude-result-prefixes=xalan spml ws soapenv version=2.0 xsl:output method=xml omit-xml-declaration=yes/ !--xsl:param name=title/-- xsl:param name=map/ xsl:template match=@* | node() xsl:copy xsl:apply-templates select=@* | node() / /xsl:copy /xsl:template xsl:template match=udc:UDCIdentity !--xsl:value-of select=$title/-- xsl:value-of select=map:get($map, 'locationCode')/ xsl:copy xsl:apply-templates select=@* | node() / /xsl:copy /xsl:template /xsl:stylesheet Sample Camel Config that I'm experimenting for now: camel:route camel:from uri=jetty:http://localhost:8081/AuthN/esb/ camel:setHeader headerName=myParam1camel:constant1/camel:constant/camel:setHeader camel:setHeader headerName=myParam2camel:constant2/camel:constant/camel:setHeader camel:setHeader headerName=myParam3camel:constant3/camel:constant/camel:setHeader camel:setHeader headerName=myParam4camel:constant4/camel:constant/camel:setHeader camel:setProperty propertyName=routeId camel:header1/camel:header /camel:setProperty camel:to uri=xslt:transfomer.xsl/ camel:to uri=bean:someBean/ camel:to uri=http://login.dev2..edu/AuthN/services/Service/ !-- camel:filter camel:mvelrequest.headers.foo == 'bar'/camel:mvel camel:to
Re: Embedded ActiveMQ error (Unable to validate using XSD)
Can I have a look at your broker configure ? BTW, you didn't mention the JDK, ActiveMQ, and Spring version. Finally, I don't think it relates to Camel :) Willem lekkie wrote: Hi guys, I am trying to run an embedded activemq in my web application using eclipse. I am certain I have all the right jars and versions as well, the error below keep coming up: org.springframework.beans.factory.BeanDefinitionStoreException: Parser configuration exception parsing XML from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is javax.xml.parsers.ParserConfigurationException: Unable to validate using XSD: Your JAXP provider [org.apache.xerces.jaxp.documentbuilderfactoryi...@7b37df] does not support XML Schema. Are you running on Java 1.4 with Apache Crimson? Upgrade to Apache Xerces (or Java 1.5) for full XSD support. at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:404) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) However, if I start d same web application from tomcat windows service, I get the following error: 11:55:53,266 INFO DefaultListableBeanFactory:421 - Destroying singletons in org.springframework.beans.factory.support.defaultlistablebeanfact...@2006a0: defining beans [incomingSMSListener,jmsExceptionListener,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.scheduling.annotation.internalAsyncAnnotationProcessor,org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor,threadPoolExecutor,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,broker,redeliveryPolicy,jmsFactory,cachingConnectionFactory,transactionManager,outgoingSMSQueueJmsTemplate,IncomingSMSListe ne r]; root of factory hierarchy 11:55:53,266 DEBUG DisposableBeanAdapter:172 - Invoking destroy() on bean with name 'org.springframework.scheduling.annotation.internalScheduledAnnotationProcessor' 11:55:53,266 ERROR ContextLoader:219 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'broker' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 31 in XML document from ServletContext resource [/WEB-INF/activemq-broker.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'broker'. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:545) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:272) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:196) Kindly help out!
Re: Dynamically removing routes
Hi, I just committed a quick fix for CAMEL-2722, now if you don't want to use route any more , you can use CamelContext.shutdownRoute(routeId) to shutdown the route, Camel will remove the ManagedRoute from the MBServer for you. Willem Willem Jiang wrote: Hi, I just check the code of DefaultManagementLifecycleStrategy[1], the managedRoute is not unregister itself when the onRoutesRemove() is called. I guess it just want to avoid to do the duplicate work when the whole CamelContext is shutdown. You can see that from the comments. But for you case, we should let the ManagedRoute unregister itself. I just create a JIRA[2] for it. [1]https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java [2]https://issues.apache.org/activemq/browse/CAMEL-2722 Willem kumaap0 wrote: Hi I'm running Camel 2.2.0 I've got my application running and im trying to dynamically remove a route, i have exposed the below method via JMX public void removeRoute(String name) throws Exception { if (springCamelContext.getRouteDefinition(name) != null) { springCamelContext.stopRoute(name); logger.info(route +name +removed +springCamelContext.removeRouteDefinition(name)); } else{ logger.error(trying to remove route that doesn't exist); } } The method looks like it worked the route has stopped and if i run this method again with the same name i get the logged error trying to remove route that doesn't exist which i expect. But when i use JConsole i can still see my route and also i can click and start it again. Is is normal ? Cheers kumaap0