users@jaxb.java.net

Re: Out of sync issue with JAXB

From: AudreyK <craukette_at_gmail.com>
Date: Fri, 3 Jul 2009 08:58:35 -0700 (PDT)

Yes, it was indeed a problem of open FileOutputStream. Once the
FileOutputStream is closed, the refreshLocal() method works well.
Thank you for your help !
Audrey


Martin Grebac wrote:
>
> As Lexi mentioned, this is not JAXB issue. Please refer to Eclipse
> mailing lists for help. However, I encountered similar issue while
> implementing Metro plugin for Eclipse. Eclipse doesn't refresh local
> files automatically (it's possible to set it in workspace preferences
> though). Calling eclipse's .refreshLocal() method on your file/resource
> instance solves the problem, but only if you call it after all opened
> streams are closed. E.g. my error was caused by overlooking this line:
>
> resource.save(new FileOutputStream(f), Collections.EMPTY_MAP);
>
> and thus not closing the stream properly.
>
> MartiNG
>
>
> Aleksei Valikov wrote:
>> Hi,
>>
>>
>>> I am writing an Eclipse plugin that creates a project in the Workspace,
>>> and I
>>> have to access to some files contained is this project. Especially, I
>>> have
>>> to read an XML file, do some stuff, and then update this file. I use
>>> JAXB
>>> 2.0 for this.
>>> Everything works fine, excepted that when I try to open my modified XML
>>> file
>>> within Eclipse, an "Resource is out of sync with the file system"
>>> exception
>>> occures. The only way to avoid this problem is to refresh the Workspace
>>> using F5, but I really need to do this programatically (because I don't
>>> want
>>> the plugin's users to hit F5 each time the file has to be synchronized
>>> !!).
>>>
>>
>> I thinks it's more Eclipse issue than JAXB issue. I think you'd have
>> the same effects if you modify the file in any other way.
>>
>> Bye.
>> /lexi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
> --
> Martin Grebac, http://blogs.sun.com/mgrebac
>
> Web Technologies & Standards
> Sun Microsystems Czech
>
> ICQ: 93478885
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/Out-of-sync-issue-with-JAXB-tp24292429p24325317.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.