You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2010/03/10 15:57:27 UTC

[jira] Created: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
----------------------------------------------------------------------------------------------------------------

                 Key: SLING-1435
                 URL: https://issues.apache.org/jira/browse/SLING-1435
             Project: Sling
          Issue Type: Bug
          Components: Scripting
    Affects Versions: Scripting JSP 2.0.8
            Reporter: Carsten Ziegeler
            Assignee: Carsten Ziegeler
             Fix For: Scripting JSP 2.0.10


Scenario - note that this works fine with Java 5, but on Java 6 we have:

- A jsp instanties a class from bundle A with the new operator
- JSP is loaded - everything is working fine
- Bundle A is uninstalled
- JSP invocation results in NoClassDefFoundError (which is expected)
- Bundle A is installed
- JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called

It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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


[jira] Resolved: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-1435.
-------------------------------------

    Resolution: Fixed

Added a workaround in revision 921377 which simply removes the old class if a NoClassDefFoundError is thrown during script
execution.
While the solution does not look nice it works, therefore I'm closing the bug :)

> After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1435
>                 URL: https://issues.apache.org/jira/browse/SLING-1435
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting JSP 2.0.8
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.10
>
>
> Scenario - note that this works fine with Java 5, but on Java 6 we have:
> - A jsp instanties a class from bundle A with the new operator
> - JSP is loaded - everything is working fine
> - Bundle A is uninstalled
> - JSP invocation results in NoClassDefFoundError (which is expected)
> - Bundle A is installed
> - JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called
> It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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


[jira] Resolved: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler resolved SLING-1435.
-------------------------------------

    Resolution: Fixed

If a package has not been found during a class loading attempt and a bundle is resolved which exports such a package, we
reload the classloader.
Changed in revision 921724

> After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1435
>                 URL: https://issues.apache.org/jira/browse/SLING-1435
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: Commons ClassLoader 1.1.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons ClassLoader 1.1.6
>
>
> Scenario - note that this works fine with Java 5, but on Java 6 we have:
> - A jsp instanties a class from bundle A with the new operator
> - JSP is loaded - everything is working fine
> - Bundle A is uninstalled
> - JSP invocation results in NoClassDefFoundError (which is expected)
> - Bundle A is installed
> - JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called
> It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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


[jira] Commented: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12844520#action_12844520 ] 

Carsten Ziegeler commented on SLING-1435:
-----------------------------------------

I've improved the reloading behaviour of the classloader in revision 922272 to only check if a bundle is used if a bundle unresolved event occurs.

> After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1435
>                 URL: https://issues.apache.org/jira/browse/SLING-1435
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: Commons ClassLoader 1.1.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons ClassLoader 1.1.6
>
>
> Scenario - note that this works fine with Java 5, but on Java 6 we have:
> - A jsp instanties a class from bundle A with the new operator
> - JSP is loaded - everything is working fine
> - Bundle A is uninstalled
> - JSP invocation results in NoClassDefFoundError (which is expected)
> - Bundle A is installed
> - JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called
> It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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


[jira] Commented: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12843969#action_12843969 ] 

Carsten Ziegeler commented on SLING-1435:
-----------------------------------------

Removed workaround in revision 921723

> After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1435
>                 URL: https://issues.apache.org/jira/browse/SLING-1435
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: Commons ClassLoader 1.1.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons ClassLoader 1.1.6
>
>
> Scenario - note that this works fine with Java 5, but on Java 6 we have:
> - A jsp instanties a class from bundle A with the new operator
> - JSP is loaded - everything is working fine
> - Bundle A is uninstalled
> - JSP invocation results in NoClassDefFoundError (which is expected)
> - Bundle A is installed
> - JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called
> It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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


[jira] Reopened: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reopened SLING-1435:
-------------------------------------


A better solution is to reload the class loader in this cases; this solves the problem for all clients of the dynamic class loader.

> After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1435
>                 URL: https://issues.apache.org/jira/browse/SLING-1435
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting JSP 2.0.8
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Scripting JSP 2.0.10
>
>
> Scenario - note that this works fine with Java 5, but on Java 6 we have:
> - A jsp instanties a class from bundle A with the new operator
> - JSP is loaded - everything is working fine
> - Bundle A is uninstalled
> - JSP invocation results in NoClassDefFoundError (which is expected)
> - Bundle A is installed
> - JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called
> It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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


[jira] Updated: (SLING-1435) After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-1435?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-1435:
------------------------------------

          Component/s:     (was: Scripting)
                       Commons
    Affects Version/s:     (was: Scripting JSP 2.0.8)
                       Commons ClassLoader 1.1.4
        Fix Version/s:     (was: Scripting JSP 2.0.10)
                       Commons ClassLoader 1.1.6

> After a NoClassDefError classes are still not found even if they have been installed in the meantime with Java 6
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-1435
>                 URL: https://issues.apache.org/jira/browse/SLING-1435
>             Project: Sling
>          Issue Type: Bug
>          Components: Commons
>    Affects Versions: Commons ClassLoader 1.1.4
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: Commons ClassLoader 1.1.6
>
>
> Scenario - note that this works fine with Java 5, but on Java 6 we have:
> - A jsp instanties a class from bundle A with the new operator
> - JSP is loaded - everything is working fine
> - Bundle A is uninstalled
> - JSP invocation results in NoClassDefFoundError (which is expected)
> - Bundle A is installed
> - JSP is invoked and as soon as the new operator is called a NoClassDefFoundError is called
> It seems that Java 6 behaves differently than Java 5: The jsp can be loaded and executed, but as soon as the class from Bundle A is used, Java 6 memorieses that the class was gone inbetween and it is not possible to update this state somehow. All involved classloaders are not queried anymore

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