Re: [eclipse-clp-users] Java error messages

From: Gregory Harman <greg_at_...171...>
Date: Wed, 4 Mar 2009 00:24:29 -0500
Thanks, Joachim. I've been using EmbeddedEclipse, but with queues  
since I need to get a result out that can't come as a goal variable  
due to the Java interface's substitution of nulls for anonymous  
variables. I suppose I could grab stderr for this purpose - I was just  
expecting a thrown exception (Throw) to come with a message - on the  
Java side, that's really the right place for it.

-Greg

On Mar 3, 2009, at 8:39 PM, Joachim Schimpf wrote:

> Paul Davern wrote:
>> Hello Gregory,
>>
>> In my experience of using the Java interface you can get no more  
>> information
>> than "there was an error". However, the error usually indicates  
>> that ECLiPSe
>> is unhappy with the goal you sent it and tells you so; except as  
>> far as I am
>> aware the Java interface swallows the message.
>
> If you use an EmmbeddedEclipse, you should see the error messages
> (provided you don't set the UseQueues option):
>
> import com.parctechnologies.eclipse.*;
> import java.io.*;
> public class ErrTest
> {
>   public static void main(String[] args) throws Exception
>   {
>     EclipseEngineOptions eclipseEngineOptions = new  
> EclipseEngineOptions();
>     EclipseEngine eclipse =  
> EmbeddedEclipse.getInstance(eclipseEngineOptions);
>     eclipse.rpc("no_such_predicate");
>   }
> }
>
> % javac -classpath /home/jschimpf/Eclipse/6.0_65/lib/eclipse.jar  
> ErrTest.java
> % java -classpath /home/jschimpf/Eclipse/6.0_65/lib/eclipse.jar:.
> -Declipse.directory=/home/jschimpf/Eclipse/6.0_65 ErrTest
> calling an undefined procedure no_such_predicate in module eclipse   
> <<<<HERE
> Exception in thread "main" com.parctechnologies.eclipse.Throw
>
>
>
> In OutOfProcessEclipse, some flushing was missing.  I have fixed this
> just now, but you can work around the problem by adding the line
> eclipse.rpc("set_stream_property(error,flush,end_of_line)");
> immediately after initialising your eclipse:
>
> import com.parctechnologies.eclipse.*;
> import java.io.*;
> public class ErrTest
> {
>   public static void main(String[] args) throws Exception
>   {
>     EclipseEngineOptions eclipseEngineOptions = new  
> EclipseEngineOptions();
>     OutOfProcessEclipse eclipse = new  
> OutOfProcessEclipse(eclipseEngineOptions);
>     eclipse.rpc("set_stream_property(error,flush,end_of_line)");
>     eclipse.rpc("no_such_predicate");
>   }
> }
>
> % javac -classpath /home/jschimpf/Eclipse/6.0_65/lib/eclipse.jar  
> ErrTest.java
> % java -classpath /home/jschimpf/Eclipse/6.0_65/lib/eclipse.jar:.
> -Declipse.directory=/home/jschimpf/Eclipse/6.0_65 ErrTest
> calling an undefined procedure no_such_predicate in module eclipse    
> <<<<HERE
> Exception in thread "main" com.parctechnologies.eclipse.Throw
>
>
> -- Joachim
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San  
> Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the  
> Enterprise
> -Strategies to boost innovation and cut costs with open source  
> participation
> -Receive a $600 discount off the registration fee with the source  
> code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> ECLiPSe-CLP-Users mailing list
> ECLiPSe-CLP-Users_at_lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/eclipse-clp-users
Received on Wed Mar 04 2009 - 05:24:50 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST