Puzzling JNI error message

Discussion in 'Java' started by Roedy Green, Sep 23, 2008.

  1. Roedy Green

    Roedy Green Guest

    Exception in thread "main" java.lang.UnsatisfiedLinkError:
    C:\sys\nativepentium.dll: The application has failed to start because
    its side-by-side configuration is incorrect. Please see the
    application event log for more detail

    "Activation context generation failed for "C:\sys\nativepentium.dll".
    Dependent Assembly
    Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"
    could not be found. Please use sxstrace.exe for detailed diagnosis. "

    This is a little bit of JNI in a DLL. The program works fine on MY
    machine, but not on others.

    Microsoft dropped support for Visual C++ studio 6. I had to reinstall
    it and now it won't work. So I switched over to the their Visual C++
    express.

    Perhaps there is some weird thing in it to stop you from writing code
    for other machines with it.

    Perhaps it uses some library part of C++ not included with the DLL.

    The C++ code does no I/O.

    --
    Roedy Green Canadian Mind Products
    http://mindprod.com/politics/harper.html
    Anyone but Harper for Prime Minister of Canada
    Roedy Green, Sep 23, 2008
    #1
    1. Advertising

  2. On 23-9-2008 10:25, Roedy Green wrote:
    > Exception in thread "main" java.lang.UnsatisfiedLinkError:
    > C:\sys\nativepentium.dll: The application has failed to start because
    > its side-by-side configuration is incorrect. Please see the
    > application event log for more detail
    > [...]


    Google for "The application has failed to start because its side-by-side
    configuration is incorrect".
    --
    Regards,

    Roland
    Roland de Ruiter, Sep 23, 2008
    #2
    1. Advertising

  3. Roedy Green

    Tom Anderson Guest

    On Tue, 23 Sep 2008, Roland de Ruiter wrote:

    > On 23-9-2008 10:25, Roedy Green wrote:
    >> Exception in thread "main" java.lang.UnsatisfiedLinkError:
    >> C:\sys\nativepentium.dll: The application has failed to start because
    >> its side-by-side configuration is incorrect. Please see the
    >> application event log for more detail [...]

    >
    > Google for "The application has failed to start because its side-by-side
    > configuration is incorrect".


    Which is, incidentally, a brilliantly nonsensical-sounding error message!

    tom

    --
    Know who said that? Fucking Terrorvision, that's who. -- D
    Tom Anderson, Sep 23, 2008
    #3
  4. Roedy Green

    Roedy Green Guest

    On Tue, 23 Sep 2008 13:26:42 -0400, Zig <> wrote,
    quoted or indirectly quoted someone who said :

    >/MD causes your dll to link against the VC runtime
    >/MT is for "static" linking. It will make your DLL bigger, but it won't
    >have the VC runtime dependancy.


    With Visual C++ studio 6 I created standalone DLLs. MS no longer
    supports it, so it won't run under Vista without updates.

    The free replacement Express C++ 8, does some strange things with
    DLLs.

    Embedded in the DLLs is fluffy INDENTED XML

    This points to a "manifest" file (no relation to MFT files) that look
    like this with seems to be a set of digital signatures.

    Microsoft.VC90.CRT.manifest:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
    manifestVersion="1.0">
    <noInheritable></noInheritable>
    <assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
    version="9.0.30729.1" processorArchitecture="x86"
    publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    <file name="msvcr90.dll" hashalg="SHA1"
    hash="9785b1c493deb5b2134dc4aef3719cee207001bc"><asmv2:hash
    xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
    xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform
    Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod
    Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>VF5ECUAHPV7EnUf+/UIXMPizPvs=</dsig:DigestValue></asmv2:hash></file>
    <file name="msvcp90.dll" hashalg="SHA1"
    hash="0f6bbf7fe4fb3fca2cb5b542eca1a1cad051f01c"><asmv2:hash
    xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
    xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform
    Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod
    Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>3Wg+StVMq2uhx7POnAkl2w4dDmY=</dsig:DigestValue></asmv2:hash></file>
    <file name="msvcm90.dll" hashalg="SHA1"
    hash="7f3290ab2b7444c2b4a9b1fedfdb16466d7a21bb"><asmv2:hash
    xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
    xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform
    Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod
    Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>/YfRn7UQENzdMeoMHxTgdRMiObA=</dsig:DigestValue></asmv2:hash></file>
    </assembly>

    I would like it if:

    1. I could make an JNI app self contained.

    2. failing that, that only a few DLLs need to added to the path.

    3. failing that the user has to install the entire DLL run time.

    What is most annoying is my C++ code does actually need any support
    libraries. It is just a bit of _asm stuff. It does not even use the
    console.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com/politics/harper.html
    Anyone but Harper for Prime Minister of Canada
    Roedy Green, Sep 23, 2008
    #4
  5. Roedy Green

    Roedy Green Guest

    On Tue, 23 Sep 2008 13:26:42 -0400, Zig <> wrote,
    quoted or indirectly quoted someone who said :

    >/MD causes your dll to link against the VC runtime
    >/MT is for "static" linking. It will make your DLL bigger, but it won't
    >have the VC runtime dependancy.


    I have been looking for the equivalent to those in Express 8. I used
    to use static linking with Studio 6.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com/politics/harper.html
    Anyone but Harper for Prime Minister of Canada
    Roedy Green, Sep 23, 2008
    #5
  6. Roedy Green

    Roedy Green Guest

    On Tue, 23 Sep 2008 13:02:32 +0200, Roland de Ruiter
    <> wrote, quoted or indirectly quoted
    someone who said :

    >
    >Google for "The application has failed to start because its side-by-side
    >configuration is incorrect".


    I thought I had done that, but when I repeated the experiment at you
    urging, I found some hints.

    Google is so frustrating that the first ten hits or so are usually
    other people clearly expressing the same question I have, but without
    any responses.


    --
    Roedy Green Canadian Mind Products
    http://mindprod.com/politics/harper.html
    Anyone but Harper for Prime Minister of Canada
    Roedy Green, Sep 23, 2008
    #6
  7. Roedy Green

    Roedy Green Guest

    On Tue, 23 Sep 2008 17:14:26 -0400, Zig <> wrote,
    quoted or indirectly quoted someone who said :

    >Ooops, I thought that was a linker option, but it looks like it's set as a
    >code generation option in VC 2008.


    It is a code generation option that gets passed through to the linker.
    They document all sorts of option such as MT and LD, but when you put
    them in the slot, the GUI converts them back to non-static options.

    Microsoft sells the full blown C++ compiler for $1560.00. So I guess
    they had to do something to hobble the free version to encourage
    sales.

    For now, I am just including documentation telling people they must
    pre install the run time.

    I seem to recall that you are supposed to be able to put DLLs inside
    jars and have them found, in JDK 1.5+. Was this just JWS? I have not
    been able to get that to work.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com/politics/harper.html
    Anyone but Harper for Prime Minister of Canada
    Roedy Green, Sep 24, 2008
    #7
  8. Roedy Green

    Roedy Green Guest

    On Tue, 23 Sep 2008 17:14:26 -0400, Zig <> wrote,
    quoted or indirectly quoted someone who said :

    >For "Runtime Library", you should be able to set that to "Multi-threaded
    >(/MT)" for your release configuration.
    >
    >That should let you get your JNI DLL built without the VC Runtime
    >dependancies.


    You are right. The docs suggested you don't get a DLL with /MT, but
    when I tried it, it does generate one, and a fairly fat one suggesting
    it is statically linking.
    --
    Roedy Green Canadian Mind Products
    http://mindprod.com/politics/harper.html
    Anyone but Harper for Prime Minister of Canada
    Roedy Green, Sep 24, 2008
    #8
  9. Roedy Green

    Arne Vajhøj Guest

    Roedy Green wrote:
    > On Tue, 23 Sep 2008 13:26:42 -0400, Zig <> wrote,
    > quoted or indirectly quoted someone who said :
    >> /MD causes your dll to link against the VC runtime
    >> /MT is for "static" linking. It will make your DLL bigger, but it won't
    >> have the VC runtime dependancy.

    >
    > I have been looking for the equivalent to those in Express 8. I used
    > to use static linking with Studio 6.


    Both exist in VS 2008 Express alias MS VC++ 9 alias MS C++ 15.

    C:\>cl /LD /MT z.c
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01
    for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.

    z.c
    Microsoft (R) Incremental Linker Version 9.00.30729.01
    Copyright (C) Microsoft Corporation. All rights reserved.

    /out:z.dll
    /dll
    /implib:z.lib
    z.obj
    Creating library z.lib and object z.exp

    C:\>dir z.dll
    Volume in drive C is ARNEPC3_C
    Volume Serial Number is E850-F261

    Directory of C:\

    11-10-2008 20:28 40.960 z.dll
    1 File(s) 40.960 bytes
    0 Dir(s) 59.401.162.752 bytes free

    C:\>cl /LD /MD z.c
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01
    for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.

    z.c
    Microsoft (R) Incremental Linker Version 9.00.30729.01
    Copyright (C) Microsoft Corporation. All rights reserved.

    /out:z.dll
    /dll
    /implib:z.lib
    z.obj
    Creating library z.lib and object z.exp

    C:\>dir z.dll
    Volume in drive C is ARNEPC3_C
    Volume Serial Number is E850-F261

    Directory of C:\

    11-10-2008 20:28 6.144 z.dll
    1 File(s) 6.144 bytes
    0 Dir(s) 59.401.195.520 bytes free

    Arne
    Arne Vajhøj, Oct 12, 2008
    #9
  10. Roedy Green

    Arne Vajhøj Guest

    Roedy Green wrote:
    > Embedded in the DLLs is fluffy INDENTED XML
    >
    > This points to a "manifest" file (no relation to MFT files) that look
    > like this with seems to be a set of digital signatures.
    >
    > Microsoft.VC90.CRT.manifest:
    >
    > <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    > <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
    > manifestVersion="1.0">
    > <noInheritable></noInheritable>
    > <assemblyIdentity type="win32" name="Microsoft.VC90.CRT"
    > version="9.0.30729.1" processorArchitecture="x86"
    > publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    > <file name="msvcr90.dll" hashalg="SHA1"
    > hash="9785b1c493deb5b2134dc4aef3719cee207001bc"><asmv2:hash
    > xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
    > xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform
    > Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod
    > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>VF5ECUAHPV7EnUf+/UIXMPizPvs=</dsig:DigestValue></asmv2:hash></file>
    > <file name="msvcp90.dll" hashalg="SHA1"
    > hash="0f6bbf7fe4fb3fca2cb5b542eca1a1cad051f01c"><asmv2:hash
    > xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
    > xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform
    > Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod
    > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>3Wg+StVMq2uhx7POnAkl2w4dDmY=</dsig:DigestValue></asmv2:hash></file>
    > <file name="msvcm90.dll" hashalg="SHA1"
    > hash="7f3290ab2b7444c2b4a9b1fedfdb16466d7a21bb"><asmv2:hash
    > xmlns:asmv2="urn:schemas-microsoft-com:asm.v2"
    > xmlns:dsig="http://www.w3.org/2000/09/xmldsig#"><dsig:Transforms><dsig:Transform
    > Algorithm="urn:schemas-microsoft-com:HashTransforms.Identity"></dsig:Transform></dsig:Transforms><dsig:DigestMethod
    > Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"></dsig:DigestMethod><dsig:DigestValue>/YfRn7UQENzdMeoMHxTgdRMiObA=</dsig:DigestValue></asmv2:hash></file>
    > </assembly>


    How are you building ?

    I do not get stuff like that when building a Win32 DLL.

    It looks very much as if some .NET stuff has been included.

    I am rather confident that you can avoid that by using the proper
    command line switches.

    Arne
    Arne Vajhøj, Oct 12, 2008
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vasanth
    Replies:
    0
    Views:
    2,683
    vasanth
    Jan 25, 2005
  2. vasanth
    Replies:
    0
    Views:
    619
    vasanth
    Jan 25, 2005
  3. Roedy Green

    Puzzling warning message

    Roedy Green, Jul 31, 2005, in forum: Java
    Replies:
    20
    Views:
    921
    Thomas Hawtin
    Aug 5, 2005
  4. Replies:
    6
    Views:
    489
  5. Bill Cunningham

    puzzling error

    Bill Cunningham, May 5, 2011, in forum: C Programming
    Replies:
    49
    Views:
    1,167
    Bill Cunningham
    May 11, 2011
Loading...

Share This Page