You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/11/18 11:49:23 UTC

[jira] [Updated] (CAMEL-6967) Problem with trunking idempotent filestore when parent directory not exists

     [ https://issues.apache.org/jira/browse/CAMEL-6967?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-6967:
-------------------------------

         Priority: Minor  (was: Major)
    Fix Version/s: 2.13.0
                   2.12.2
                   2.11.3

> Problem with trunking idempotent filestore when parent directory not exists
> ---------------------------------------------------------------------------
>
>                 Key: CAMEL-6967
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6967
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.12.1
>         Environment: windows 7
>            Reporter: Andrzej Gdula
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.11.3, 2.12.2, 2.13.0
>
>
> I've tried to test some route with JUnit test declared like below
> {code}
> @RunWith(CamelSpringJUnit4ClassRunner.class)
> @ContextConfiguration(classes = CoreRouterConfiguration.class, loader = CamelSpringDelegatingTestContextLoader.class)
> @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD)
> public class RouteTestBase {
>     @Produce
>     protected ProducerTemplate producerTemplate;
>     @Autowired
>     protected ModelCamelContext context;
> }
> {code}
> Camel context starts and then it's beeing shutdown. It there's a FileIdempotentRepository with nonexisting path then camel contexf fails to shutdown with exception
> {code}
> Caused by: java.io.FileNotFoundException: .\TempData\meta\mrdf-idempotent.dat (The system cannot find the path specified)
> 	at java.io.FileOutputStream.open(Native Method) ~[na:1.7.0_40]
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:221) ~[na:1.7.0_40]
> 	at java.io.FileOutputStream.<init>(FileOutputStream.java:171) ~[na:1.7.0_40]
> 	at org.apache.camel.processor.idempotent.FileIdempotentRepository.trunkStore(FileIdempotentRepository.java:256) ~[camel-core-2.12.1.jar:2.12.1]
> 	... 50 common frames omitted
> {code}
> I guess it could be fixed like in a workaround below
> {code}
> public class FileIdempotentRepositoryEx extends FileIdempotentRepository {
>    @Override
>     protected void trunkStore() {
>         if(getFileStore().exists()){
>             super.trunkStore();
>         }
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)