From pascal@rz.hu-berlin.de  Tue Jan 25 02:42:31 2000
Received: from suncom.rz.hu-berlin.de (suncom.rz.hu-berlin.de [141.20.1.31])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id CAA25228
	for <prolog@swi.psy.uva.nl>; Tue, 25 Jan 2000 02:42:30 +0100 (MET)
Received: from localhost.rz.hu-berlin.de (pascal@ppp196-32.rz.hu-berlin.de [141.20.196.32])
	by suncom.rz.hu-berlin.de (8.9.3/8.9.3) with ESMTP id CAA04576
	for <prolog@swi.psy.uva.nl>; Tue, 25 Jan 2000 02:42:21 +0100 (MET)
Received: (from pascal@localhost)
	by localhost (8.8.8/8.8.8/Debian/GNU) id CAA07318;
	Tue, 25 Jan 2000 02:43:23 +0100
Date: Tue, 25 Jan 2000 01:43:22 +0000 (GMT)
From: Pascal Vaillant <Pascal.Vaillant@rz.hu-berlin.de>
To: prolog@swi.psy.uva.nl
Subject: Yet another question about JPL
Message-ID: <Pine.LNX.4.05.10001250141200.7313-100000@ppp196-32.rz.hu-berlin.de>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from QUOTED-PRINTABLE to 8bit by swi.psy.uva.nl id CAA25228



Hello,

We are trying to use Fred Dushin's JPL package to pilot SWI-Prolog
from within a java program.

First, we implemented some test communication functions, by adapting
Fred's Test.java file skeleton. In text mode, on an xterm, everything
worked fine.

Now we are trying to integrate the same functions in our GUI. The
first expected task is to establish a connection to SWI-Prolog, when
a button is pressed. But it fails immediately at that point.

We fear the problem might be linked to implicit java threads. However
we get some error message about the JPL/Atom class not being found,
and are worrying about why the same classes with the same environment
fail to be loaded in this context.

Here are some pieces of code, in case somebody could easily spot the
problem. Apologies in advance if this is a trivial problem!


 Context description:
 Pressed button: jButtonC1
 ....
     jButtonC1.addActionListener(new java.awt.event.ActionListener() {
       public void actionPerformed(ActionEvent e) {
         generateGraph_actionPerformed(e);
       }
     });
 ...
    void generateGraph_actionPerformed(ActionEvent e) {
    System.out.println("Testing the jpl interface");
    java.lang.String myargs[]={ "pl", "-x", "allglottai", "-g", "true" };
    glottaiInterface.jpl_init(myargs);
 ...
    System.out.println("JPL connected ...");
   }

 ... and in glottaiInterface:

     public static void
	 jpl_init(java.lang.String exeString[])
     {
 ...
	 JPL.init(exeString);
 ...
     }



We get these error messages:


 Testing the jpl interface
 java.lang.NoClassDefFoundError: jpl/Atom
         at 
         at glottai.gui.glottaiFrame.generateGraph_actionPerformed(glottaiFrame.java:404)
         at glottai.gui.glottaiFrame$4.actionPerformed(glottaiFrame.java:172)
         at com.sun.java.swing.AbstractButton.fireActionPerformed(AbstractButton.java:860)
         at com.sun.java.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:895)
         at com.sun.java.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:338)
         at com.sun.java.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:230)
         at com.sun.java.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:156)
         at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:235)
         at java.awt.Component.processMouseEvent(Component.java:2284)
         at java.awt.Component.processEvent(Component.java:2129)
         at java.awt.Container.processEvent(Container.java:894)
         at java.awt.Component.dispatchEventImpl(Component.java:1764)
         at java.awt.Container.dispatchEventImpl(Container.java:939)
         at java.awt.Component.dispatchEvent(Component.java:1704)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:1548)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:1457)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:1392)
         at java.awt.Container.dispatchEventImpl(Container.java:926)
         at java.awt.Component.dispatchEvent(Component.java:1704)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:63)


(If somebody may give an example of function which successfully
calls JPL functions on the pressing of buttons?)

Many thanks in advance,

Michèle and Pascal Vaillant


--
Pascal Vaillant                                Jägerstraße 10/11
Humboldt Universität zu Berlin                 10117 Berlin (Allemagne)
Lehstuhl Computerlinguistik                    Tel: (+49/30) 20 19 25 54

