Bonjour,

Mon Programme ne fonctionne plus je ne comprend pas pourquoi

Voici ce que j'ai :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
    @Test
    public void testTestCamel() {
          CamelContext context = new DefaultCamelContext();
          context.setLazyLoadTypeConverters(Boolean.TRUE); 
          try {
                context.addRoutes( new RouteBuilder() {
                      public void configure() {
                    	   System.out.println(RoutingFile.class);
                           from("file:///D:/fileCamel/in?noop=true")
                           .bean(RoutingFile.class,"routingFileBean");
                           };                           
                      });
 
                context.start();
                Thread.sleep(10000);
                context.stop();
 
          } catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
          }        
    }
Et dans mon bean routingFileBean je voudrais simplement récupérer le nom du fichier.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
public class RoutingFile {
 
	private static Logger log = Logger.getLogger(RoutingFile.class);
 
	public static void routingFileBean(Exchange exchange){
		System.out.println("IN routingFileBean ");
		File file =  (File) exchange.getIn().getBody(File.class);
		try {
			System.out.println(file.getCanonicalPath());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(file.getAbsolutePath());
	}
}
Mon logger m'affiche ce message d'erreur :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
INFO  30-08 16:32:27,519 (DefaultCamelContext.java:start:1185)  -Apache Camel 2.5.0 (CamelContext: camel-1) is starting
INFO  30-08 16:32:27,524 (DefaultCamelContext.java:createManagementStrategy:2139)  -JMX enabled. Using ManagedManagementStrategy.
WARN  30-08 16:32:27,534 (DefaultCamelContext.java:createManagementStrategy:2146)  -Could not 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
WARN  30-08 16:32:27,534 (DefaultCamelContext.java:createManagementStrategy:2156)  -Cannot use JMX. Fallback to using DefaultManagementStrategy (non JMX).
INFO  30-08 16:32:27,657 (AnnotationTypeConverterLoader.java:findPackages:105)  -Loading file META-INF/services/org/apache/camel/TypeConverter to retrieve list of packages, from url: jar:file:/D:/.m2/repository/org/apache/camel/camel-core/2.5.0/camel-core-2.5.0.jar!/META-INF/services/org/apache/camel/TypeConverter
INFO  30-08 16:32:28,262 (AnnotationTypeConverterLoader.java:load:66)  -Found 3 packages with 13 @Converter classes to load
INFO  30-08 16:32:28,314 (BaseTypeConverterRegistry.java:loadTypeConverters:407)  -Loaded 146 type converters in 0.656 seconds
INFO  30-08 16:32:28,431 (FileEndpoint.java:createConsumer:81)  -Endpoint is configured with noop=true so forcing endpoint to be idempotent as well
INFO  30-08 16:32:28,432 (FileEndpoint.java:createConsumer:87)  -Using default memory based idempotent repository with cache max size: 1000
INFO  30-08 16:32:28,442 (DefaultCamelContext.java:doStartOrResumeRouteConsumers:1751)  -Route: route1 started and consuming from: Endpoint[file:///D:/fileCamel/in?noop=true]
INFO  30-08 16:32:28,442 (DefaultCamelContext.java:start:1202)  -Total 1 routes, of which 1 is started.
INFO  30-08 16:32:28,443 (DefaultCamelContext.java:start:1203)  -Apache Camel 2.5.0 (CamelContext: camel-1) started in 0.928 seconds
INFO  30-08 16:32:38,445 (DefaultCamelContext.java:doStop:1321)  -Apache Camel 2.5.0 (CamelContext:camel-1) is shutting down
INFO  30-08 16:32:38,446 (DefaultShutdownStrategy.java:doShutdown:114)  -Starting to graceful shutdown 1 routes (timeout 300 seconds)
INFO  30-08 16:32:38,452 (DefaultShutdownStrategy.java:run:383)  -Route: route1 suspended and shutdown deferred, was consuming from: Endpoint[file:///D:/fileCamel/in?noop=true]
INFO  30-08 16:32:38,453 (DefaultShutdownStrategy.java:run:442)  -Route: route1 shutdown complete.
INFO  30-08 16:32:38,455 (DefaultShutdownStrategy.java:doShutdown:146)  -Graceful shutdown of 1 routes completed in 0 seconds
INFO  30-08 16:32:38,456 (DefaultInflightRepository.java:doStop:93)  -Shutting down with no inflight exchanges.
INFO  30-08 16:32:38,458 (DefaultCamelContext.java:doStop:1374)  -Uptime: 10.944 seconds
INFO  30-08 16:32:38,458 (DefaultCamelContext.java:doStop:1375)  -Apache Camel 2.5.0 (CamelContext: camel-1) is shutdown in 0.013 seconds
Une histoire de JMX apriori, je ne comprend plus , pourtant j'ai codé d'autre bean ca marché trés bien.

Il ne rentre même plus dans les beans , les routes indiqués.

Si quelqu'un aurait une idée ca serait sympa !!

Merciiiiiiiii