简体   繁体   English

Apache Camel FOP组件配置文件位置

[英]Apache Camel FOP component config file location

I'd like to configure Apache Camel FOP component to use configuration file (as described here ). 我想配置Apache骆驼FOP组件使用的配置文件(如描述在这里 )。 It seems Camel is looking for the file in server base path, because I got exception: 似乎Camel正在服务器基本路径中寻找文件,因为我遇到了异常:

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. 我想要的是将配置文件路径与其他配置文件一起存储在classpath中。

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 我正在使用2.10.3版的Apache Camel

Thanks in advance 提前致谢

我记录了改进骆驼的票证,因此可以从类路径和其他方式加载useConfigURL选项: https ://issues.apache.org/jira/browse/CAMEL-6103

Camel supports only endpoints configured with a starting directory. Camel仅支持配置了起始目录的端点。 So the directoryName must be a directory. 因此,directoryName必须是目录。

Reference 参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM