You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Carsten Ziegeler (JIRA)" <ji...@apache.org> on 2008/07/07 12:33:31 UTC

[jira] Created: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

Import statement incomplete when inheriting from an abstract class from another bundle
--------------------------------------------------------------------------------------

                 Key: FELIX-624
                 URL: https://issues.apache.org/jira/browse/FELIX-624
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-1.4.1
            Reporter: Carsten Ziegeler
         Attachments: test.zip

I have two bundles:
Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
Bundle b has a class inheriting from the abstract class from Bundle a

The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
when bundle b is started.

This might either be a buig in the maven-bundle-plugin or the used bnd version.

I'll add a simple test case

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


[jira] Closed: (FELIX-624) Wrong classloader is used to detect bind/unbind methods

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

Carsten Ziegeler closed FELIX-624.
----------------------------------

       Resolution: Fixed
    Fix Version/s: scr-1.0.4

> Wrong classloader is used to detect bind/unbind methods
> -------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>             Fix For: scr-1.0.4
>
>         Attachments: Archiv.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Updated: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

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

Carsten Ziegeler updated FELIX-624:
-----------------------------------

    Attachment: test.zip

Test case with two bundles.

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>            Reporter: Carsten Ziegeler
>         Attachments: test.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Commented: (FELIX-624) Wrong classloader is used to detect bind/unbind methods

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

Carsten Ziegeler commented on FELIX-624:
----------------------------------------

This has been reimplemented to use the correct classloader with FELIX-696

> Wrong classloader is used to detect bind/unbind methods
> -------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>             Fix For: scr-1.0.4
>
>         Attachments: Archiv.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Commented: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611001#action_12611001 ] 

Stuart McCulloch commented on FELIX-624:
----------------------------------------

Yes, that sounds like an SCR issue - is it using the correct classloader?

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>            Reporter: Carsten Ziegeler
>         Attachments: test.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Updated: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

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

Carsten Ziegeler updated FELIX-624:
-----------------------------------

    Attachment: Archiv.zip

Updated test case with three bundles

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>         Attachments: Archiv.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

-- 
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-624) Wrong classloader is used to detect bind/unbind methods

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

cziegeler edited comment on FELIX-624 at 8/25/08 2:44 AM:
-----------------------------------------------------------------

This has been reimplemented to use the correct classloader with FELIX-694

      was (Author: cziegeler):
    This has been reimplemented to use the correct classloader with FELIX-696
  
> Wrong classloader is used to detect bind/unbind methods
> -------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>             Fix For: scr-1.0.4
>
>         Attachments: Archiv.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Commented: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

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

Carsten Ziegeler commented on FELIX-624:
----------------------------------------

No, the subclass is not directly using the class from commons-collections. 

Ah, i see (dumb me)  - yes, the bundle is loaded correctly - it's a problem later on with SCR - the scr implementation is not able to instantiate
an instance of this class.

So I guess that this is rather an SCR bug then, right?

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>            Reporter: Carsten Ziegeler
>         Attachments: test.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Commented: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610949#action_12610949 ] 

Stuart McCulloch commented on FELIX-624:
----------------------------------------

I'm not sure that the import is actually needed - have you checked the bytecode to see if the subclass uses the reference?

Note that there is a bug in Eclipse/PDE which does require this import (due to how PDE is grafted on top of JDT) but the bundles will typically deploy without error onto OSGi frameworks.

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>            Reporter: Carsten Ziegeler
>         Attachments: test.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Commented: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

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

Carsten Ziegeler commented on FELIX-624:
----------------------------------------

Ok, i've updated my test case and it seems to be an SCR problem...however I haven't dug into the code yet.

