On Tue, 2008-07-15 at 09:37 -0600, Michael Heinen wrote:
> After spending many hours with this I found a solution that I do not
> understand.
> 
> I removed following doctype definition from tiles-defs.xml
> 
>  
> 
> <!DOCTYPE tiles-definitions PUBLIC
> 
>        "-//Apache Software Foundation//DTD Tiles Configuration
> 1.1//EN"
> 
>        "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd";>
> 
>  
> 
> Why does this result in locking struts.jar ?

This does make sense.

The usual cause of this "locking" problem is some stupid code inside the
sun jdk. When URL.openAsStream (or some such method, I forget the exact
details) is used to load a resource, then the sun jdk caches a reference
to that resource in order to optimise future accesses to it.

But that means that on Windows the file is "open" so cannot be removed.

The fix really should be in the jdk, but it isn't going to happen.
Instead, the workaround is for all libraries to go around explicitly
disabling caching wherever this is used. And I would guess that *if* an
xml file has a local dtd declared then something is loading that via the
above method, in order to validate the dtd or to detect implicit
attributes etc.

I think there is an issue in the JIRA somewhere to fix the problem in
myfaces code. But of course it needs to be fixed in every lib too. 

Or move to a decent operating system :-).

Please note: above details are only from memory. Exact classes, methods,
etc can be wrong.

Regards,
Simon

> 

Reply via email to