URLClassLoader locks the contrubution jar.
------------------------------------------

                 Key: TUSCANY-3939
                 URL: https://issues.apache.org/jira/browse/TUSCANY-3939
             Project: Tuscany
          Issue Type: Bug
          Components: Java SCA Assembly Model
    Affects Versions: Java-SCA-2.0-Beta1
         Environment: All
            Reporter: Hasan Muhammad
            Priority: Critical
             Fix For: Java-SCA-2.0


When a contribution is started, tuscany 2.0 uses URLClassLoader to load the 
classes/resources from the contribution. It locks the jar file and does not 
release the lock even on contribution stop. This is not a bug in tuscany code. 
This is a problem with Sun's URLClassLoader. Sun has a fix for this that is 
planned for Java 1.7. But for now, during contribution stop, the following 
method could be used without any issues, to release the classloader and all the 
resources it holds

ClassLoaderUtil.releaseLoader((URLClassLoader)context.getApplicationClassLoader().getParent());

Note that this method needs to be called on all Unused Contributions in the 
node, so that those contributions are also unlocked. The list of unused 
contributions already exists in the node since we have the following method

node.stopCompositeAndUninstallUnused

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to