<?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: Trouble creating a Java VM in mixed-language image in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727161#M33497</link>
    <description>Fletcher,&lt;BR /&gt;&lt;BR /&gt;from your traceback info, the ACCVIO (access to virtual address = 0) happens in DECC$SHR when called from JAVA_PROPS_MD setPathEnvironment&lt;BR /&gt;&lt;BR /&gt;ACCVIOs with VA=0 typically indicate missing/invalid parameters being passed to a called routine.&lt;BR /&gt;&lt;BR /&gt;If you write a C MAIN routine, which calls the BASIC routine, which then calls the JAVA VM, this may work. I'm assuming some initialization code from starting the C main program sets up things, which JAVA is expecting later-on.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
    <pubDate>Wed, 08 Feb 2006 13:00:53 GMT</pubDate>
    <dc:creator>Volker Halle</dc:creator>
    <dc:date>2006-02-08T13:00:53Z</dc:date>
    <item>
      <title>Trouble creating a Java VM in mixed-language image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727160#M33496</link>
      <description>I have a C function that creates a Java virtual machine:&lt;BR /&gt;&lt;BR /&gt;  #include &lt;JNI.H&gt;&lt;BR /&gt;  void CREATE_VM() {&lt;BR /&gt;    JavaVM *vm;&lt;BR /&gt;    void *env;&lt;BR /&gt;    JavaVMInitArgs vm_args;&lt;BR /&gt;&lt;BR /&gt;    vm_args.version = JNI_VERSION_1_4;&lt;BR /&gt;    vm_args.nOptions = 0;&lt;BR /&gt;    vm_args.ignoreUnrecognized = TRUE;&lt;BR /&gt;  &lt;BR /&gt;    JNI_CreateJavaVM(&amp;amp;vm, &amp;amp;env, &amp;amp;vm_args);&lt;BR /&gt;  }&lt;BR /&gt;&lt;BR /&gt;When I link this with a C mainline, like this:&lt;BR /&gt;&lt;BR /&gt;  void CREATE_VM();&lt;BR /&gt;  void main() { CREATE_VM(); }&lt;BR /&gt;&lt;BR /&gt;it completes successfully.  When I link it with a BASIC mainline, like this:&lt;BR /&gt;&lt;BR /&gt;  call CREATE_VM()&lt;BR /&gt;&lt;BR /&gt;it aborts with a memory management violation. I've tried this with Java 1.4.2 and 1.5.0 on OpenVMS V7.3-2.  Any ideas why this is happening or how I can successfully call Java from BASIC?&lt;BR /&gt;&lt;BR /&gt;Here's the MEMMANVIO stack dump:&lt;BR /&gt;&lt;BR /&gt;%BAS-F-MEMMANVIO, Memory management violation&lt;BR /&gt;-BAS-I-USEPC_PSL, at user PC=80AEAB60, PSL=0000001B&lt;BR /&gt;-SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000000000000, PC=FFFFFFFF80AEAB60, PS=0000001B&lt;BR /&gt;-BAS-I-FROMOD, In module MAIN&lt;BR /&gt;%TRACE-F-TRACEBACK, symbolic stack dump follows&lt;BR /&gt;  image    module    routine             line      rel PC           abs PC      &lt;BR /&gt; LIBRTL                                     0 000000000007093C FFFFFFFF8089A93C&lt;BR /&gt; LIBRTL                                                      ?                ?&lt;BR /&gt; DEC$BASRTL                                 0 000000000000EF9C 0000000000040F9C&lt;BR /&gt;----- above condition handler called with exception 0000000C:&lt;BR /&gt;%SYSTEM-F-ACCVIO, access violation, reason mask=00, virtual address=0000000000000000, PC=FFFFFFFF80AEAB60, PS=0000001B&lt;BR /&gt;----- end of exception message&lt;BR /&gt;                                            0 FFFFFFFF8009609C FFFFFFFF8009609C&lt;BR /&gt; DECC$SHR                                   0 0000000000142B60 FFFFFFFF80AEAB60&lt;BR /&gt; DECC$SHR                                                    ?                ?&lt;BR /&gt; DECC$SHR                                   0 00000000001427A8 FFFFFFFF80AEA7A8&lt;BR /&gt; DECC$SHR                                                    ?                ?&lt;BR /&gt; JAVA$JAVA_SHR  JAVA_PROPS_MD  setPathEnvironment&lt;BR /&gt;                                        11095 0000000000000284 00000000009F4144&lt;BR /&gt; JAVA$JAVA_SHR  JAVA_PROPS_MD  GetJavaProperties&lt;BR /&gt;                                        11501 00000000000009C0 00000000009F4880&lt;BR /&gt; JAVA$JAVA_SHR  SYSTEM  Java_java_lang_System_initProperties&lt;BR /&gt;                                        15593 0000000000000094 00000000009EC234&lt;BR /&gt;                                            0 000000004000E5FC 000000004000E5FC&lt;BR /&gt; JAVA$FVM_SHR                               0 00000000000CF14C 000000000066D14C&lt;BR /&gt; JAVA$FVM_SHR  ICALL  make_native_call  40313 00000000000009BC 0000000000660B2C&lt;BR /&gt; JAVA$FVM_SHR  INTERP  interpret        42533 0000000000000168 000000000060D2E8&lt;BR /&gt; JAVA$FVM_SHR  INTERP  enlarge_stack_and_interpret&lt;BR /&gt;                                        43699 00000000000002D4 000000000060D454&lt;BR /&gt; JAVA$FVM_SHR  INTERP  interpret        42554 0000000000000000 0000000000000000&lt;BR /&gt; JAVA$FVM_SHR  JNI  jni_call            44626 000000000000116C 00000000006134BC&lt;BR /&gt; JAVA$FVM_SHR  JNI  jni_CallStaticVoidMethodA&lt;BR /&gt;                                        45016 000000000000214C 000000000061449C&lt;BR /&gt; JAVA$FVM_SHR  JNI  jni_CallStaticVoidMethod&lt;BR /&gt;                                        45035 0000000000000000 0000000000000000&lt;BR /&gt; JAVA$FVM_SHR  THREAD  thread_init_main&lt;BR /&gt;                                        59346 00000000000031CC 000000000064688C&lt;BR /&gt; JAVA$FVM_SHR  JVM  JNI_CreateJavaVM    48778 00000000000003D4 000000000061A474&lt;BR /&gt; MAIN  CREATE_VM  CREATE_VM              3528 0000000000000050 00000000000200E0&lt;BR /&gt; MAIN  MAIN$MAIN  MAIN$MAIN                 1 0000000000000054 0000000000020054&lt;BR /&gt; PTHREAD$RTL                                0 0000000000055D58 00000000006F5D58&lt;BR /&gt; PTHREAD$RTL                                0 0000000000030404 00000000006D0404&lt;BR /&gt;                                            0 FFFFFFFF80261ED4 FFFFFFFF80261ED4&lt;/JNI.H&gt;</description>
      <pubDate>Wed, 08 Feb 2006 12:15:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727160#M33496</guid>
      <dc:creator>Fletcher Curry</dc:creator>
      <dc:date>2006-02-08T12:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble creating a Java VM in mixed-language image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727161#M33497</link>
      <description>Fletcher,&lt;BR /&gt;&lt;BR /&gt;from your traceback info, the ACCVIO (access to virtual address = 0) happens in DECC$SHR when called from JAVA_PROPS_MD setPathEnvironment&lt;BR /&gt;&lt;BR /&gt;ACCVIOs with VA=0 typically indicate missing/invalid parameters being passed to a called routine.&lt;BR /&gt;&lt;BR /&gt;If you write a C MAIN routine, which calls the BASIC routine, which then calls the JAVA VM, this may work. I'm assuming some initialization code from starting the C main program sets up things, which JAVA is expecting later-on.&lt;BR /&gt;&lt;BR /&gt;Volker.</description>
      <pubDate>Wed, 08 Feb 2006 13:00:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727161#M33497</guid>
      <dc:creator>Volker Halle</dc:creator>
      <dc:date>2006-02-08T13:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble creating a Java VM in mixed-language image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727162#M33498</link>
      <description>My guess would be that any use of JNI has implicit dependencies on the C run-time environment.  Since your BASIC program will not have a main() function like every C program does, you'll probably have to call DECC$CRTL_INIT, as documented for the C run-time.  Try the following to get started:&lt;BR /&gt;&lt;BR /&gt;$ help cc run decc$crtl_init</description>
      <pubDate>Wed, 08 Feb 2006 13:46:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727162#M33498</guid>
      <dc:creator>Craig A Berry</dc:creator>
      <dc:date>2006-02-08T13:46:24Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble creating a Java VM in mixed-language image</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727163#M33499</link>
      <description>Craig, That did the trick!  I added a call to DECC$CRTL_INIT at the top of CREATE_VM and it can now be called from either language.&lt;BR /&gt;&lt;BR /&gt;Volker, I'm guessing that your solution would also work, but I'm glad I don't have to write C wrappers for all of my existing BASIC programs, just so I can modify them to call my new JNI routine.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help!&lt;BR /&gt;&lt;BR /&gt;- Fletcher</description>
      <pubDate>Wed, 08 Feb 2006 15:26:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/trouble-creating-a-java-vm-in-mixed-language-image/m-p/3727163#M33499</guid>
      <dc:creator>Fletcher Curry</dc:creator>
      <dc:date>2006-02-08T15:26:23Z</dc:date>
    </item>
  </channel>
</rss>