Here's the exception I get when deploying bundle B (after deploying bundle c and a)
07.07.2008 14:48:14.005 *ERROR* [SCR Component Actor] com.cziegeler.test.b [com.c2.Test] Cannot load class used as parameter org.apache.commons.collections.bag.TreeBag (java.lang.ClassNotFoundException: org.apache.commons.collections.bag.TreeBag) java.lang.ClassNotFoundException: org.apache.commons.collections.bag.TreeBag
	at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1504)
	at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:358)
	at org.apache.felix.scr.impl.DependencyManager.getBindingMethod(DependencyManager.java:734)
	at org.apache.felix.scr.impl.DependencyManager.getBindingMethod(DependencyManager.java:793)
	at org.apache.felix.scr.impl.DependencyManager.getBindingMethod(DependencyManager.java:793)
	at org.apache.felix.scr.impl.DependencyManager.invokeBindMethod(DependencyManager.java:827)
	at org.apache.felix.scr.impl.DependencyManager.bind(DependencyManager.java:651)
	at org.apache.felix.scr.impl.ImmediateComponentManager.createImplementationObject(ImmediateComponentManager.java:203)
	at org.apache.felix.scr.impl.ImmediateComponentManager.createComponent(ImmediateComponentManager.java:133)
	at org.apache.felix.scr.impl.AbstractComponentManager.activateInternal(AbstractComponentManager.java:476)
	at org.apache.felix.scr.impl.AbstractComponentManager.enableInternal(AbstractComponentManager.java:398)
	at org.apache.felix.scr.impl.AbstractComponentManager.access$000(AbstractComponentManager.java:36)
	at org.apache.felix.scr.impl.AbstractComponentManager$1.run(AbstractComponentManager.java:99)
	at org.apache.felix.scr.impl.ComponentActorThread.run(ComponentActorThread.java:85)
07.07.2008 14:48:14.006 *ERROR* [SCR Component Actor] com.cziegeler.test.b [com.c2.Test] bind() method not found


> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Commented: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12611000#action_12611000 ] 

Stuart McCulloch commented on FELIX-624:
----------------------------------------

I ran javap over the subclass and cannot find any reference to commons-collections in the bytecode, so it seems odd this bundle threw a CNFE because it should not need the import during classloading if there is no reference to it in the bytecode / constant pool (at least according to the JVM spec). Also I started the two bundles and the commons-collections bundle (v3.2.1) successfully in Felix and saw no problem - all the bundles resolved ok.

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-1.4.1
>            Reporter: Carsten Ziegeler
>         Attachments: test.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Updated: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

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

Carsten Ziegeler updated FELIX-624:
-----------------------------------

    Attachment:     (was: test.zip)

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Updated: (FELIX-624) Import statement incomplete when inheriting from an abstract class from another bundle

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

Stuart McCulloch updated FELIX-624:
-----------------------------------

          Component/s:     (was: Maven Bundle Plugin)
                       Declarative Services (SCR)
    Affects Version/s:     (was: maven-bundle-plugin-1.4.1)
                       scr-1.0.2

Moving issue over to SCR for further investigation.

> Import statement incomplete when inheriting from an abstract class from another bundle
> --------------------------------------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>         Attachments: test.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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


[jira] Updated: (FELIX-624) Wrong classloader is used to detect bind/unbind methods

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

Carsten Ziegeler updated FELIX-624:
-----------------------------------

    Summary: Wrong classloader is used to detect bind/unbind methods  (was: Import statement incomplete when inheriting from an abstract class from another bundle)

As discussed in the list, the SCR implementation should not use the classloader of the component itself to load
the parameter classes for the bind/unbind methods. It should rather use the classloader of the class implementing
the bind/unbind methods.
I've implemented a simpler variant which uses the classloader of the bundle exporting the service. This classloader
is definitly able to load the class (and has already loaded it as the service is available). Available with revision 674514.

> Wrong classloader is used to detect bind/unbind methods
> -------------------------------------------------------
>
>                 Key: FELIX-624
>                 URL: https://issues.apache.org/jira/browse/FELIX-624
>             Project: Felix
>          Issue Type: Bug
>          Components: Declarative Services (SCR)
>    Affects Versions: scr-1.0.2
>            Reporter: Carsten Ziegeler
>         Attachments: Archiv.zip
>
>
> I have two bundles:
> Bundle a exporting an abstract class which has a reference to another class (in my test scenario to a class from commons-collections)
> Bundle b has a class inheriting from the abstract class from Bundle a
> The import package statement in Bundle b does not include the commons-collections class which results in class not found exceptions
> when bundle b is started.
> This might either be a buig in the maven-bundle-plugin or the used bnd version.
> I'll add a simple test case

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