Hi,
Note: you probably shouldn't have sent the 200K DLL to the mailing
list -- people don't like that much.
Anyway, I believe the problem here is that HelloWorld isn't a public
class. Try it yourself -- you can't create an instance of a non-public
class from a different package, even if the non-public class is in the
default (unnamed) package. Hence Jess's code, in the 'jess' package,
can't create an instance of the non-public HelloWorld class.
Make HelloWorld public, and you should be good to go.
I think [EMAIL PROTECTED] wrote:
> Hello,
>
> I am trying to create an interface between Jess and a program called Saphira.
> A Saphira client program has several C functions that can start and control
> a robot. I am using JDK1.3.1 and Jess 60a5. I am also using JNI to
> interface Java. I have created a Java file (poorly) named HelloWorld.java
> that declares the C functions as native. I have created a HelloWord.h file
> that provides the required JNI format for the functions. I have written a
> HelloWorldImp.c file that defines the functions. I built a hello.dll dynamic
> library from this. Finally I have a RobotMain.java file that creates a Jess
> engine and attempts to start Saphira and issue a few commands. It works fine
> in Java, but I am confused on how to get it to work in Jess. In Java, I
> create a new instance and then I can call the defined functions:
>
> HelloWorld rob = new HelloWorld();
> rob.displayHelloWord();
> rob.hideWorld();
>
> When I try to do this with Jess:
>
> Rete r = new Rete();
> r.executeCommand("(global ?*rob* = (new HelloWorld))");
> r.executeCommand("(defrule intro => (call ?*rob* displayHelloWorld))");
> r.reset();
> r.run();
>
> I get an error message that the Constructor is not found. It is true that
> there is no explicitly defined constructor, but I did not think that it was
> required. I tried to add one to the HelloWorld.java file, but it still
> failed with a message that the Class or constructor was not accessible. Any
> ideas? I have attached the files.
>
>
>
> MJ
[Attachment, skipping...]
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------