You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Hasan Muhammad (JIRA)" <de...@tuscany.apache.org> on 2011/09/06 17:58:10 UTC

[jira] [Created] (TUSCANY-3939) URLClassLoader locks the contrubution jar.

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

        

[jira] [Commented] (TUSCANY-3939) URLClassLoader locks the contrubution jar.

Posted by "ant elder (JIRA)" <de...@tuscany.apache.org>.
    [ https://issues.apache.org/jira/browse/TUSCANY-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13098870#comment-13098870 ] 

ant elder commented on TUSCANY-3939:
------------------------------------

I've added some code that uses the ClassLoaderUtil.releaseLoader method to free the contribution jar when a contribution is unloaded. This happens in the ContributionListener which will only work if the domain registry impl supports the ContributionListener function, does that work in your environment? If not then we could look at adding it to somewhere to the stop processing path but this current place looks simpler if it does work ok.

> 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
>            Assignee: ant elder
>            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

        

[jira] [Assigned] (TUSCANY-3939) URLClassLoader locks the contrubution jar.

Posted by "ant elder (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

ant elder reassigned TUSCANY-3939:
----------------------------------

    Assignee: ant elder

> 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
>            Assignee: ant elder
>            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

        

[jira] [Closed] (TUSCANY-3939) URLClassLoader locks the contrubution jar.

Posted by "Hasan Muhammad (Closed) (JIRA)" <de...@tuscany.apache.org>.
     [ https://issues.apache.org/jira/browse/TUSCANY-3939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hasan Muhammad closed TUSCANY-3939.
-----------------------------------

    Resolution: Fixed
    
> 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
>            Assignee: ant elder
>            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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira