From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ca9f0bcc5761b180,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-24 09:25:11 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sunqbc.risq.qc.ca!newsxfer3.itd.umich.edu!jobone!dailyplanet.srl.ford.com!eccws12.dearborn.ford.com!not-for-mail From: John Kern Newsgroups: comp.lang.ada Subject: Calling JGNAT task from a Java applet? Date: Wed, 24 Apr 2002 11:23:52 -0400 Organization: Visteon Coropration Message-ID: <3CC6CE08.20B944B2@NOSPAM.visteon.com> Reply-To: jkern3@NOSPAM.visteon.com NNTP-Posting-Host: 19.51.198.11 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.79 [en]C-c32f404p (WinNT; U) X-Accept-Language: en, en-GB, de, fr, ja, ko, zh Xref: archiver1.google.com comp.lang.ada:23063 Date: 2002-04-24T11:23:52-04:00 List-Id: Has anyone ever succeeded in calling an Ada task from a Java applet? I get the following runtime error when invoking my Java program containing: -------[snip]-------------from my applet Java code---- controller control; \\ control is of type controller public viod run() { control.init(); \\ init should initialize the Ada runtime Adainit \\ from ada_testcontroller.adainit with the line: D:\WSU\ECE7990\ControlProject\GUI>appletviewer otest.html java.lang.NoClassDefFoundError: jgnat/adalib/GNAT_libc at controller.init(controller.adb:41) at PhysicalPlant.run(PhysicalPlant.java, Compiled Code) at java.lang.Thread.run(Thread.java:472) followed when exiting the applet by: java.security.AccessControlException: access denied (java.lang.RuntimePermission modifyThread ) at java.security.AccessControlContext.checkPermission(AccessControlConte xt.java, Compiled Code) at java.security.AccessController.checkPermission(AccessController.java, Compiled Code) at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compi led Code) at sun.applet.AppletSecurity.checkAccess(AppletSecurity.java:106) at java.lang.Thread.checkAccess(Thread.java:1036) at java.lang.Thread.stop(Thread.java:560) at PhysicalPlant.stop(PhysicalPlant.java:727) at sun.applet.AppletPanel.run(AppletPanel.java:371) at java.lang.Thread.run(Thread.java:472) This is my controller.ads ------------------------------------- pragma Extensions_Allowed (On); with Java; use Java; package Controller is task Controller_Task; procedure Init; end Controller; pragma Export (Java, Controller, "controller"); pragma Extensions_Allowed (Off); --------------------------------------- This is my controller.adb: ------------------------------------------ pragma Extensions_Allowed (On); with Ada.Text_IO; use Ada.Text_IO; with Ada.Calendar; use Ada.Calendar; with Sensor_Interface; with Actuator_Interface; package body Controller is Start: Time; task body Controller_Task is Interval: constant Duration := 1.0; Next: Time := Clock + Interval; begin Start := Clock; loop delay until Next; Ada.Text_IO.put('*' & ascii.BEL); Ada.Text_IO.put_line(sensor_interface.position'image(sensor_interface.read_p osition)); Next := Next + Interval; end loop; end Controller_Task; procedure Init is procedure Adainit; pragma Import (Ada, Adainit, "ada_testcontroller.adainit"); begin Adainit; end Init; end Controller; pragma Extensions_Allowed (Off); --------------------------------------------- And this program testcontroller.adb ------------------------------------------ with Controller; use Controller; procedure testcontroller is begin null; end testcontroller; ------------------------------------------- runs fine with the commands: D:\WSU\ECE7990\ControlProject\GUI>java -version java version "1.2.2" Classic VM (build JDK-1.2.2_011, native threads, symcjit) D:\WSU\ECE7990\ControlProject\GUI>java testcontroller * 0.00000E+00 * 0.00000E+00 * 0.00000E+00 ^C D:\WSU\ECE7990\ControlProject\GUI> It seems like I can only get a runtime ada_testcontroller.class (containing adainit) when I build the testcontroller program, but it is not otherwise necessary for building the Java applet. I'm not sure what is being referred to by the initial error message: jgnat/adalib/GNAT_libc because my e:\gnat\jgnat-1.1p\lib\jgnat\adalib directory has no subdirectories nor a GNAT_libc file. Can anybody supply additional insight? TIA