camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tamil13 <tamilvanan...@gmail.com>
Subject Transfer files from ftp to local directory
Date Thu, 22 Nov 2012 14:03:54 GMT
Hi. I need to make one project which include transfer file from ftp to local
directory .  I tried following code 

	public static void main(String[] args) throws Exception{
		CamelContext context = new DefaultCamelContext();
		context.addRoutes(new RouteBuilder() {
		public void configure() {
				from("ftp://192.168.2.46/workin?noop=true").to("file:outbox");

	}
		});
		context.start();
		Thread.sleep(10000);
		context.stop();
		}

I received following exceptions 

250 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel
2.8.1 (CamelContext: camel-1) is starting
250 [main] INFO org.apache.camel.impl.DefaultCamelContext - JMX enabled.
Using ManagedManagementStrategy.
328 [main] WARN org.apache.camel.impl.DefaultCamelContext - Cannot find
needed classes for JMX lifecycle strategy. Needed class is in
spring-context.jar using Spring 2.5 or newer (spring-jmx.jar using Spring
2.0.x). NoClassDefFoundError:
org/springframework/jmx/export/metadata/JmxAttributeSource
328 [main] WARN org.apache.camel.impl.DefaultCamelContext - Cannot use JMX.
Fallback to using DefaultManagementStrategy (non JMX).
344 [main] INFO
org.apache.camel.impl.converter.AnnotationTypeConverterLoader - Found 3
packages with 15 @Converter classes to load
422 [main] INFO org.apache.camel.impl.converter.DefaultTypeConverter -
Loaded 154 core type converters (total 154 type converters)
422 [main] INFO org.apache.camel.impl.converter.DefaultTypeConverter -
Loaded additional 0 type converters (total 154 type converters) in 0.000
seconds
437 [main] WARN org.apache.camel.util.ObjectHelper - Cannot find class:
org.apache.camel.component.file.remote.FtpComponent
437 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel
2.8.1 (CamelContext:camel-1) is shutting down
437 [main] INFO org.apache.camel.impl.DefaultShutdownStrategy - Starting to
graceful shutdown 0 routes (timeout 300 seconds)
453 [main] INFO org.apache.camel.impl.DefaultShutdownStrategy - Graceful
shutdown of 0 routes completed in 0 seconds
453 [main] INFO org.apache.camel.impl.DefaultInflightRepository - Shutting
down with no inflight exchanges.
453 [main] INFO org.apache.camel.impl.DefaultCamelContext - Uptime: 0.203
seconds
453 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache Camel
2.8.1 (CamelContext: camel-1) is shutdown in 0.016 seconds
Exception in thread "main" org.apache.camel.FailedToCreateRouteException:
Failed to create route route1:
Route[[From[ftp://localhost/workin?noop=true]] -> [Idempoten... because of
Failed to resolve endpoint: ftp://localhost/workin?noop=true due to: Cannot
auto create component: ftp
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:170)
	at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:697)
	at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1651)
	at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1440)
	at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1338)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
	at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1316)
	at FTP.main(FTP.java:27)
Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to
resolve endpoint: ftp://localhost/workin?noop=true due to: Cannot auto
create component: ftp
	at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:443)
	at
org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:48)
	at
org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:180)
	at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:110)
	at
org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116)
	at
org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72)
	at
org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88)
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:772)
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:165)
	... 8 more
Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create
component: ftp
	at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:301)
	at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:420)
	... 16 more
Caused by: java.lang.IllegalArgumentException: Invalid URI, no Component
registered for scheme: ftp
	at
org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:79)
	at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:292)
	... 17 more
Caused by: java.lang.ClassNotFoundException:
org.apache.camel.component.file.remote.FtpComponent
	at
org.apache.camel.impl.DefaultFactoryFinder.newInstance(DefaultFactoryFinder.java:124)
	at
org.apache.camel.impl.DefaultFactoryFinder.findClass(DefaultFactoryFinder.java:77)
	at
org.apache.camel.impl.DefaultFactoryFinder.findClass(DefaultFactoryFinder.java:69)
	at
org.apache.camel.impl.DefaultComponentResolver.findComponent(DefaultComponentResolver.java:98)
	at
org.apache.camel.impl.DefaultComponentResolver.resolveComponent(DefaultComponentResolver.java:71)
	... 18 more




--
View this message in context: http://camel.465427.n5.nabble.com/Transfer-files-from-ftp-to-local-directory-tp5723118.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message