axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim McConnell <tim.mcco...@gmail.com>
Subject Re: [jira] Created: (AXIS2-4072) URLClassloader locking jarfiles on Windows
Date Tue, 07 Oct 2008 03:42:22 GMT
Hi Axis2 community, I actually have a couple patches ready that can be used to 
address this JIRA, but if possible would request a little direction/advise first. 
The two patches are as described:

1. This patch is very small and contained in the 
org.apache.axis2.deployment.util.Utils class. It essentially checks to determine 
if the Context ClassLoader can be used in the getClassLoader method instead of 
allocating a new URLClassLoader. This works great for this specific failing 
scenario and as best as I can tell does not adversely impact other deployment 
scenarios (e.g., hot deployment). It would be even better though if I could 
determine if Axis2 is running in a container-managed environment (e.g., Geronimo) 
but it's not obvious to me how to do so since the Constants.CONTAINER_MANAGED 
variable is no longer set for the ConfigurationContext, as it was in previous 
versions of Axis2. Would someone be able to recommend a tactic I can use to 
determine this ??

2. The second patch essentially swaps the usage of URLClassLoader in the 
org.apache.axis2.deployment.util.Utils.getClassLoader() method with a variant of 
Geronimo's JarFileClassLoader, which extends the URLClassLoader to properly close 
JarFiles when the classloader is destroyed so that the file read lock will be 
released and the jar file can be modified or deleted. This also works great for 
this specific failing scenario but the patch is much larger since new classes are 
added for the JarFileClassLoader implementation plus the existing 
MultiParentClassLoader in Axis2 is enhanced as well.

My plan is attached the first patch tomorrow and ask that it be reviewed since it 
seems to me that it might be a viable solution with little risk, but my knowledge 
of Axis2 is very limited. Does this seem like a reasonable approach ?? Thanks much.


Tim McConnell (JIRA) wrote:
> URLClassloader locking jarfiles on Windows 
> -------------------------------------------
> 
>                  Key: AXIS2-4072
>                  URL: https://issues.apache.org/jira/browse/AXIS2-4072
>              Project: Axis 2.0 (Axis2)
>           Issue Type: Bug
>     Affects Versions: 1.4.1
>          Environment: Windows XP, Geronimo 2.1.3
>             Reporter: Tim McConnell
> 
> 
> There is at least one scenario using Axis2 and Geronimo that is causing jarfiles to get
locked on Windows such that a deployed WAR cannot be either redeployed or uninstalled. Here
is a brief description of the failing scenario:
> 
> 1. A WAR file containing various jarfiles in the /lib directory is deployed on Geronimo
2.1.3
> 2. Navigate to the deployed app's address to generate the WSDL for the web service
> 3. Redeploy or uninstall of the WAR will now fail since all the jarfiles in the WAR /lib
directory are locked by Windows and cannot be deleted.
> 
> What appears to be happening is that there are three Axis2 URLClassLoaders in this scenario
and at least two of them are creating their own ClassPath and URLClassPath$JarLoader objects
that apparently are locking the jarfiles in the /lib directory. 
> 

-- 
Thanks,
Tim McConnell

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Mime
View raw message