You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Thomas Dewire (JIRA)" <ji...@apache.org> on 2007/08/03 16:23:53 UTC

[jira] Created: (FELIX-333) can create a corrupt manifest file.

<Include_Resouce> can create a corrupt manifest file.
-----------------------------------------------------

                 Key: FELIX-333
                 URL: https://issues.apache.org/jira/browse/FELIX-333
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: 1.0.0
         Environment: Confirmed on Win32. Not sure about *nix.
            Reporter: Thomas Dewire
             Fix For: 1.0.0


Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.

Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Commented: (FELIX-333) can create a corrupt manifest file.

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

Carsten Ziegeler commented on FELIX-333:
----------------------------------------

I think, bnd should not include this header at all in the manifest. It is just used for the generation process.

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>             Fix For: 1.0.0
>
>         Attachments: felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Resolved: (FELIX-333) can create a corrupt manifest file.

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

Richard S. Hall resolved FELIX-333.
-----------------------------------

    Resolution: Fixed
      Assignee: Richard S. Hall

I applied the patch, please close this issue if everything is ok.

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>            Assignee: Richard S. Hall
>             Fix For: 1.0.0
>
>         Attachments: FELIX-333_20070814.txt, felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Commented: (FELIX-333) can create a corrupt manifest file.

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

Stuart McCulloch commented on FELIX-333:
----------------------------------------

after discussions with Peter, these values can only come from the XML so we'll fix it in the bundle-plugin.

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>             Fix For: 1.0.0
>
>         Attachments: felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Updated: (FELIX-333) can create a corrupt manifest file.

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

Stuart McCulloch updated FELIX-333:
-----------------------------------

    Attachment: FELIX-333_20070814.txt

Suggested patch (FELIX-333_20070814.txt) removes any new-lines / form-feeds from the properties.
I didn't want to remove all whitespace, as filenames may contain spaces and shouldn't be trimmed.

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>             Fix For: 1.0.0
>
>         Attachments: FELIX-333_20070814.txt, felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Commented: (FELIX-333) can create a corrupt manifest file.

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

Stuart McCulloch commented on FELIX-333:
----------------------------------------

Actually there is a problem with the manifest, but it's not initially obvious unless you open it using Linux.
Here's a similar example, note that there's a Unix newline that's not followed by a space on the next line:

   Include-Resource: foo=bar,
                           zzz=bar^M

The exception thrown from Java is as follows:

   org.osgi.framework.BundleException: The manifest line
      "                 zzz=bar" is invalid; it has no colon : character after the header key.
        at org.eclipse.osgi.framework.util.Headers.parseManifest(Headers.java:283)
        at org.eclipse.osgi.internal.baseadaptor.AdaptorUtil.loadManifestFrom(AdaptorUtil.java:193)

and the standard Jar utility class also barfs with this exception:

   java.io.IOException: invalid header field
        at java.util.jar.Attributes.read(Attributes.java:383)
        at java.util.jar.Manifest.read(Manifest.java:167)
        at java.util.jar.JarInputStream.<init>(JarInputStream.java:66)
        at java.util.jar.JarInputStream.<init>(JarInputStream.java:43)

The easy solution is to strip newlines from properties in the bundle-plugin before passing them to BND.
Of course Peter might prefer to handle this inside BND instead, as it might also be caused when using
BND from ant, etc. and a more robust library is always good :)

BTW, this only seems to happen with instructions passed in via the pom.xml, possibly because extra
whitespace is automatically removed when they're read in from a properties file using <_include>...
whereas with XML the whitespace is preserved.


> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>             Fix For: 1.0.0
>
>         Attachments: felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Updated: (FELIX-333) can create a corrupt manifest file.

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

Thomas Dewire updated FELIX-333:
--------------------------------

    Attachment: felix-bug-example.zip

A boiled-down maven project that should demonstrate the issue.

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>             Fix For: 1.0.0
>
>         Attachments: felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Commented: (FELIX-333) can create a corrupt manifest file.

Posted by "Peter Kriens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12519384 ] 

Peter Kriens commented on FELIX-333:
------------------------------------

Why is the manifest corrupted? It seems ok to me?

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>             Fix For: 1.0.0
>
>         Attachments: felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


RE: [jira] Updated: (FELIX-333) can create a corrupt manifest file.

Posted by "Dewire, Tom" <TD...@ea.com>.
I was the original filer. Everything seems fine after the fix.

--tom dewire 

-----Original Message-----
From: Stuart McCulloch (JIRA) [mailto:jira@apache.org] 
Sent: Friday, September 21, 2007 1:03 PM
To: dev@felix.apache.org
Subject: [jira] Updated: (FELIX-333) <Include_Resouce> can create a
corrupt manifest file.


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

Stuart McCulloch updated FELIX-333:
-----------------------------------


can this issue be closed?

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>            Assignee: Richard S. Hall
>             Fix For: 1.0.0
>
>         Attachments: FELIX-333_20070814.txt, felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the
issue. The generated manifest file is in the root directory as an
example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the
<Include-Resource> tag. These end up in the manifest file, and corrupt
it so the bundle cannot load.

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


[jira] Updated: (FELIX-333) can create a corrupt manifest file.

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

Stuart McCulloch updated FELIX-333:
-----------------------------------


can this issue be closed?

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>            Assignee: Richard S. Hall
>             Fix For: 1.0.0
>
>         Attachments: FELIX-333_20070814.txt, felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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


[jira] Closed: (FELIX-333) can create a corrupt manifest file.

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

Stuart McCulloch closed FELIX-333.
----------------------------------


Received email from reporter: "I was the original filer. Everything seems fine after the fix." so closing issue.

> <Include_Resouce> can create a corrupt manifest file.
> -----------------------------------------------------
>
>                 Key: FELIX-333
>                 URL: https://issues.apache.org/jira/browse/FELIX-333
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>         Environment: Confirmed on Win32. Not sure about *nix.
>            Reporter: Thomas Dewire
>            Assignee: Richard S. Hall
>             Fix For: 1.0.0
>
>         Attachments: FELIX-333_20070814.txt, felix-bug-example.zip
>
>
> Please see the attached maven project. It should demonstrate the issue. The generated manifest file is in the root directory as an example of the bad manifest syntax.
> Whitespace is not being stripped from the contents of the <Include-Resource> tag. These end up in the manifest file, and corrupt it so the bundle cannot load.

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