<?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 Re: JNI_CreateJavaVM return Exec format error when called from shared library in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908705#M933170</link>
    <description>Another thing to also look into is the env var LD_PRELOAD (look for information about it in the ld man page) that will allow you to dynamically load libraries that contain thread local storage.  I don't know if you are doing that but it the error isn't bogus, that may solve that part of the problem.</description>
    <pubDate>Thu, 20 Feb 2003 21:46:00 GMT</pubDate>
    <dc:creator>susan gregory</dc:creator>
    <dc:date>2003-02-20T21:46:00Z</dc:date>
    <item>
      <title>JNI_CreateJavaVM return Exec format error when called from shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908703#M933168</link>
      <description>I am desperately looking for solution, Can somebody help me?&lt;BR /&gt;&lt;BR /&gt;Our tool has a Java and native component on unix box. It is runs okay on Alpha Tru64, we are trying to port it on HP-UX 11.11. &lt;BR /&gt;&lt;BR /&gt;The overall flow is as follows: &lt;BR /&gt;The Java Class 'A' needs to instantiate the Java class 'B' upon some event. The 'B' class can have multiple instances running at one time. In other words the 'B' needs to run either as a thread or a different process (to optimize the performance). The Thread approach is pretty much straight forward and works as it is. &lt;BR /&gt;&lt;BR /&gt;The Process aproach architecture: The java class 'B' calls the JNI code(native library written in C), the JNI library in turn calls the standalone process written in C (let's call it StartProcess). The StartProcess process calls the Java shared library libjvm.sl and invokes the Java program (Class 'B') by calling JNI_CreateJavaVM etc. It works perfectly fine on Alpha Tru64, but the call JNI_CreateJavaVM return following error message HP-UX. &lt;BR /&gt;&lt;BR /&gt;/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /op&lt;BR /&gt;t/java1.3/bin/../jre/lib/PA_RISC2.0/server/libjvm.sl&lt;BR /&gt;/usr/lib/dld.sl: Exec format error&lt;BR /&gt;Can't load library "/opt/java1.3/jre/lib/PA_RISC/libverify.sl", because specifie&lt;BR /&gt;d file is not a shared library, or a format error was detected.&lt;BR /&gt;can't create java vm                                              &lt;BR /&gt;When I call StartProcess process directly from the shell, it works okay (calls the class 'B') but returns error when called from the java program 'A'. I am suspecting the reason could be either because of Compiler options or my profile. I have looked into the HP documentation and have tried different compiler options, still not able to connect all pieces together. &lt;BR /&gt;Following are the compiler options I am giving currently &lt;BR /&gt;&lt;BR /&gt;Compiler Options:&lt;BR /&gt;For JNI library: &lt;BR /&gt;aCC -Ae +u4 +z -c -D_HPUX -DNATIVE -D_POSIX_C_SOURCE=199506L \ &lt;BR /&gt;   -I/opt/java1.3/include -I/opt/java1.3/include/hp-ux    \ &lt;BR /&gt;   ProcessImpl.c &lt;BR /&gt;&lt;BR /&gt;aCC  -b -o libprocessimpl.sl ProcessImpl.o \ &lt;BR /&gt;    -lCsup -lstream -lstd -lcl &lt;BR /&gt;&lt;BR /&gt;For standalone process (StartProcess) &lt;BR /&gt;aCC -z -g +u4 -c -Ae -D_HPUX  \ &lt;BR /&gt;   -DNATIVE -D_POSIX_C_SOURCE=199506L \ &lt;BR /&gt;   -I/opt/java1.3/include -I/opt/java1.3/include/hp-ux    \ &lt;BR /&gt;   StartProcess.c &lt;BR /&gt;&lt;BR /&gt;aCC -g -o StartProcess StartProcess.o -lpthread &lt;BR /&gt;</description>
      <pubDate>Wed, 19 Feb 2003 22:47:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908703#M933168</guid>
      <dc:creator>Angad</dc:creator>
      <dc:date>2003-02-19T22:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: JNI_CreateJavaVM return Exec format error when called from shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908704#M933169</link>
      <description>&lt;A href="http://www.hp.com/go/java" target="_blank"&gt;http://www.hp.com/go/java&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Get and install a current version of java.&lt;BR /&gt;&lt;BR /&gt;More important, whatever version you have, make sure its properly patched. The patch list for each version is on the site above.&lt;BR /&gt;&lt;BR /&gt;Lastly on HP-UX&lt;BR /&gt;&lt;BR /&gt;swverify \*&lt;BR /&gt;&lt;BR /&gt;Report any java errors to HP and get them corrected.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;BR /&gt;</description>
      <pubDate>Thu, 20 Feb 2003 20:43:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908704#M933169</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2003-02-20T20:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: JNI_CreateJavaVM return Exec format error when called from shared library</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908705#M933170</link>
      <description>Another thing to also look into is the env var LD_PRELOAD (look for information about it in the ld man page) that will allow you to dynamically load libraries that contain thread local storage.  I don't know if you are doing that but it the error isn't bogus, that may solve that part of the problem.</description>
      <pubDate>Thu, 20 Feb 2003 21:46:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/jni-createjavavm-return-exec-format-error-when-called-from/m-p/2908705#M933170</guid>
      <dc:creator>susan gregory</dc:creator>
      <dc:date>2003-02-20T21:46:00Z</dc:date>
    </item>
  </channel>
</rss>

