2010-02-12 10 views
0

Je vais avoir un temps assez rude pour essayer d'utiliser des interprologJava/Prolog aide - dépannage

J'ai un code, essayez d'appeler une commande Prolog et le problème est le chargement réel de ma base de données Prolog . Voici le code:

myEngine = new NativeEngine(); 
    myEngine.consultFromPackage("userlist.p", LoginHandler.class); 
    boolean x = myEngine.deterministicGoal("has_access(user,pass)"); 

quand je lance le programme Prolog initialise bien, il essaie de chercher userlist.p qui est dans le même package (2ème ligne de code), puis il jette cette erreur:

Exception in thread "AWT-EventQueue-0" com.declarativa.interprolog.util.IPException: Problem consulting from package archive:C:\Users\Keval\AppData\Local\Temp\IP_6971701367857416872\userlist.p 
at com.declarativa.interprolog.AbstractPrologEngine.consultFromPackage(AbstractPrologEngine.java) 
at handlers.LoginHandler.actionPerformed(LoginHandler.java:25) 
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) 
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) 
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) 
at javax.swing.DefaultButtonModel.setPressed(Unknown Source) 
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) 
at java.awt.Component.processMouseEvent(Unknown Source) 
at javax.swing.JComponent.processMouseEvent(Unknown Source) 
at java.awt.Component.processEvent(Unknown Source) 
at java.awt.Container.processEvent(Unknown Source) 
at java.awt.Component.dispatchEventImpl(Unknown Source) 
at java.awt.Container.dispatchEventImpl(Unknown Source) 
at java.awt.Component.dispatchEvent(Unknown Source) 
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
at java.awt.Container.dispatchEventImpl(Unknown Source) 
at java.awt.Window.dispatchEventImpl(Unknown Source) 
at java.awt.Component.dispatchEvent(Unknown Source) 
at java.awt.EventQueue.dispatchEvent(Unknown Source) 
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
at java.awt.EventDispatchThread.run(Unknown Source) 

J'ai regardé le code pour consultFromPackage:

public void consultFromPackage(String filename,Object requester){ 
     String path = cleanPath(copyToTemp(filename,requester).getPath()); 
     path = unescapedFilePath(path); 
     progressMessage("consultFromPackage:"+path); 
     if (!command("consult('"+path+"')")) 
     throw new IPException("Problem consulting from package archive:"+path); 
    } 

mais je ne peux pas sembler aller à la racine du problem..i sait tout cela est un peu loin, mais toute aide est apprécié à ce stade.

grâce

+0

quelqu'un? des idées appréciées. – KP65

Répondre

0

Je suppose qu'il ya quelque chose qui ne va pas avec les chemins et il ne trouve pas user.p dans l'emplacement où il attend. Essayez de démarrer avec un programme de test en ligne de commande minimal pour avoir une idée de la façon dont les bibliothèques fonctionnent dans un prototype simple.