[ 
https://issues.apache.org/jira/browse/ARIES-1102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stephan Siano updated ARIES-1102:
---------------------------------

    Description: 
I am trying aries-subsystem. The installation fails, if a bundle without 
Bundle-ManifestVersion in the manifest is installed.

I actually was trying to install a feature subsystem containing a bundle that 
had a package import to org.slf4j. This failed if the 
org.slf4j:log4s-over-slf4j:1.6.5 bundle was installed. That latter bundle does 
not export (but import) the package required by the subsystem and does not have 
a Bundle-ManifestVersion in its manifest.

The code failed at line 81 of ExportedBundleImpl from the 
org.apache.aries.application.modeling bundle. The offending code is:

    String bmVersion = attrs.getValue(Constants.BUNDLE_MANIFESTVERSION);
    if (symbolicName == null || bmVersion == null) { 
      InvalidAttributeException iax = new 
InvalidAttributeException(MessageUtil.getMessage("INCORRECT_MANDATORY_HEADERS", 
          new Object[] {symbolicName, bmVersion}));
      logger.debug(LOG_EXIT, "ExportedBundleImpl", iax);
      throw iax;
    }

I think it should be:
    String bmVersion = attrs.getValue(Constants.BUNDLE_MANIFESTVERSION);
    if (bmVersion == null) {
      bmVersion = "1";
    }
    if (symbolicName == null) { 
      InvalidAttributeException iax = new 
InvalidAttributeException(MessageUtil.getMessage("INCORRECT_MANDATORY_HEADERS", 
          new Object[] {symbolicName, bmVersion}));
      logger.debug(LOG_EXIT, "ExportedBundleImpl", iax);
      throw iax;
    }

because the Bundle-ManifestVersion is not a required manifest header (in 
contrast to the Bundle-SymbolicName)

  was:
I am trying aries-subsystem. The installation fails, if a bundle without 
Bundle-ManifestVersion in the manifest is installed.

I actually was trying to install a feature subsystem containing a bundle that 
had a package import to org.slf4j. This failed if the 
org.slf4j:log4s-over-slf4j:1.6.5 bundle was installed. That latter bundle does 
not export (but import) the package required by the subsystem and does not have 
a Bundle-ManifestVersion in its manifest.

The code failed at line 81 of ExportedBundleImpl from the 
org.apache.aries.application.modeling bundle. The offending code is:

    String bmVersion = attrs.getValue(Constants.BUNDLE_MANIFESTVERSION);
    if (symbolicName == null || bmVersion == null) { 
      InvalidAttributeException iax = new 
InvalidAttributeException(MessageUtil.getMessage("INCORRECT_MANDATORY_HEADERS", 
          new Object[] {symbolicName, bmVersion}));
      logger.debug(LOG_EXIT, "ExportedBundleImpl", iax);
      throw iax;
    }

I think it should be:
    String bmVersion = attrs.getValue(Constants.BUNDLE_MANIFESTVERSION);
    if (bmVersion == null) {
      bmVersion = "1";
    }
    if (symbolicName == null) { 
      InvalidAttributeException iax = new 
InvalidAttributeException(MessageUtil.getMessage("INCORRECT_MANDATORY_HEADERS", 
          new Object[] {symbolicName, bmVersion}));
      logger.debug(LOG_EXIT, "ExportedBundleImpl", iax);
      throw iax;
    }

because the Bundle-ManifestVersion is not a required manifest header (in 
contrast to the Bundle-SymbolicName

    
> Aries Subsystem/Application chokes on installed bundles without 
> Bundle-ManifestVersion
> --------------------------------------------------------------------------------------
>
>                 Key: ARIES-1102
>                 URL: https://issues.apache.org/jira/browse/ARIES-1102
>             Project: Aries
>          Issue Type: Bug
>          Components: Application
>            Reporter: Stephan Siano
>         Attachments: patch.diff
>
>
> I am trying aries-subsystem. The installation fails, if a bundle without 
> Bundle-ManifestVersion in the manifest is installed.
> I actually was trying to install a feature subsystem containing a bundle that 
> had a package import to org.slf4j. This failed if the 
> org.slf4j:log4s-over-slf4j:1.6.5 bundle was installed. That latter bundle 
> does not export (but import) the package required by the subsystem and does 
> not have a Bundle-ManifestVersion in its manifest.
> The code failed at line 81 of ExportedBundleImpl from the 
> org.apache.aries.application.modeling bundle. The offending code is:
>     String bmVersion = attrs.getValue(Constants.BUNDLE_MANIFESTVERSION);
>     if (symbolicName == null || bmVersion == null) { 
>       InvalidAttributeException iax = new 
> InvalidAttributeException(MessageUtil.getMessage("INCORRECT_MANDATORY_HEADERS",
>  
>           new Object[] {symbolicName, bmVersion}));
>       logger.debug(LOG_EXIT, "ExportedBundleImpl", iax);
>       throw iax;
>     }
> I think it should be:
>     String bmVersion = attrs.getValue(Constants.BUNDLE_MANIFESTVERSION);
>     if (bmVersion == null) {
>       bmVersion = "1";
>     }
>     if (symbolicName == null) { 
>       InvalidAttributeException iax = new 
> InvalidAttributeException(MessageUtil.getMessage("INCORRECT_MANDATORY_HEADERS",
>  
>           new Object[] {symbolicName, bmVersion}));
>       logger.debug(LOG_EXIT, "ExportedBundleImpl", iax);
>       throw iax;
>     }
> because the Bundle-ManifestVersion is not a required manifest header (in 
> contrast to the Bundle-SymbolicName)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to