Apache tomcat のシステム サービスを使用してネットワーク ドライブにファイルを保存する必要があり、常にエラーが発生します。
Exception: org.apache.camel.component.file.GenericFileOperationFailedException: Cannot store file: u:\xxx.txt
私のルートサンプル:
<route id="myRoute">
<from uri="quartz:myQuartz?cron=0+0+*+?+*+MON-FRI"/>
<camel:doTry>
<bean method="getData" ref="myService"/>
<marshal ref="bindyFixedDataformat"/>
<to uri="file:u:?fileName=xxx.txt&autoCreate=false&fileExist=Append"/>
<to uri="file://c:/XXX/files?fileName=xxx-${date:now:yyyyMMdd}.txt"/>
<camel:bean method="setProcessed" ref="myService"/>
<camel:doCatch>
<exception>java.io.IOException</exception>
<camel:log message="Network drive (U:) is not available, please renew connection!" loggingLevel="ERROR"/>
<camel:bean method="setFailed" ref="myService"/>
</camel:doCatch>
<camel:doCatch>
<exception>java.lang.Exception</exception>
<camel:log message="Unexpected error has occured!" loggingLevel="ERROR" />
<camel:bean method="setFailed" ref="myService"/>
</camel:doCatch>
</camel:doTry>
</route>
「U」ディスクは、マップされたネットワーク ディスクです。しかし、2 番目のパーティション ディスク 'D' ファイルを使用した同じルートで、正常に作成されます。
WAR ファイルを生成して、Apache Tomcat の Local System Service で実行します。
興味深いことに、サービスの前に、Maven による Eclipse で同じプロジェクトを実行すると、U ディスクへのコピーが正常に行われました。