Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-3741

pls correct the example camel-cxf-osgi and camel-cxf-blueprint due to CAMEL-6748

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • jboss-fuse-6.3
    • jboss-fuse-6.2
    • Camel
    • 6.3 Sprint 2 (1-Feb - 26-Feb)

      When run these two projects, the below info printed:

      [ - WireTap] GenericFileProducer            WARN  Simple expression: request-${date:now:yyyy-MM-dd-HHmmssSSS} detected in header: CamelFileName of type String. This feature has been removed (see CAMEL-6748).
      

      especially in windows env, the below exception thrown.

      Stacktrace
      ---------------------------------------------------------------------------------------------------------------------------------------
      org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: target\inbox\request-${date:now:yyyy-MM-dd-HHmmssSSS}
      	at org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:290)
      	at org.apache.camel.component.file.GenericFileProducer.writeFile(GenericFileProducer.java:277)
      	at org.apache.camel.component.file.GenericFileProducer.processExchange(GenericFileProducer.java:165)
      	at org.apache.camel.component.file.GenericFileProducer.process(GenericFileProducer.java:79)
      	at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:448)
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
      	at org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:119)
      	at org.apache.camel.processor.WireTapProcessor$1.call(WireTapProcessor.java:113)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.io.FileNotFoundException: target\inbox\request-${date:now:yyyy-MM-dd-HHmmssSSS} (The filename, directory name, or volume label syntax is incorrect)
      	at java.io.FileOutputStream.open0(Native Method)
      	at java.io.FileOutputStream.open(FileOutputStream.java:270)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
      	at java.io.FileOutputStream.<init>(FileOutputStream.java:162)
      	at org.apache.camel.component.file.FileOperations.prepareOutputFileChannel(FileOperations.java:451)
      	at org.apache.camel.component.file.FileOperations.writeFileByStream(FileOperations.java:390)
      	at org.apache.camel.component.file.FileOperations.storeFile(FileOperations.java:274)
      	... 14 more
      

      This is a security bug to fix the flaw to set header evaluation.
      you can check it in: https://issues.apache.org/jira/browse/CAMEL-6748 CVE-2013-4330: Skipping Header Evaluation

      So in the code, can achieve the goal through other ways like:

              final String now = new SimpleDateFormat("yyyyMMdd").format(new Date()); 
             setHeader(Exchange.FILE_NAME, constant("request-" + now + ".txt"))
      

            trohovsky Tomas Rohovsky (Inactive)
            rhn-support-xiwu Xiaohui Wu
            Viliam Kasala Viliam Kasala
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: