none
Unable to Connect TFS in solaris environment - UnsatisfiedLinkError RRS feed

  • Question

  • Dear Team

    I have a Java application (API) which uses TFSSDK to connect tfs to fetch and update the work items. This API works fine in windows OS without any issues. 
    Now I have a requirement to use the same application in SOLARIS platform where I am getting an error as below when I try to execute the jar file. I know this is because of native library not loaded, but I do have below the line in my class file same as windows except the path of the native library. 

    API works fine windows and not working in solaris due to below issue. Please advise.

    Error:
    Exception in thread "main" java.lang.UnsatisfiedLinkError: com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Ljava/lang/String;)Ljava/lang/String;
            at com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.nativeGetEnvironmentVariable(Native Method)
            at com.microsoft.tfs.jni.internal.platformmisc.NativePlatformMisc.getEnvironmentVariable(NativePlatformMisc.java:134)
            at com.microsoft.tfs.jni.PlatformMiscUtils.getEnvironmentVariable(PlatformMiscUtils.java:52)
            at com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.shouldAcceptUntrustedCertificates(DefaultHTTPClientFactory.java:288)
            at com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.configureClientParams(DefaultHTTPClientFactory.java:324)
            at com.microsoft.tfs.core.config.httpclient.DefaultHTTPClientFactory.newHTTPClient(DefaultHTTPClientFactory.java:137)
            at com.microsoft.tfs.core.TFSConnection.getHTTPClient(TFSConnection.java:1041)
            at com.microsoft.tfs.core.TFSConnection.getWebService(TFSConnection.java:874)
            at com.microsoft.tfs.core.config.client.DefaultClientFactory$9.newClient(DefaultClientFactory.java:271)
            at com.microsoft.tfs.core.config.client.DefaultClientFactory.newClient(DefaultClientFactory.java:91)
            at com.microsoft.tfs.core.TFSConnection.getClient(TFSConnection.java:1470)
            at com.microsoft.tfs.core.TFSTeamProjectCollection.getWorkItemClient(TFSTeamProjectCollection.java:370)
            at com.cybermak.tfsapi.TfsAPI.main(TfsAPI.java:167)

    Code to load the native libraries in my class file:

    Windows:
    System.setProperty("com.microsoft.tfs.jni.native.base-directory", "D:\\NetBeansProjects\\TFSAPI\\tfssdk\\redist\\native");

    SOLARIS:
    System.setProperty("com.microsoft.tfs.jni.native.base-directory", "/data/integration/api/TFSAPI/tfssdk/redist/native");


    Regards, Ram

    Thursday, May 30, 2019 8:01 AM