Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 544 invoked from network); 16 Jul 2009 07:59:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Jul 2009 07:59:12 -0000 Received: (qmail 7392 invoked by uid 500); 16 Jul 2009 08:00:17 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 7313 invoked by uid 500); 16 Jul 2009 08:00:17 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 7300 invoked by uid 99); 16 Jul 2009 08:00:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2009 08:00:17 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of carlo.camerino@gmail.com designates 209.85.222.181 as permitted sender) Received: from [209.85.222.181] (HELO mail-pz0-f181.google.com) (209.85.222.181) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Jul 2009 08:00:04 +0000 Received: by pzk11 with SMTP id 11so2188069pzk.30 for ; Thu, 16 Jul 2009 00:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to :content-type; bh=xn0st5PMwJcYCXwlQ42dxAS7z6peG8y3PyanG6DjopA=; b=fP3KosP1yhsNbcxua1Mdg8PVu2eUEcFwCVdsjEJPhG1r4cC8V9uVr3Mzubdr+uSZeb YWSvwkjiIUm4oCyY2K3LvWI34RMbZ7d3MAOBSzt8fdxqxWDl///HCLcjno8nhfvrZpy4 jWOoCHHzm21kDVBaH8gB4hsjBy09GXR7P/pPo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=kdyDOIO3BG37WTrvak3Fz0p0WgplhppX8QzNuehP94UOGQuoJ9LxHu5qJdUGq8wt9L MTE4sABOFbx2pw98GzWBmYVgBe8D/BCb5XOek9Ay/G4m5uxdfXv/8bzh8rV7d+ceDyco n5qCFiC7kGJkvIrLr0A3C+VYGkaKWQtxS1O90= MIME-Version: 1.0 Sender: carlo.camerino@gmail.com Received: by 10.142.79.12 with SMTP id c12mr2057884wfb.108.1247731182287; Thu, 16 Jul 2009 00:59:42 -0700 (PDT) In-Reply-To: <5380c69c0907160052y767347faw22dc182dbfc5f2fc@mail.gmail.com> References: <3fee29160907152129k2b24157asf8d5bbbf343212ba@mail.gmail.com> <5380c69c0907152202v2ac374aana9a5cb53bb8e83c6@mail.gmail.com> <3fee29160907152326s33871fc6r6ab61072058b5fa2@mail.gmail.com> <3fee29160907152329j300c2802o6cf3dfe1cde8469c@mail.gmail.com> <5380c69c0907152333x7f43d13fkac7575261dc53f9a@mail.gmail.com> <3fee29160907160032o530d9998i15deba475c5614c8@mail.gmail.com> <5380c69c0907160047q508dcae2tc0573551499ea7ee@mail.gmail.com> <3fee29160907160049s697fe91bl6dba732ffacc344d@mail.gmail.com> <5380c69c0907160052y767347faw22dc182dbfc5f2fc@mail.gmail.com> Date: Thu, 16 Jul 2009 15:59:42 +0800 X-Google-Sender-Auth: af33fd44a03d5f27 Message-ID: <3fee29160907160059v35f58c24r6aa0077d4ae7b9e1@mail.gmail.com> Subject: Re: File Component Changes In Camel 2.0-M2 From: Carlo Camerino To: users@camel.apache.org Content-Type: multipart/alternative; boundary=001636e0b39ce53bdf046ece0dcd X-Virus-Checked: Checked by ClamAV on apache.org --001636e0b39ce53bdf046ece0dcd Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit i removed the annotations but still didn't work. it finally worked when I added a routebuilderref. thanks for the help!!! On Thu, Jul 16, 2009 at 3:52 PM, Claus Ibsen wrote: > Hi > > If you are using some annotations in your route classes then Spring > might not be able to IoC them properly and just ignore these files. > Has been improved in later code, eg 2.0m3 or SNAPSHOT. > > So try not having annotations in them. > > And you can also use a to refer to the route class > directly without the classpath scanner. > > > On Thu, Jul 16, 2009 at 9:49 AM, Carlo Camerino > wrote: > > are my routes being picked up properly? > > > > here is the output of debug log in camel. > > > > INFO - DefaultCamelContext - JMX enabled. Using > > InstrumentationLifecycleStrategy. > > INFO - CamelContextFactoryBean - JMXAgent disabled > > DEBUG - CamelContextFactoryBean - Found JAXB created routes: [] > > DEBUG - ltPackageScanClassResolver - Searching for implementations of > > org.apache.camel.Routes in packages: [com.ccti.carnelian.ufm.routes] > > DEBUG - ltPackageScanClassResolver - Loading from directory: > > > C:\PROJECTS\CHINABANK\cbc-carnelian\carnelian-parent\carnelian-ufm\target\classes\com\ccti\carnelian\ufm\routes > > DEBUG - ltPackageScanClassResolver - Found: [class > > com.ccti.carnelian.ufm.routes.FileRouteBuilder, class > > com.ccti.carnelian.ufm.routes.QueueRouteBuilder] > > Hibernate: update TBL_USER set IS_LOGIN=0 > > DEBUG - SpringCamelContext - Publishing spring-event: > > > org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.web.context.support.XmlWebApplicationContext@1b17d49 > : > > display name [Root WebApplicationContext]; startup date [Thu Jul 16 > 15:46:19 > > SGT 2009]; root of context hierarchy] > > DEBUG - SpringCamelContext - Starting the CamelContext now that > the > > ApplicationContext has started > > INFO - DefaultCamelContext - Apache Camel 2.0-M2 > > (CamelContext:camelContext) is starting > > DEBUG - DefaultProducerServicePool - Starting service pool: > > org.apache.camel.impl.DefaultProducerServicePool@14c0761 > > DEBUG - DefaultCamelContext - StreamCaching is enabled > > DEBUG - DefaultComponent - Creating endpoint > > uri=[spring-event:default], path=[default], parameters=[{}] > > DEBUG - DefaultCamelContext - spring-event:default converted to > > endpoint: Endpoint[spring-event:default] by component: > > org.apache.camel.component.event.EventComponent@1ca32f7 > > DEBUG - DefaultProducerServicePool - Stopping service pool: > > org.apache.camel.impl.DefaultProducerServicePool@14c0761 > > INFO - DefaultCamelContext - Apache Camel 2.0-M2 > > (CamelContext:camelContext) started > > > > i'll paste trace log also > > > > On Thu, Jul 16, 2009 at 3:47 PM, Claus Ibsen > wrote: > > > >> Hi > >> > >> Is there any files to pickup? And Camel will also not read the file if > >> it cannot get a read lock on the file. > >> Maybe the file is locked if you got it open in another program. So > >> safe to drop in a file that you copy from somewhere else. > >> > >> And some user had trouble with MS Office files being locked on Windows. > >> > >> You can also skip this locking by setting readLock=none > >> > >> And enable TRACE logging at org.apache.camel.component.file to see what > it > >> says. > >> > >> > >> > >> On Thu, Jul 16, 2009 at 9:32 AM, Carlo Camerino > >> wrote: > >> > hmm there's no camel locks in there. > >> > i deleted the directoyr, recreated it still doesn't work. > >> > > >> > here's my files > >> > > >> > package com.ccti.carnelian.ufm.routes; > >> > > >> > import java.io.File; > >> > > >> > import org.apache.camel.Exchange; > >> > import org.apache.camel.Processor; > >> > import org.apache.camel.builder.RouteBuilder; > >> > import org.apache.camel.impl.DefaultMessage; > >> > import org.apache.commons.io.FileUtils; > >> > import org.slf4j.Logger; > >> > import org.slf4j.LoggerFactory; > >> > > >> > import com.ccti.base.camel.model.FileModel; > >> > import com.ccti.base.camel.processors.FileWaitProcessor; > >> > import com.ccti.base.dao.syspar.SysParDao; > >> > > >> > public class FileRouteBuilder extends RouteBuilder { > >> > private static final Logger logger = > >> > LoggerFactory.getLogger(FileRouteBuilder.class); > >> > private SysParDao sysParDao; > >> > > >> > @Override > >> > public void configure() throws Exception { > >> > from("file:" + "c:/ufm/upload/" ).process(new > >> > FileWaitProcessor()).process(new Processor() { > >> > > >> > public void process(Exchange exchange) throws Exception > { > >> > try { > >> > FileModel fileModel = new FileModel(); > >> > logExchangeDetails(exchange); > >> > // kailangan ko ipa write ito sa isang > directory > >> > logger.debug("Making A copy Of File In > Processed > >> > Directory."); > >> > String processedDirectory = > >> > sysParDao.findValueByCd("USR082"); > >> > String inputDirectory = > >> > sysParDao.findValueByCd("USR081"); > >> > FileUtils.copyFile(new File(inputDirectory + > >> > exchange.getIn().getHeader("org.apache.camel.file.name")), new > >> > File(processedDirectory + exchange.getIn().getHeader(" > >> > org.apache.camel.file.name") + "-USED")); > >> > DefaultMessage defaultMessage = new > >> > DefaultMessage(); > >> > fileModel.setFileName(processedDirectory + > >> > exchange.getIn().getHeader("org.apache.camel.file.name").toString() + > >> > "-USED"); > >> > > >> fileModel.setCoverName(exchange.getIn().getHeader(" > >> > org.apache.camel.file.name").toString()); > >> > defaultMessage.setBody(fileModel); > >> > exchange.setOut(defaultMessage); > >> > logger.debug("Successfuly Copied File."); > >> > } > >> > catch (Exception e) { > >> > logger.error(e.getMessage()); > >> > e.printStackTrace(); > >> > } > >> > } > >> > > >> > private void logExchangeDetails(Exchange exchange) { > >> > if(logger.isDebugEnabled()) { > >> > logger.debug(exchange.getIn() + ""); > >> > > >> logger.debug(exchange.getIn().getClass().getName()); > >> > logger.debug(exchange.getIn().getHeader(" > >> > org.apache.camel.file.name").toString()); > >> > logger.debug(exchange.getOut() + ""); > >> > } > >> > } > >> > > >> > }).to("direct:processingQueue"); > >> > > >> > } > >> > > >> > public SysParDao getSysParDao() { > >> > return sysParDao; > >> > } > >> > > >> > public void setSysParDao(SysParDao sysParDao) { > >> > this.sysParDao = sysParDao; > >> > } > >> > } > >> > > >> > > >> > >> > xmlns:amq="http://activemq.apache.org/schema/core" > >> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >> > xmlns:jms="http://www.springframework.org/schema/jms" > >> > xmlns:tx="http://www.springframework.org/schema/tx" > >> > xmlns:camel="http://camel.apache.org/schema/spring" > >> > xsi:schemaLocation="http://www.springframework.org/schema/beans > >> > http://www.springframework.org/schema/beans/spring-beans-2.5.xsd > >> > http://activemq.apache.org/schema/core > >> > http://activemq.apache.org/schema/core/activemq-core.xsd > >> > http://www.springframework.org/schema/jms > >> > http://www.springframework.org/schema/jms/spring-jms-2.5.xsd > >> > http://www.springframework.org/schema/tx > >> > http://www.springframework.org/schema/tx/spring-tx-2.5.xsd > >> > http://camel.apache.org/schema/spring > >> > http://camel.apache.org/schema/spring/camel-spring.xsd > >> > "> > >> > > >> > > >> > com.ccti.carnelian.ufm.routes > >> > > >> > > >> > > >> > I will be insvesitigating also. maybe it's just a simple mistake or > >> > something > >> > > >> > On Thu, Jul 16, 2009 at 2:33 PM, Claus Ibsen > >> wrote: > >> > > >> >> On Thu, Jul 16, 2009 at 8:29 AM, Carlo Camerino< > carloc@sxchange.com.ph> > >> >> wrote: > >> >> > it doesn't even enter the filewaitprocessor > >> >> > >> >> Could you take a look into the c:/ufm/upload folder. There could be > >> >> some .camelLock file lurking that blocks it. > >> >> eg you can try removing this folder all together and create a new > empty > >> >> one. > >> >> > >> >> > >> >> > >> >> > > >> >> > On Thu, Jul 16, 2009 at 2:26 PM, Carlo Camerino < > >> carloc@sxchange.com.ph > >> >> >wrote: > >> >> > > >> >> >> Hi, > >> >> >> > >> >> >> Here is my route. > >> >> >> > >> >> >> public void configure() throws Exception { > >> >> >> from("file://" + "c:/ufm/upload/" + > >> >> "?delete=true").process(new > >> >> >> FileWaitProcessor()).process(new Processor() { > >> >> >> > >> >> >> public void process(Exchange exchange) throws > >> Exception > >> >> { > >> >> >> try { > >> >> >> FileModel fileModel = new FileModel(); > >> >> >> logExchangeDetails(exchange); > >> >> >> // kailangan ko ipa write ito sa isang > >> directory > >> >> >> logger.debug("Making A copy Of File In > >> Processed > >> >> >> Directory."); > >> >> >> String processedDirectory = > >> >> >> sysParDao.findValueByCd("USR082"); > >> >> >> String inputDirectory = > >> >> >> sysParDao.findValueByCd("USR081"); > >> >> >> FileUtils.copyFile(new File(inputDirectory > + > >> >> >> exchange.getIn().getHeader("org.apache.camel.file.name")), new > >> >> >> File(processedDirectory + exchange.getIn().getHeader(" > >> >> >> org.apache.camel.file.name") + "-USED")); > >> >> >> DefaultMessage defaultMessage = new > >> >> >> DefaultMessage(); > >> >> >> fileModel.setFileName(processedDirectory + > >> >> >> exchange.getIn().getHeader("org.apache.camel.file.name > ").toString() > >> + > >> >> >> "-USED"); > >> >> >> > >> >> fileModel.setCoverName(exchange.getIn().getHeader(" > >> >> >> org.apache.camel.file.name").toString()); > >> >> >> defaultMessage.setBody(fileModel); > >> >> >> exchange.setOut(defaultMessage); > >> >> >> logger.debug("Successfuly Copied File."); > >> >> >> } > >> >> >> catch (Exception e) { > >> >> >> logger.error(e.getMessage()); > >> >> >> e.printStackTrace(); > >> >> >> } > >> >> >> } > >> >> >> > >> >> >> private void logExchangeDetails(Exchange exchange) > { > >> >> >> if(logger.isDebugEnabled()) { > >> >> >> logger.debug(exchange.getIn() + ""); > >> >> >> > >> >> >> logger.debug(exchange.getIn().getClass().getName()); > >> >> >> logger.debug(exchange.getIn().getHeader(" > >> >> >> org.apache.camel.file.name").toString()); > >> >> >> logger.debug(exchange.getOut() + ""); > >> >> >> } > >> >> >> } > >> >> >> > >> >> >> }).to("direct:processingQueue"); > >> >> >> > >> >> >> Thanks In Advance > >> >> >> > >> >> >> > >> >> >> On Thu, Jul 16, 2009 at 1:02 PM, Claus Ibsen < > claus.ibsen@gmail.com > >> >> >wrote: > >> >> >> > >> >> >>> Hi > >> >> >>> > >> >> >>> On Thu, Jul 16, 2009 at 6:29 AM, Carlo Camerino< > >> >> carlo.camerino@gmail.com> > >> >> >>> wrote: > >> >> >>> > hi, > >> >> >>> > > >> >> >>> > i'm currently using file component in camel 2.0-M2. I'm finding > >> out > >> >> that > >> >> >>> > it's not working properly already unlike in camel 1.6 below. > >> >> >>> > is there any changes that I need to be implemented? > >> >> >>> > > >> >> >>> > The same route that I used for Camel 1.5 is not working for > camel > >> >> 2.0-M2 > >> >> >>> > >> >> >>> Camel 2 have a rewritten file component so some options in 1.5 is > eg > >> >> >>> not the same in 2.0. > >> >> >>> > >> >> >>> > >> >> >>> > > >> >> >>> > It's not getting properly from the directory that I set it to > get > >> >> from. > >> >> >>> > Do I need to change anything? > >> >> >>> > >> >> >>> First you need to post what the problem is. Writing that X does > not > >> >> >>> work is not gonna help to much without > >> >> >>> being more specific. > >> >> >>> > >> >> >>> And also posting your route will help. > >> >> >>> > >> >> >>> > >> >> >>> > > >> >> >>> > Should I use file2 instead? > >> >> >>> > > >> >> >>> > >> >> >>> No there is no file2 as such. Its just the camel documentation > being > >> >> >>> divided into the old and the new (file2). > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> > Carlo > >> >> >>> > > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> -- > >> >> >>> Claus Ibsen > >> >> >>> Apache Camel Committer > >> >> >>> > >> >> >>> Open Source Integration: http://fusesource.com > >> >> >>> Blog: http://davsclaus.blogspot.com/ > >> >> >>> Twitter: http://twitter.com/davsclaus > >> >> >>> > >> >> >> > >> >> >> > >> >> > > >> >> > >> >> > >> >> > >> >> -- > >> >> Claus Ibsen > >> >> Apache Camel Committer > >> >> > >> >> Open Source Integration: http://fusesource.com > >> >> Blog: http://davsclaus.blogspot.com/ > >> >> Twitter: http://twitter.com/davsclaus > >> >> > >> > > >> > >> > >> > >> -- > >> Claus Ibsen > >> Apache Camel Committer > >> > >> Open Source Integration: http://fusesource.com > >> Blog: http://davsclaus.blogspot.com/ > >> Twitter: http://twitter.com/davsclaus > >> > > > > > > -- > Claus Ibsen > Apache Camel Committer > > Open Source Integration: http://fusesource.com > Blog: http://davsclaus.blogspot.com/ > Twitter: http://twitter.com/davsclaus > --001636e0b39ce53bdf046ece0dcd--