felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benoît Thiébault (JIRA) <j...@apache.org>
Subject [jira] [Updated] (FELIX-4534) Bundles containing native code fails to start on Windows 7
Date Fri, 13 Jun 2014 13:38:01 GMT

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

Benoît Thiébault updated FELIX-4534:
------------------------------------

    Description: 
Windows 7 system is not properly recognized which makes bundles containing native code fail
to start.

The OS name is retrieved using Java system property in org.apache.felix.Felix class, line
4481. OS name is then "Windows 7", with a space.

It is then normalized using method org.apache.felix.framework.util.manifestparser.R4LibraryClause.normalizeOSName()
and stored in the configMap. OS name becomes "windows7" without the space.

When starting the bundle, method org.apache.felix.framework.util.manifestparser.R4LibraryClause.match()
is called, retrieves the already normalized OS name ("windows7") in the configMap and normalizes
it again.

This second normalisation fails as "windows7" without the space is not recognized by method
org.apache.felix.framework.util.manifestparser.R4LibraryClause.normalizeOSName().

In particular, the condition in the if statement line 392 is false when the OS name is "windows7":
if ((value.indexOf(" 7") >= 0) || value.equals("win7"))

Possible solutions are:
- prevent the OS name to be normalized twice (by checking if it is already normal)
- improve the normalisation to deal with "windows7" OS name (by replacing the if statement
with if ((value.indexOf("7") >= 0)) <- no space)

  was:
Windows 7 system is not properly recognized which makes bundles containing native code fail
to start.

The OS name is retrieved using Java system property in org.apache.felix.Felix class, line
4481. OS name is then "Windows 7", with a space.

It is then normalized using method org.apache.felix.framework.util.manifestparser.R4LibraryClause.normalizeOSName()
and stored in the configMap. OS name becomes "windows7" without the space.

When starting the bundle, method org.apache.felix.framework.util.manifestparser.R4LibraryClause.match()
is called, retrieves the already normalized OS name ("windows7") in the configMap and normalizes
it again.

This second normalisation fails as "windows7" without the space is not recognized by method
org.apache.felix.framework.util.manifestparser.R4LibraryClause.normalizeOSName().

In particular, the condition in the if statement line 392 is false when the OS name is "windows7":
if ((value.indexOf(" 7") >= 0) || value.equals("win7"))

Possible solutions are:
- prevent the OS name to be normalized twice (by checking if it is already normal)
- improve the normalisation to deal with "windows7" OS name


> Bundles containing native code fails to start on Windows 7
> ----------------------------------------------------------
>
>                 Key: FELIX-4534
>                 URL: https://issues.apache.org/jira/browse/FELIX-4534
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: framework-4.2.0, framework-4.2.1, framework-4.4.0
>         Environment: Windows 7
>            Reporter: Benoît Thiébault
>
> Windows 7 system is not properly recognized which makes bundles containing native code
fail to start.
> The OS name is retrieved using Java system property in org.apache.felix.Felix class,
line 4481. OS name is then "Windows 7", with a space.
> It is then normalized using method org.apache.felix.framework.util.manifestparser.R4LibraryClause.normalizeOSName()
and stored in the configMap. OS name becomes "windows7" without the space.
> When starting the bundle, method org.apache.felix.framework.util.manifestparser.R4LibraryClause.match()
is called, retrieves the already normalized OS name ("windows7") in the configMap and normalizes
it again.
> This second normalisation fails as "windows7" without the space is not recognized by
method org.apache.felix.framework.util.manifestparser.R4LibraryClause.normalizeOSName().
> In particular, the condition in the if statement line 392 is false when the OS name is
"windows7":
> if ((value.indexOf(" 7") >= 0) || value.equals("win7"))
> Possible solutions are:
> - prevent the OS name to be normalized twice (by checking if it is already normal)
> - improve the normalisation to deal with "windows7" OS name (by replacing the if statement
with if ((value.indexOf("7") >= 0)) <- no space)



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message