You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Richard S. Hall (JIRA)" <ji...@apache.org> on 2006/05/24 14:00:29 UTC

[jira] Created: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Improve bundle activator detection in Maven OSGi plugin
-------------------------------------------------------

         Key: FELIX-75
         URL: http://issues.apache.org/jira/browse/FELIX-75
     Project: Felix
        Type: Improvement

  Components: Maven OSGi Plugin  
    Reporter: Richard S. Hall
    Priority: Minor


Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12415119 ] 

Marcel Offermans commented on FELIX-75:
---------------------------------------

It would probably be best to at least be able to indicate in the pom.xml if a bundle should have a bundle activator or not. If it should have one, you could then choose to either let the plugin figure out which activator to use, or by manually specifying one yourself. I don't see a way to completely automatically do this that works in all situations.

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Blocker

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "John Conlon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12413301 ] 

John Conlon commented on FELIX-75:
----------------------------------

The OSGi plugin is creating an invalid manifest for the org.osgi.core bundle, by declaring a Bundle-Activator to be the Interface.

Manifest-Version: 1.0

Archiver-Version: Plexus Archiver

Created-By: Apache Maven

Built-By: jconlon

Build-Jdk: 1.5.0_06

Extension-Name: org.osgi.core

Implementation-Title: org.osgi.core

Implementation-Version: 0.8.0-SNAPSHOT

Bundle-Activator: org.osgi.framework.BundleActivator

Export-Package: org.osgi.service.packageadmin;specification-version=1.

 2, org.osgi.service.url;specification-version=1.0, org.osgi.service.s

 tartlevel;specification-version=1.0, org.osgi.service.permissionadmin

 ;specification-version=1.2, org.osgi.framework;specification-version=

 1.3, org.osgi.service.condpermadmin;specification-version=1.0

Bundle-Version: 0.8.0.SNAPSHOT

Bundle-Vendor: OSGi Alliance

Bundle-Category: osgi

Bundle-DocURL: http://www.osgi.org/

Bundle-Copyright: Copyright (c) OSGi Alliance (2000, 2005). All Rights

  Reserved.

Bundle-Name: osgi.core

Bundle-Classpath: .

Bundle-Description: OSGi Service Platform Release 4 Core Interfaces an

 d Classes.

Bundle-SymbolicName: osgi.core

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Minor

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "John Conlon (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12415141 ] 

John Conlon commented on FELIX-75:
----------------------------------

Specifying autodetection with:
<bundleActivator>auto-detect</bundleActivator>  will require all the bundles now without the bundleActivator element (those relying on auto detection) to be edited.

How about the opposite approach? Using an empty element. <bundleActivator/> to NOT auto generate a bundle and NOT specify one either?

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Blocker

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "Bram de Kruijff (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12414745 ] 

Bram de Kruijff commented on FELIX-75:
--------------------------------------

Problem also occurs in dependecymanager bundle. The plugin finds the abstract  DependencyActivatorBase class. I guess there should be some way to say:  "There is no spoon."

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Minor

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12415147 ] 

Richard S. Hall commented on FELIX-75:
--------------------------------------

My original approach was to do as you suggest, i.e., use an empty activator. However, it appears in the maven plugin that I cannot tell the difference between an empty <bundleActivator> tag and a non-existent <bundleActivator> tag...they both simply return NULL.

Further, I guess since it is causing so many problems for people, the better default is to have them explicitly say they want auto-detection rather than making it the default.

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Blocker

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12415120 ] 

Richard S. Hall commented on FELIX-75:
--------------------------------------

Was there a patch that caused this new behavior? I didn't think so. I propose just removing activator detection altogether until a better approach can be found/implemented. If we everyone agrees, then I can do a quick hack to make it so.

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Blocker

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "Richard S. Hall (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/FELIX-75?page=comments#action_12415129 ] 

Richard S. Hall commented on FELIX-75:
--------------------------------------

Ok, I did a quick and dirty hack to remedy this issue for the time being. For now, to trigger auto-detection of the bundle activator you must specify:

    <bundleActivator>auto-detect</bundleActivator>

If this is not specified, then bundle activator auto-detection will not happen. Verification of specified activators still works the same as before, if one is specified it is verified.

I will let Marcel decide if the "blocker" priority on this issue should be removed.

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Blocker

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

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

Richard S. Hall updated FELIX-75:
---------------------------------

    Component/s:     (was: Maven Bundle Plugin)
                 Maven OSGi Plugin (Deprecated)

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>                 Key: FELIX-75
>                 URL: https://issues.apache.org/jira/browse/FELIX-75
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven OSGi Plugin (Deprecated)
>            Reporter: Richard S. Hall
>            Priority: Blocker
>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

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


[jira] Updated: (FELIX-75) Improve bundle activator detection in Maven OSGi plugin

Posted by "Marcel Offermans (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/FELIX-75?page=all ]

Marcel Offermans updated FELIX-75:
----------------------------------

    Priority: Blocker  (was: Minor)

Changed the priority to blocker because the plugin tries to create a bundle activator line for every bundle now. This means that library bundles like org.osgi.core now get org.osgi.framework.BundleActivator as their bundle activator.

> Improve bundle activator detection in Maven OSGi plugin
> -------------------------------------------------------
>
>          Key: FELIX-75
>          URL: http://issues.apache.org/jira/browse/FELIX-75
>      Project: Felix
>         Type: Improvement

>   Components: Maven OSGi Plugin
>     Reporter: Richard S. Hall
>     Priority: Blocker

>
> Currently, the Maven OSGi plugin detects the bundle activator by simply checking the byte code constant pool for any class that references org.osgi.framework.BundleActivator. This check is too simplistic for cases where subclasses of BundleActivator are used or in cases where the activator is imported from another bundle. The first case could be improved by better byte code analysis, I am not sure about the latter.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira