camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-6967) Problem with trunking idempotent filestore when parent directory not exists
Date Mon, 18 Nov 2013 10:49:24 GMT

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

Claus Ibsen resolved CAMEL-6967.
--------------------------------

    Resolution: Fixed

> 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)

Mime
View raw message