You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@tiles.apache.org by "Eddy Chan (JIRA)" <ji...@apache.org> on 2008/10/25 02:51:37 UTC

[jira] Created: (TILES-324) Cannot call ClassUtil.setContextClassLoader() with SecurityManager

Cannot call ClassUtil.setContextClassLoader() with SecurityManager
------------------------------------------------------------------

                 Key: TILES-324
                 URL: https://issues.apache.org/struts/browse/TILES-324
             Project: Tiles
          Issue Type: Bug
          Components: tiles-core
    Affects Versions: 2.0.6
            Reporter: Eddy Chan


In org.apache.tiles.util.ClassUtil.instantiate(String, boolean), there are two calls to setContextClassLoader for the currentThread.  This causes an issue with a SecurityManager that does not grant the RuntimePermission.  In my situation, since this class is in the webapp, the second call to setContextClassLoader causes an issue, since it is in the finally clause.  Two workarounds:

1) Remove the calls to setContextClassLoader.  (Not sure the necessity here.)
2) Flag whether the first call to setContextClassLoader was originally done, and then conditionally call setContextClassLoader if it was done.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TILES-324) Cannot call ClassUtil.setContextClassLoader() with SecurityManager

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli updated TILES-324:
-----------------------------------

    Priority: Critical  (was: Major)

Changed priority to "critical".

> Cannot call ClassUtil.setContextClassLoader() with SecurityManager
> ------------------------------------------------------------------
>
>                 Key: TILES-324
>                 URL: https://issues.apache.org/struts/browse/TILES-324
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.0.6
>            Reporter: Eddy Chan
>            Priority: Critical
>
> In org.apache.tiles.util.ClassUtil.instantiate(String, boolean), there are two calls to setContextClassLoader for the currentThread.  This causes an issue with a SecurityManager that does not grant the RuntimePermission.  In my situation, since this class is in the webapp, the second call to setContextClassLoader causes an issue, since it is in the finally clause.  Two workarounds:
> 1) Remove the calls to setContextClassLoader.  (Not sure the necessity here.)
> 2) Flag whether the first call to setContextClassLoader was originally done, and then conditionally call setContextClassLoader if it was done.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (TILES-324) Cannot call ClassUtil.setContextClassLoader() with SecurityManager

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli closed TILES-324.
----------------------------------


Closed due to the release of Tiles 2.0.7.

> Cannot call ClassUtil.setContextClassLoader() with SecurityManager
> ------------------------------------------------------------------
>
>                 Key: TILES-324
>                 URL: https://issues.apache.org/struts/browse/TILES-324
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.0.6
>            Reporter: Eddy Chan
>            Assignee: Antonio Petrelli
>            Priority: Critical
>             Fix For: 2.0.7, 2.1.1
>
>
> In org.apache.tiles.util.ClassUtil.instantiate(String, boolean), there are two calls to setContextClassLoader for the currentThread.  This causes an issue with a SecurityManager that does not grant the RuntimePermission.  In my situation, since this class is in the webapp, the second call to setContextClassLoader causes an issue, since it is in the finally clause.  Two workarounds:
> 1) Remove the calls to setContextClassLoader.  (Not sure the necessity here.)
> 2) Flag whether the first call to setContextClassLoader was originally done, and then conditionally call setContextClassLoader if it was done.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (TILES-324) Cannot call ClassUtil.setContextClassLoader() with SecurityManager

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli updated TILES-324:
-----------------------------------

    Assignee: Antonio Petrelli

> Cannot call ClassUtil.setContextClassLoader() with SecurityManager
> ------------------------------------------------------------------
>
>                 Key: TILES-324
>                 URL: https://issues.apache.org/struts/browse/TILES-324
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.0.6
>            Reporter: Eddy Chan
>            Assignee: Antonio Petrelli
>            Priority: Critical
>
> In org.apache.tiles.util.ClassUtil.instantiate(String, boolean), there are two calls to setContextClassLoader for the currentThread.  This causes an issue with a SecurityManager that does not grant the RuntimePermission.  In my situation, since this class is in the webapp, the second call to setContextClassLoader causes an issue, since it is in the finally clause.  Two workarounds:
> 1) Remove the calls to setContextClassLoader.  (Not sure the necessity here.)
> 2) Flag whether the first call to setContextClassLoader was originally done, and then conditionally call setContextClassLoader if it was done.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (TILES-324) Cannot call ClassUtil.setContextClassLoader() with SecurityManager

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/struts/browse/TILES-324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonio Petrelli resolved TILES-324.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1.1
                   2.0.7

Now the second call to setCurrentClassloader is made only if the original was null.

> Cannot call ClassUtil.setContextClassLoader() with SecurityManager
> ------------------------------------------------------------------
>
>                 Key: TILES-324
>                 URL: https://issues.apache.org/struts/browse/TILES-324
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.0.6
>            Reporter: Eddy Chan
>            Assignee: Antonio Petrelli
>            Priority: Critical
>             Fix For: 2.0.7, 2.1.1
>
>
> In org.apache.tiles.util.ClassUtil.instantiate(String, boolean), there are two calls to setContextClassLoader for the currentThread.  This causes an issue with a SecurityManager that does not grant the RuntimePermission.  In my situation, since this class is in the webapp, the second call to setContextClassLoader causes an issue, since it is in the finally clause.  Two workarounds:
> 1) Remove the calls to setContextClassLoader.  (Not sure the necessity here.)
> 2) Flag whether the first call to setContextClassLoader was originally done, and then conditionally call setContextClassLoader if it was done.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (TILES-324) Cannot call ClassUtil.setContextClassLoader() with SecurityManager

Posted by "Antonio Petrelli (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/struts/browse/TILES-324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44870#action_44870 ] 

Antonio Petrelli commented on TILES-324:
----------------------------------------

Wow, this is a nasty bug, thanks for pointing at it.
In fact you're right, there is no necessity for the call of setContextClassLoader.
The logic would have been: get the thread's context classloader or, if it is null, get the classloader of the ClassUtil class itself.

> Cannot call ClassUtil.setContextClassLoader() with SecurityManager
> ------------------------------------------------------------------
>
>                 Key: TILES-324
>                 URL: https://issues.apache.org/struts/browse/TILES-324
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-core
>    Affects Versions: 2.0.6
>            Reporter: Eddy Chan
>
> In org.apache.tiles.util.ClassUtil.instantiate(String, boolean), there are two calls to setContextClassLoader for the currentThread.  This causes an issue with a SecurityManager that does not grant the RuntimePermission.  In my situation, since this class is in the webapp, the second call to setContextClassLoader causes an issue, since it is in the finally clause.  Two workarounds:
> 1) Remove the calls to setContextClassLoader.  (Not sure the necessity here.)
> 2) Flag whether the first call to setContextClassLoader was originally done, and then conditionally call setContextClassLoader if it was done.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.