You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Xavier Fournet (JIRA)" <ji...@apache.org> on 2017/04/21 15:01:04 UTC

[jira] [Commented] (FELIX-5574) When detecting an unknow Windows OS name, provides a suitable default value for org.osgi.framework.os.name

    [ https://issues.apache.org/jira/browse/FELIX-5574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15978876#comment-15978876 ] 

Xavier Fournet commented on FELIX-5574:
---------------------------------------

As expected, the latest JDK8 version now recognize correctly Windows Server 2016 leading Felix to fall again this trap.

Repro case on Windows Server 2016 + Felix 5.6.2

With JDK 1.8.0_121 it's working correctly
{noformat}
C:\work\felix-framework-5.6.2>..\jdk-1.8.0_121\bin\java.exe -version
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

C:\work\felix-framework-5.6.2>..\jdk-1.8.0_121\bin\java.exe -jar bin\felix.jar
____________________________
Welcome to Apache Felix Gogo

g! context:getProperty os.name
Windows NT (unknown)

g! context:getProperty org.osgi.framework.os.name
windowsnt

g! install http://central.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.2.6/snappy-java-1.1.2.6.jar
Bundle ID: 7

g! start 7

g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (5.6.2)|5.6.2
    1|Active     |    1|jansi (1.14.0)|1.14.0
    2|Active     |    1|JLine (3.0.1)|3.0.1
    3|Active     |    1|Apache Felix Bundle Repository (2.0.8)|2.0.8
    4|Active     |    1|Apache Felix Gogo Command (1.0.2)|1.0.2
    5|Active     |    1|Apache Felix Gogo JLine Shell (1.0.2)|1.0.2
    6|Active     |    1|Apache Felix Gogo Runtime (1.0.2)|1.0.2
    7|Active     |    1|snappy-java: A fast compression/decompression library (1.1.2.6)|1.1.2.6
{noformat}



With JDK 1.8.0_131 it's fail to install the snappy bundle because of the invalid value (win) for org.osgi.framework.os.name property
{noformat}
C:\work\felix-framework-5.6.2>..\jdk-1.8.0_131\bin\java.exe -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

C:\work\felix-framework-5.6.2>..\jdk-1.8.0_131\bin\java.exe -jar bin\felix.jar
____________________________
Welcome to Apache Felix Gogo

g! context:getProperty os.name
Windows Server 2016

g! context:getProperty org.osgi.framework.os.name
win

g! install http://central.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.2.6/snappy-java-1.1.2.6.jar
Bundle ID: 7

g! start 7
org.osgi.framework.BundleException: Unable to resolve org.xerial.snappy.snappy-java [7](R 7.0): missing requirement [org.xerial.snappy.snappy-java [7](R 7.0)] osgi.native; (|(&(osgi.native.osname~=win32)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=win32)(osgi.native.processor~=x64))(&(osgi.native.osname~=win32)(osgi.native.processor~=amd64))(&(osgi.native.osname~=win32)(osgi.native.processor~=x86))(&(osgi.native.osname~=macosx)(osgi.native.processor~=x86))(&(osgi.native.osname~=macosx)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x64))(&(osgi.native.osname~=linux)(osgi.native.processor~=amd64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x86))(&(osgi.native.osname~=linux)(osgi.native.processor~=aarch64))(&(osgi.native.osname~=linux)(osgi.native.processor~=arm))(&(osgi.native.osname~=linux)(osgi.native.processor~=ppc64))(&(osgi.native.osname~=linux)(osgi.native.processor~=ppc64le))(&(osgi.native.osname~=linux)(osgi.native.processor~=s390x))(&(osgi.native.osname~=aix)(osgi.native.processor~=ppc))(&(osgi.native.osname~=aix)(osgi.native.processor~=ppc64))(&(osgi.native.osname~=sunos)(osgi.native.processor~=x86))(&(osgi.native.osname~=sunos)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=sunos)(osgi.native.processor~=sparc))) Unresolved requirements: [[org.xerial.snappy.snappy-java [7](R 7.0)] osgi.native; (|(&(osgi.native.osname~=win32)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=win32)(osgi.native.processor~=x64))(&(osgi.native.osname~=win32)(osgi.native.processor~=amd64))(&(osgi.native.osname~=win32)(osgi.native.processor~=x86))(&(osgi.native.osname~=macosx)(osgi.native.processor~=x86))(&(osgi.native.osname~=macosx)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x64))(&(osgi.native.osname~=linux)(osgi.native.processor~=amd64))(&(osgi.native.osname~=linux)(osgi.native.processor~=x86))(&(osgi.native.osname~=linux)(osgi.native.processor~=aarch64))(&(osgi.native.osname~=linux)(osgi.native.processor~=arm))(&(osgi.native.osname~=linux)(osgi.native.processor~=ppc64))(&(osgi.native.osname~=linux)(osgi.native.processor~=ppc64le))(&(osgi.native.osname~=linux)(osgi.native.processor~=s390x))(&(osgi.native.osname~=aix)(osgi.native.processor~=ppc))(&(osgi.native.osname~=aix)(osgi.native.processor~=ppc64))(&(osgi.native.osname~=sunos)(osgi.native.processor~=x86))(&(osgi.native.osname~=sunos)(osgi.native.processor~=x86-64))(&(osgi.native.osname~=sunos)(osgi.native.processor~=sparc)))]

g! lb
START LEVEL 1
   ID|State      |Level|Name
    0|Active     |    0|System Bundle (5.6.2)|5.6.2
    1|Active     |    1|jansi (1.14.0)|1.14.0
    2|Active     |    1|JLine (3.0.1)|3.0.1
    3|Active     |    1|Apache Felix Bundle Repository (2.0.8)|2.0.8
    4|Active     |    1|Apache Felix Gogo Command (1.0.2)|1.0.2
    5|Active     |    1|Apache Felix Gogo JLine Shell (1.0.2)|1.0.2
    6|Active     |    1|Apache Felix Gogo Runtime (1.0.2)|1.0.2
    7|Installed  |    1|snappy-java: A fast compression/decompression library (1.1.2.6)|1.1.2.6
{noformat}

And BTW the FELIX-5553 patch doesn't seems to work, since it's missing the corresponding code in the method org.apache.felix.framework.util.manifestparser.NativeLibraryClause#normalizeOSName


> When detecting an unknow Windows OS name, provides a suitable default value for org.osgi.framework.os.name
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: FELIX-5574
>                 URL: https://issues.apache.org/jira/browse/FELIX-5574
>             Project: Felix
>          Issue Type: Improvement
>          Components: Framework
>            Reporter: Xavier Fournet
>            Priority: Minor
>             Fix For: framework-5.6.4
>
>
> When the system property os.name return a Windows OS name that is not recognized by org.apache.felix.framework.util.manifestparser.NativeLibraryClause#normalizeOSName then it return "win" as a fallback value.
> However this "win" value is not something valid for the org.osgi.framework.os.name property name (cf https://www.osgi.org/developer/specifications/reference/)
> Changing the fallback value to "win32" would be better so it would allow most of the JNI library to be loaded.
> This would allow smooth support of future windows platform, for example for Windows Server 2016 with JDK9 (or JDK8 when https://bugs.openjdk.java.net/browse/JDK-8159948 will be fix on it)



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)