Term arg[] = { X };
org.jpl7.Query q = new org.jpl7.Query("p",arg);
while (q.hasMoreElements())
{
Term bound_to_x = (Term) ((Map) q.nextElement()).get("X");
System.out.println("prolog solution: "+bound_to_x);
}
7. Running the code I get:
javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
root cause
java.lang.UnsatisfiedLinkError: no jpl in java.library.path java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857) java.lang.Runtime.loadLibrary0(Runtime.java:870) java.lang.System.loadLibrary(System.java:1119) org.jpl7.JPL.loadNativeLibrary(JPL.java:79) org.jpl7.fli.Prolog.<clinit>(Prolog.java:41) org.jpl7.Query.open(Query.java:260) org.jpl7.Util.textToTerm(Util.java:102) org.jpl7.Query.Query1(Query.java:129) org.jpl7.Query.<init>(Query.java:120) org.semweb.lodz.search.ZHARTSearchUtilities.swiprolog_test(ZHARTSearchUtilities.java:1736) org.semweb.lodz.search.Actions.doGet(Actions.java:716) javax.servlet.http.HttpServlet.service(HttpServlet.java:618) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
This happens ONCE (as init code inside org.jpl7.Query) - on reload for the same servlet the exception is:
java.lang.NoClassDefFoundError: Could not initialize class org.jpl7.fli.Prolog org.jpl7.Query.open(Query.java:260) org.jpl7.Util.textToTerm(Util.java:102) org.jpl7.Query.Query1(Query.java:129) org.jpl7.Query.<init>(Query.java:120) org.semweb.lodz.search.ZHARTSearchUtilities.swiprolog_test(ZHARTSearchUtilities.java:1736) org.semweb.lodz.search.Actions.doGet(Actions.java:716) javax.servlet.http.HttpServlet.service(HttpServlet.java:618) javax.servlet.http.HttpServlet.service(HttpServlet.java:725) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
What else is "wrong" in my configuration?
Mr. Singleton, what about fixing this (maybe) or adding more verbosity so we spend more time on Prolog than on java paths ;) ?
Thank you very much in advance
Regards
--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Visit this group at http://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.
Nov 17, 2015 8:36:39 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [org.semweb.lodz.search.Actions] in context with path [/LODZSearch] threw exception [Servlet execution threw an exception] with root cause
java.lang.UnsatisfiedLinkError: /Applications/SWI-Prolog.app/Contents/swipl/lib/jpl.jar: dlopen(/Applications/SWI-Prolog.app/Contents/swipl/lib/jpl.jar, 1): no suitable image found. Did find:
/Applications/SWI-Prolog.app/Contents/swipl/lib/jpl.jar: unknown file type, first eight bytes: 0x50 0x4B 0x03 0x04 0x14 0x00 0x08 0x08
JPL.setNativeLibraryDir("/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/");
JPL.setNativeLibraryDir("/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.5.0/");
JPL.setNativeLibraryDir("/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin15.0.0/");
java.lang.UnsatisfiedLinkError: /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/libjpl.dylib: dlopen(/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/libjpl.dylib, 1): Library not loaded: /Users/janw/lib/swipl/lib/x86_64-darwin14.3.0/libswipl.dylib Referenced from: /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/libjpl.dylib Reason: image not found
file /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/libjpl.dylib
/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.3.0/libjpl.dylib: Mach-O 64-bit bundle x86_64
file /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.5.0/libjpl.dylib
/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin14.5.0/libjpl.dylib: Mach-O 64-bit bundle x86_64
file /Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin15.0.0/libjpl.dylib
/Applications/SWI-Prolog.app/Contents/swipl/lib/x86_64-darwin15.0.0/libjpl.dylib: Mach-O 64-bit bundle x86_64