<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Loading native library fails within a Java program in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730823#M721853</link>
    <description>I have written a simple Java file that simply loads a native library file using System.loadLibrary(). The native library file name is libACE.sl. MY java file is as follows:&lt;BR /&gt;&lt;BR /&gt;import java.lang.Throwable;&lt;BR /&gt;&lt;BR /&gt;class LoadNative {&lt;BR /&gt;public static void main(String args[])&lt;BR /&gt;  {&lt;BR /&gt;   String libname = "ACE";&lt;BR /&gt;&lt;BR /&gt;    try &lt;BR /&gt; {&lt;BR /&gt;    System.loadLibrary(libname);&lt;BR /&gt;    System.out.println("Library " +&lt;BR /&gt;    libname + " successfully loaded");  &lt;BR /&gt;     }&lt;BR /&gt;      catch (UnsatisfiedLinkError Err) &lt;BR /&gt;   {&lt;BR /&gt;    //System.out.println("error: " + Err);&lt;BR /&gt;    Err.printStackTrace();&lt;BR /&gt;    //return;&lt;BR /&gt;     }&lt;BR /&gt;    System.out.println("All done");&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I have set my SHLIB_PATH to include the directory that contains libACE.sl. The Java program compiles sucessfully, however when run (using java LoadNative) it throws the following exception:&lt;BR /&gt;&lt;BR /&gt;aCC runtime: Error 215 from shl_findsym(./libACE.sl,_shlInit)&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: openprot__7filebuf (data)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: cerr (data)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: typeid__XT9streambuf_ (data)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: xsputn__9streambufFPCci (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __dt__9streambufFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ls__7ostreamFPCc (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: flush__7ostreamFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: doallocate__9streambufFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: open__8ofstreamFPCciT2 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: tellp__7ostreamFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: close__11fstreambaseFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ct__9streambufFv_2 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ct__8ofstreamFPCciT2 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: seekoff__9streambufFlQ2_3ios8seek_diri (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __dt__13Iostream_initFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ct__13Iostream_initFv_1 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: seekpos__9streambufFli (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: setbuf__9streambufFPci (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: pbackfail__9streambufFi (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: xsgetn__9streambufFPci (code)  from ./libACE.sl&lt;BR /&gt;Abort(coredump)&lt;BR /&gt;&lt;BR /&gt;Can anyone make any sence of this error and let me know how I can avoid it? I havent got a clue!&lt;BR /&gt;&lt;BR /&gt;I'm using HP-UX 11.11 with aCC compiler version 3.33&lt;BR /&gt;The libACE.sl library is an existing 3rd party library. I require to load this library in a project i'm doing hence the development of the test Java application! Also worth noting is I can re build the libACE.sl file if required using what ever compiler switches that maybe be needed.</description>
    <pubDate>Fri, 24 May 2002 02:53:25 GMT</pubDate>
    <dc:creator>Chamitha</dc:creator>
    <dc:date>2002-05-24T02:53:25Z</dc:date>
    <item>
      <title>Loading native library fails within a Java program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730823#M721853</link>
      <description>I have written a simple Java file that simply loads a native library file using System.loadLibrary(). The native library file name is libACE.sl. MY java file is as follows:&lt;BR /&gt;&lt;BR /&gt;import java.lang.Throwable;&lt;BR /&gt;&lt;BR /&gt;class LoadNative {&lt;BR /&gt;public static void main(String args[])&lt;BR /&gt;  {&lt;BR /&gt;   String libname = "ACE";&lt;BR /&gt;&lt;BR /&gt;    try &lt;BR /&gt; {&lt;BR /&gt;    System.loadLibrary(libname);&lt;BR /&gt;    System.out.println("Library " +&lt;BR /&gt;    libname + " successfully loaded");  &lt;BR /&gt;     }&lt;BR /&gt;      catch (UnsatisfiedLinkError Err) &lt;BR /&gt;   {&lt;BR /&gt;    //System.out.println("error: " + Err);&lt;BR /&gt;    Err.printStackTrace();&lt;BR /&gt;    //return;&lt;BR /&gt;     }&lt;BR /&gt;    System.out.println("All done");&lt;BR /&gt;    }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;I have set my SHLIB_PATH to include the directory that contains libACE.sl. The Java program compiles sucessfully, however when run (using java LoadNative) it throws the following exception:&lt;BR /&gt;&lt;BR /&gt;aCC runtime: Error 215 from shl_findsym(./libACE.sl,_shlInit)&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: openprot__7filebuf (data)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: cerr (data)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: typeid__XT9streambuf_ (data)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: xsputn__9streambufFPCci (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __dt__9streambufFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ls__7ostreamFPCc (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: flush__7ostreamFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: doallocate__9streambufFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: open__8ofstreamFPCciT2 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: tellp__7ostreamFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: close__11fstreambaseFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ct__9streambufFv_2 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ct__8ofstreamFPCciT2 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: seekoff__9streambufFlQ2_3ios8seek_diri (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __dt__13Iostream_initFv (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: __ct__13Iostream_initFv_1 (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: seekpos__9streambufFli (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: setbuf__9streambufFPci (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: pbackfail__9streambufFi (code)  from ./libACE.sl&lt;BR /&gt;/usr/lib/dld.sl: Unresolved symbol: xsgetn__9streambufFPci (code)  from ./libACE.sl&lt;BR /&gt;Abort(coredump)&lt;BR /&gt;&lt;BR /&gt;Can anyone make any sence of this error and let me know how I can avoid it? I havent got a clue!&lt;BR /&gt;&lt;BR /&gt;I'm using HP-UX 11.11 with aCC compiler version 3.33&lt;BR /&gt;The libACE.sl library is an existing 3rd party library. I require to load this library in a project i'm doing hence the development of the test Java application! Also worth noting is I can re build the libACE.sl file if required using what ever compiler switches that maybe be needed.</description>
      <pubDate>Fri, 24 May 2002 02:53:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730823#M721853</guid>
      <dc:creator>Chamitha</dc:creator>
      <dc:date>2002-05-24T02:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Loading native library fails within a Java program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730824#M721854</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;Do you have&lt;BR /&gt;&lt;BR /&gt;Patch Name: PHSS_26263&lt;BR /&gt;&lt;BR /&gt;Patch Description: s700_800 11.11 ld(1) and linker tools cumulative patch&lt;BR /&gt;&lt;BR /&gt;Creation Date: 02/04/12&lt;BR /&gt;&lt;BR /&gt;Post Date:  02/04/18&lt;BR /&gt;&lt;BR /&gt;Hardware Platforms - OS Releases:&lt;BR /&gt; s700: 11.11&lt;BR /&gt; s800: 11.11&lt;BR /&gt;  The new dynamic linker has support for a new&lt;BR /&gt;     environment variable LD_PRELOAD through which libraries&lt;BR /&gt;     can be dynamically loaded and used for symbol&lt;BR /&gt;     resolution.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;                  Steve Steel</description>
      <pubDate>Fri, 24 May 2002 08:27:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730824#M721854</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2002-05-24T08:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Loading native library fails within a Java program</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730825#M721855</link>
      <description>Those missing symbols come from libstream.sl.  It looks like the java command is linked with libCsup but not libstream.  You may get your shared library working by linking it with -lstream.  There is a working example of aCC jni at&lt;BR /&gt;&lt;A href="http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html#java_native_ac++" target="_blank"&gt;http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1_3/JNI_java2.html#java_native_ac++&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Follow the link line from that example.</description>
      <pubDate>Tue, 28 May 2002 15:18:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/loading-native-library-fails-within-a-java-program/m-p/2730825#M721855</guid>
      <dc:creator>Mike Stroyan</dc:creator>
      <dc:date>2002-05-28T15:18:51Z</dc:date>
    </item>
  </channel>
</rss>

