0

I'd like to configure Apache Camel FOP component to use configuration file (as described here). It seems Camel is looking for the file in server base path, because I got exception:

Caused by: java.io.FileNotFoundException: C:\Users\user\Eclipse\eclipse\src\main\webapp\WEB-INF\fop.xml

What I want is to store configuration file path in classpath along with other configuration files.

Here is Camel route:

from("direct:renderer").routeId("direct:renderer")
        .onException(Exception.class)
            // Exception handling
        .end()

        // I want fop.xml config file to be looked for in classpath
        .to("fop:application/pdf?userConfigURL=src/main/webapp/WEB-INF/fop.xml") 
        .setHeader("CamelFileName", simple("${property.job.id}.pdf"))
        .to("file:eiocha/pdf")

I'm using Apache Camel of version 2.10.3

Thanks in advance

nikagra
  • 835
  • 2
  • 9
  • 23

2 Answers2

1

I logged a ticket to improve camel-fop, so the useConfigURL option can be loaded from classpath and whatnot: https://issues.apache.org/jira/browse/CAMEL-6103

Claus Ibsen
  • 56,060
  • 7
  • 50
  • 65
0

Camel supports only endpoints configured with a starting directory. So the directoryName must be a directory.

Reference

Community
  • 1
  • 1
TheWhiteRabbit
  • 15,480
  • 4
  • 33
  • 57
  • In my case `eiocha/pdf` is a directory. File name is set using `CamelFileName` header. Do I understand you correctly? – nikagra Feb 26 '13 at 11:04
  • The problem is not with file component, it works. Even fop component works nice without `userConfigURL` option – nikagra Feb 26 '13 at 11:25