You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Valentin Valchev (JIRA)" <ji...@apache.org> on 2010/02/22 16:38:27 UTC

[jira] Created: (FELIX-2119) Bundle update fails, if OBR is not installed

Bundle update fails, if OBR is not installed
--------------------------------------------

                 Key: FELIX-2119
                 URL: https://issues.apache.org/jira/browse/FELIX-2119
             Project: Felix
          Issue Type: Bug
          Components: Web Console
            Reporter: Valentin Valchev


The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.


Stack trace:

Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
        at java.lang.Class.getDeclaredMethod(Unknown Source)
        at java.lang.Thread$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.lang.Thread.auditSubclass(Unknown Source)
        at java.lang.Thread.isCCLOverridden(Unknown Source)
        at java.lang.Thread.init(Unknown Source)
        at java.lang.Thread.<init>(Unknown Source)
        at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
        at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
        at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
        at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
        at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
        at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
        at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Commented: (FELIX-2119) Bundle update fails, if OBR is not installed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12840630#action_12840630 ] 

Felix Meschberger commented on FELIX-2119:
------------------------------------------

The problem is caused by the Thread.init method checking whether any security sensitive method, which is not final, is overwritten by the extension of the Thread class. This causes -- in the Sun VM -- all declared methods to be accessed which in turn causes the Resource interface to be required.

By refactoring the BsaeUpdateInstaller class in Rev. 918442/918443 the Thread class is now not overwritten any more and thus the methods are not accessed any longer. This should fix this issue.

> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Closed: (FELIX-2119) Bundle update fails, if OBR is not installed

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

Carsten Ziegeler closed FELIX-2119.
-----------------------------------


> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Assigned: (FELIX-2119) Bundle update fails, if OBR is not installed

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

Felix Meschberger reassigned FELIX-2119:
----------------------------------------

    Assignee: Felix Meschberger

> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Commented: (FELIX-2119) Bundle update fails, if OBR is not installed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841156#action_12841156 ] 

Felix Meschberger commented on FELIX-2119:
------------------------------------------

You are right ;-)

> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.0
>
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Resolved: (FELIX-2119) Bundle update fails, if OBR is not installed

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

Felix Meschberger resolved FELIX-2119.
--------------------------------------

       Resolution: Fixed
    Fix Version/s: webconsole-3.0.0

Also have to use a constant string as RepositoryAdmin service name instead of "RepositoryAdmin.class" expression to prevent ClassDefNotFoundError. Fixed in Rev. 918449.

This now completes fixing this issue.

> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.0
>
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Commented: (FELIX-2119) Bundle update fails, if OBR is not installed

Posted by "Valentin Valchev (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841123#action_12841123 ] 

Valentin Valchev commented on FELIX-2119:
-----------------------------------------

Ok, now it works even if OBR is not installed. I'm just curious why the updateFromBundleLocation() method is so complex?

If we update a bundle from it's own location, then why bothering opening getting it's location, creating URL, getting the stream, update from the new stream, and then make sure stream is closed ..

Isn't it better to leave the framework do it's job and just use bundle.update(), instead of bundle.update(InputStream). Plus, the framework might have some optimizations on this update, and may perform it faster, than us (example it might internally cache the URL object for the location, might also check last updated time of the URLConnection, and if no-later than current, might decide to simply ignore the update operation).

So IMHO, the method show be:
private boolean updateFromBundleLocation() throws BundleException
    {
        getLog().log( LogService.LOG_DEBUG, "Trying to update from bundle location " + location );

        try
        {
                bundle.update();
                getLog().log( LogService.LOG_INFO, "Bundle updated from bundle location " + location );
                return true;
            }
        }
        catch ( Throwable ioe )
        {
            // BundleException, IllegalStateException or SecurityException? lets use OBR then
            getLog().log( LogService.LOG_DEBUG, "Update failure from bundle location " + location, ioe );
        }
        // not installed from the bundle location
        return false;
    }

> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>             Fix For: webconsole-3.0.0
>
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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


[jira] Issue Comment Edited: (FELIX-2119) Bundle update fails, if OBR is not installed

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-2119?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841156#action_12841156 ] 

Felix Meschberger edited comment on FELIX-2119 at 3/4/10 10:09 AM:
-------------------------------------------------------------------

You are right ;-)

Created FELIX-2167 to track this change

      was (Author: fmeschbe):
    You are right ;-)
  
> Bundle update fails, if OBR is not installed
> --------------------------------------------
>
>                 Key: FELIX-2119
>                 URL: https://issues.apache.org/jira/browse/FELIX-2119
>             Project: Felix
>          Issue Type: Bug
>          Components: Web Console
>            Reporter: Valentin Valchev
>            Assignee: Felix Meschberger
>             Fix For: webconsole-3.0.0
>
>
> The reason for this is that UpdateHelper depends on OBR service API. While OBR is not a core service, its absence shouldn't disallow execution of normal bundle life-cycle commands.
> Stack trace:
> Exception: java.lang.NoClassDefFoundError: [Lorg/osgi/service/obr/Resource;
>         at java.lang.Class.getDeclaredMethods0(Native Method)
>         at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
>         at java.lang.Class.getDeclaredMethod(Unknown Source)
>         at java.lang.Thread$1.run(Unknown Source)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.lang.Thread.auditSubclass(Unknown Source)
>         at java.lang.Thread.isCCLOverridden(Unknown Source)
>         at java.lang.Thread.init(Unknown Source)
>         at java.lang.Thread.<init>(Unknown Source)
>         at org.apache.felix.webconsole.internal.core.BaseUpdateInstallHelper.<init>(BaseUpdateInstallHelper.java:45)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:52)
>         at org.apache.felix.webconsole.internal.core.UpdateHelper.<init>(UpdateHelper.java:46)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet$4.<init>(BundlesServlet.java:1283)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.update(BundlesServlet.java:1282)
>         at org.apache.felix.webconsole.internal.core.BundlesServlet.doPost(BundlesServlet.java:312)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:815)
>         at org.apache.felix.webconsole.internal.servlet.OsgiManager.service(OsgiManager.java:372)

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