|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
Error "undefined symbol: PL_new_atom" using jpl on Ubuntu 9.04Hello,
I'm trying to use a system built upon Swi-prolog (blipkit) through jpl for integration into a Java project. OS: Ubuntu 9.04. SWI-Prolog version: 5.7.15 (Checked out from Git and compiled from source, including all packages) Blipkit works fine on my system when starting blip from the commandline (Blipkit is basically a SWI-Prolog shell that loads extra prolog modules at startup). But when I try to load the same modules from Java, via jpl, I constantly get this error: /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/bin/java: symbol lookup error: /usr/local/lib/pl-5.7.15/lib/i686-linux/sgml2pl.so: undefined symbol: PL_new_atom I think I've located the defenition of PL_new_atom, to the file src/pl-fli.c:282 but nothing seems wrong with that. Furthermore, the JPL Java test "Test" in the examples folder works well. "make check" results in a whole lot of errors though (but I read somewhere that the tests for this one checks very specific paths to the java bin et.c. which I suppose could easily differ between systems). So, trying to figure out a possible reason. In the packages/jpl/ISSUES file there is some information which makes me thinking if it can be relevant here, but of which I don't fully understand the consequences: packages/jpl/ISSUES says: > <snip> ...If > libjpl.so is loaded directly from Java it will use the Prolog kernel > included in libjpl.so. If it is invoked through Prolog, the Prolog > application is before libjpl.so in the ELF search path and therefore all > Prolog symbols are resolved against the application. Could this mean that when prolog is started from Java, it does not have access to the same shared libraries et.c. (for example the definitions for PL_new_atom), or am I wrong? Any other hints, or anybody else having experience from working with the jpl on Ubuntu? Any hints are welcome! Kind Regards Samuel Lampa Masters project student Dept. of Pharm. Biosciences Uppsala University, Sweden Project blog: http://saml.ril Attached below is the output from "make check" in the packages/jpl folder, for reference: (cd src/java && make test_jar) make[1]: Entering directory `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' make[1]: Nothing to be done for `test_jar'. make[1]: Leaving directory `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' pl -q -f test_jpl.pl -g run_tests,halt -t 'halt(1)' ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: '$open_shared_object'/3: libjava.so: cannot open shared object file: No such file or directory ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: library `java' does not exist (Please add directory holding libjava.so to $LD_LIBRARY_PATH) Warning: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: Goal (directive) failed: jpl:initialization(setup_jvm, now) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4638: Exported procedure jpl:jpl_c_lib_version/1 is not defined ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:20: test ancestor_types_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:29: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:39: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:48: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:60: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:74: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:86: error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:112: error in setup: jpl:jNewIntArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:121: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:136: test call_static_param_cyclic_term_1: wrong error ERROR: Expected: error(type_error(acyclic, f(**)), context(jpl_call/4, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:148: error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:161: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:174: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:187: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:199: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:211: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:223: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:235: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:247: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:259: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:272: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:285: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:297: test get_field_static_boolean_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:306: test get_field_static_boolean_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:315: test get_field_static_char_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:324: test get_field_static_char_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:333: error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:345: test list_to_array_1: received error: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:355: test method_static_byte_1: wrong error ERROR: Expected: error(type_error(method_params, [-129]), context(jpl_call/4, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:367: test method_static_echo_boolean_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:379: test method_static_echo_boolean_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:391: test method_static_echo_char_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:403: test method_static_echo_char_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:415: test method_static_char_3: wrong error ERROR: Expected: error(type_error(method_params, [-1]), context(jpl_call/4, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:430: test method_static_char_4: wrong error ERROR: Expected: error(type_error(method_params, [1.0]), context(jpl_call/4, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:445: test method_static_char_5: wrong error ERROR: Expected: error(type_error(method_params, [a]), context(jpl_call/4, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:460: test method_static_echo_double_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:472: test method_static_echo_double_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:484: test method_static_echo_double_3: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:500: test method_static_echo_float_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:512: test method_static_echo_float_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:525: test method_static_echo_float_3: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:558: test new_abstract_class_1: wrong error ERROR: Expected: error(type_error(concrete_class, 'java.util.Dictionary'), context(jpl_new/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:573: test new_array_boolean_from_val_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:586: test new_array_double_from_val_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:599: test new_array_float_from_val_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:612: test new_interface_1: wrong error ERROR: Expected: error(type_error(concrete_class, 'java.util.Enumeration'), context(jpl_new/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:627: test new_param_cyclic_term_1: wrong error ERROR: Expected: error(type_error(acyclic, f(**)), context(jpl_new/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:642: test prolog_calls_java_calls_prolog_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:652: error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:668: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:683: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:698: test set_field_bad_field_spec_1: wrong error ERROR: Expected: error(type_error(field_name, 3.7), context(jpl_set/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:713: error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:729: error in setup: jpl:jNewLongArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:738: error in setup: jpl:jNewIntArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:756: error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:766: test set_field_static_bad_type_1: wrong error ERROR: Expected: error(type_error(boolean, 27), context(jpl_set/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:781: test set_field_static_boolean_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:790: test set_field_static_boolean_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:799: test set_field_static_boolean_bad_1: wrong error ERROR: Expected: error(type_error(field_value, foo(bar)), context(jpl_set/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:814: test set_field_static_cyclic_term_1: wrong error ERROR: Expected: error(type_error(acyclic, f(**)), context(jpl_set/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:829: test set_field_static_final_int_1: wrong error ERROR: Expected: error(permission_error(modify, final_field, fieldStaticFinalInt), context(jpl_set/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:852: test set_field_static_term_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:869: test set_field_static_term_2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:882: error in setup: jpl:jNewBooleanArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:896: error in setup: jpl:jNewBooleanArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:910: error in setup: jpl:jNewBooleanArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:926: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:940: error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:956: error in setup: jpl:jNewCharArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:970: error in setup: jpl:jNewDoubleArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:984: error in setup: jpl:jNewFloatArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:998: error in setup: jpl:jNewFloatArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1013: error in setup: jpl:jNewFloatArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1031: error in setup: jpl:jNewLongArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1048: error in setup: jpl:jNewLongArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1067: error in setup: jpl:jNewBooleanArray/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1086: test set_get_field_static_long_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1102: test set_non_accessible_field_1: wrong error ERROR: Expected: error(existence_error(field, gagaga), context(jpl_set/3, A)) ERROR: Got: error(existence_error(procedure, jpl:jni_func/3), context(jpl:jFindClass/2, B)) ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1114: test terms_to_array_1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /usr/local/lib/pl-5.7.15/library/jpl.pl:32: module/2: No permission to redefine module `jpl' (Already loaded from /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl) ERROR: Failed to load /usr/local/lib/pl-5.7.15/library/jpl ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1137: test versions_1: received error: plunit_jpl:'unit body'/2: Undefined procedure: plunit_jpl:jpl_c_lib_version/1 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1162: test fac10: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1167: test threads1: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1176: test threads2: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1181: test threads3: received error: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1198: test jref1: received error: plunit_jpl:'unit body'/2: Undefined procedure: jpl:jni_term_to_jref/2 make: *** [check_pl] Error 1 _______________________________________________ SWI-Prolog mailing list SWI-Prolog@... https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog |
|
|
Re: Error "undefined symbol: PL_new_atom" using jpl on Ubuntu 9.04You need to add the LD_PRELOAD environment variable. In it, specify
the location of the swipl libraries. There's a more detailed post in the mailing list which is where I found how to do it. Cheers, Andrew Quoting Samuel Lampa <samuel.lampa.l@...>: > Hello, > > I'm trying to use a system built upon Swi-prolog (blipkit) through > jpl for integration into a Java project. > > OS: Ubuntu 9.04. > SWI-Prolog version: 5.7.15 (Checked out from Git and compiled from > source, including all packages) > > Blipkit works fine on my system when starting blip from the > commandline (Blipkit is basically a SWI-Prolog shell that loads > extra prolog modules at startup). But when I try to load the same > modules from Java, via jpl, I constantly get this error: > > /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/bin/java: symbol lookup error: > /usr/local/lib/pl-5.7.15/lib/i686-linux/sgml2pl.so: undefined > symbol: PL_new_atom > > I think I've located the defenition of PL_new_atom, to the file > src/pl-fli.c:282 but nothing seems wrong with that. > > Furthermore, the JPL Java test "Test" in the examples folder works > well. "make check" results in a whole lot of errors though (but I > read somewhere that the tests for this one checks very specific > paths to the java bin et.c. which I suppose could easily differ > between systems). > > So, trying to figure out a possible reason. > > In the packages/jpl/ISSUES file there is some information which > makes me thinking if it can be relevant here, but of which I don't > fully understand the consequences: > > packages/jpl/ISSUES says: >> <snip> ...If >> libjpl.so is loaded directly from Java it will use the Prolog kernel >> included in libjpl.so. If it is invoked through Prolog, the Prolog >> application is before libjpl.so in the ELF search path and therefore all >> Prolog symbols are resolved against the application. > > Could this mean that when prolog is started from Java, it does not > have access to the same shared libraries et.c. (for example the > definitions for PL_new_atom), or am I wrong? > > Any other hints, or anybody else having experience from working with > the jpl on Ubuntu? > Any hints are welcome! > > Kind Regards > Samuel Lampa > Masters project student > Dept. of Pharm. Biosciences > Uppsala University, Sweden > Project blog: http://saml.ril > > Attached below is the output from "make check" in the packages/jpl > folder, for reference: > > (cd src/java && make test_jar) > make[1]: Entering directory > `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' > make[1]: Nothing to be done for `test_jar'. > make[1]: Leaving directory > `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' > pl -q -f test_jpl.pl -g run_tests,halt -t 'halt(1)' > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: > '$open_shared_object'/3: libjava.so: cannot open shared object > file: No such file or directory > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: > library `java' does not exist (Please add directory holding > libjava.so to $LD_LIBRARY_PATH) > Warning: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: > Goal (directive) failed: jpl:initialization(setup_jvm, now) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4638: > Exported procedure jpl:jpl_c_lib_version/1 is not defined > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:20: > test ancestor_types_1: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:29: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:39: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:48: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:60: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:74: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:86: > error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:112: > error in setup: jpl:jNewIntArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:121: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:136: > test call_static_param_cyclic_term_1: wrong error > ERROR: Expected: error(type_error(acyclic, f(**)), > context(jpl_call/4, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:148: > error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:161: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:174: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:187: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:199: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:211: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:223: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:235: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:247: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:259: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:272: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:285: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:297: > test get_field_static_boolean_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:306: > test get_field_static_boolean_2: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:315: > test get_field_static_char_1: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:324: > test get_field_static_char_2: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:333: > error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:345: > test list_to_array_1: received error: jpl:jNewByteArray/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:355: > test method_static_byte_1: wrong error > ERROR: Expected: error(type_error(method_params, [-129]), > context(jpl_call/4, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:367: > test method_static_echo_boolean_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:379: > test method_static_echo_boolean_2: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:391: > test method_static_echo_char_1: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:403: > test method_static_echo_char_2: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:415: > test method_static_char_3: wrong error > ERROR: Expected: error(type_error(method_params, [-1]), > context(jpl_call/4, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:430: > test method_static_char_4: wrong error > ERROR: Expected: error(type_error(method_params, [1.0]), > context(jpl_call/4, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:445: > test method_static_char_5: wrong error > ERROR: Expected: error(type_error(method_params, [a]), > context(jpl_call/4, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:460: > test method_static_echo_double_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:472: > test method_static_echo_double_2: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:484: > test method_static_echo_double_3: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:500: > test method_static_echo_float_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:512: > test method_static_echo_float_2: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:525: > test method_static_echo_float_3: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:558: > test new_abstract_class_1: wrong error > ERROR: Expected: error(type_error(concrete_class, > 'java.util.Dictionary'), context(jpl_new/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:573: > test new_array_boolean_from_val_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:586: > test new_array_double_from_val_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:599: > test new_array_float_from_val_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:612: > test new_interface_1: wrong error > ERROR: Expected: error(type_error(concrete_class, > 'java.util.Enumeration'), context(jpl_new/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:627: > test new_param_cyclic_term_1: wrong error > ERROR: Expected: error(type_error(acyclic, f(**)), context(jpl_new/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:642: > test prolog_calls_java_calls_prolog_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:652: > error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:668: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:683: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:698: > test set_field_bad_field_spec_1: wrong error > ERROR: Expected: error(type_error(field_name, 3.7), > context(jpl_set/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:713: > error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:729: > error in setup: jpl:jNewLongArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:738: > error in setup: jpl:jNewIntArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:756: > error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:766: > test set_field_static_bad_type_1: wrong error > ERROR: Expected: error(type_error(boolean, 27), context(jpl_set/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:781: > test set_field_static_boolean_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:790: > test set_field_static_boolean_2: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:799: > test set_field_static_boolean_bad_1: wrong error > ERROR: Expected: error(type_error(field_value, foo(bar)), > context(jpl_set/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:814: > test set_field_static_cyclic_term_1: wrong error > ERROR: Expected: error(type_error(acyclic, f(**)), context(jpl_set/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:829: > test set_field_static_final_int_1: wrong error > ERROR: Expected: error(permission_error(modify, final_field, > fieldStaticFinalInt), context(jpl_set/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:852: > test set_field_static_term_1: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:869: > test set_field_static_term_2: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:882: > error in setup: jpl:jNewBooleanArray/2: Undefined procedure: > jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:896: > error in setup: jpl:jNewBooleanArray/2: Undefined procedure: > jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:910: > error in setup: jpl:jNewBooleanArray/2: Undefined procedure: > jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:926: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:940: > error in setup: jpl:jNewByteArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:956: > error in setup: jpl:jNewCharArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:970: > error in setup: jpl:jNewDoubleArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:984: > error in setup: jpl:jNewFloatArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:998: > error in setup: jpl:jNewFloatArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1013: > error in setup: jpl:jNewFloatArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1031: > error in setup: jpl:jNewLongArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1048: > error in setup: jpl:jNewLongArray/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1067: > error in setup: jpl:jNewBooleanArray/2: Undefined procedure: > jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1086: > test set_get_field_static_long_1: received error: > jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1102: > test set_non_accessible_field_1: wrong error > ERROR: Expected: error(existence_error(field, gagaga), > context(jpl_set/3, A)) > ERROR: Got: error(existence_error(procedure, > jpl:jni_func/3), context(jpl:jFindClass/2, B)) > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1114: > test terms_to_array_1: received error: jpl:jFindClass/2: > Undefined procedure: jpl:jni_func/3 > ERROR: /usr/local/lib/pl-5.7.15/library/jpl.pl:32: > module/2: No permission to redefine module `jpl' (Already loaded > from /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl) > ERROR: Failed to load /usr/local/lib/pl-5.7.15/library/jpl > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1137: > test versions_1: received error: plunit_jpl:'unit body'/2: > Undefined procedure: plunit_jpl:jpl_c_lib_version/1 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1162: > test fac10: received error: jpl:jFindClass/2: Undefined > procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1167: > test threads1: received error: jpl:jFindClass/2: Undefined > procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1176: > test threads2: received error: jpl:jFindClass/2: Undefined > procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1181: > test threads3: received error: jpl:jFindClass/2: Undefined > procedure: jpl:jni_func/3 > ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1198: > test jref1: received error: plunit_jpl:'unit body'/2: Undefined > procedure: jpl:jni_term_to_jref/2 > make: *** [check_pl] Error 1 > _______________________________________________ > SWI-Prolog mailing list > SWI-Prolog@... > https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ SWI-Prolog mailing list SWI-Prolog@... https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog |
|
|
Re: Error "undefined symbol: PL_new_atom" using jpl on Ubuntu 9.04Thanks Andrew!
Your answer contained the solution. I had encountered the LD_PRELOAD trick before but had additional problems, but your answer encouraged me to continue researching this path and now I got it working when starting Java from commandline! I still have to learn how to do the below things in Eclipse also though, so any tips regarding that are highly welcome. === Solving my additional problems using LD_PRELOAD === |(Documenting this here, in case it helps anybody else with similar problems.) I wanted to call java with a custom script/command line call rather than using the run.sh (and subsequent calls to env.sh) scripts in the examples packaged with jpl, in order to know exactly what is needed to do in Eclipse later. This gave me some additional trouble.|| | I had the problem that when using LD_PRELOAD to load libjpl.so, libjava.so and libjvm.so suddenly wasn't found, but this was solved by first running: export LD_LIBRARY_PATH=|"/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/client/:/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/" I also had to run (The second path is just the path to the jpl Test classes): export CLASSPATH="||/usr/local/lib/pl-5.7.15/lib/jpl.jar:/home/samuel/install/swi-prolog/pl57/packages/jpl/examples/java/Test" || So now I can fire up the Test class (which I modified so it loads all the blipkit modules) with the following command: || LD_PRELOAD=/usr/local/lib/pl-5.7.15/lib/i686-linux/libjpl.so java -Djava.library.path=/usr/local/lib/pl-5.7.15/lib/i686-linux/ Test I have documented the changes to Test.java, in my project blog: http://saml.rilspace.com/content/finally-got-blipkit-started-from-java-via-jpl Again, many thanks! Regards Samuel | Andrew Koster wrote: > You need to add the LD_PRELOAD environment variable. In it, specify > the location of the swipl libraries. There's a more detailed post in > the mailing list which is where I found how to do it. > > Cheers, > Andrew > > > Quoting Samuel Lampa <samuel.lampa.l@...>: > >> Hello, >> >> I'm trying to use a system built upon Swi-prolog (blipkit) through >> jpl for integration into a Java project. >> >> OS: Ubuntu 9.04. >> SWI-Prolog version: 5.7.15 (Checked out from Git and compiled from >> source, including all packages) >> >> Blipkit works fine on my system when starting blip from the >> commandline (Blipkit is basically a SWI-Prolog shell that loads extra >> prolog modules at startup). But when I try to load the same modules >> from Java, via jpl, I constantly get this error: >> >> /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/bin/java: symbol lookup error: >> /usr/local/lib/pl-5.7.15/lib/i686-linux/sgml2pl.so: undefined symbol: >> PL_new_atom >> >> I think I've located the defenition of PL_new_atom, to the file >> src/pl-fli.c:282 but nothing seems wrong with that. >> >> Furthermore, the JPL Java test "Test" in the examples folder works >> well. "make check" results in a whole lot of errors though (but I >> read somewhere that the tests for this one checks very specific paths >> to the java bin et.c. which I suppose could easily differ between >> systems). >> >> So, trying to figure out a possible reason. >> >> In the packages/jpl/ISSUES file there is some information which makes >> me thinking if it can be relevant here, but of which I don't fully >> understand the consequences: >> >> packages/jpl/ISSUES says: >>> <snip> ...If >>> libjpl.so is loaded directly from Java it will use the Prolog >>> kernel >>> included in libjpl.so. If it is invoked through Prolog, the >>> Prolog >>> application is before libjpl.so in the ELF search path and therefore >>> all >>> Prolog symbols are resolved against the application. >> >> Could this mean that when prolog is started from Java, it does not >> have access to the same shared libraries et.c. (for example the >> definitions for PL_new_atom), or am I wrong? >> >> Any other hints, or anybody else having experience from working with >> the jpl on Ubuntu? >> Any hints are welcome! >> >> Kind Regards >> Samuel Lampa >> Masters project student >> Dept. of Pharm. Biosciences >> Uppsala University, Sweden >> Project blog: http://saml.ril >> >> Attached below is the output from "make check" in the packages/jpl >> folder, for reference: >> >> (cd src/java && make test_jar) >> make[1]: Entering directory >> `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' >> make[1]: Nothing to be done for `test_jar'. >> make[1]: Leaving directory >> `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' >> pl -q -f test_jpl.pl -g run_tests,halt -t 'halt(1)' >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >> '$open_shared_object'/3: libjava.so: cannot open shared object >> file: No such file or directory >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >> library `java' does not exist (Please add directory holding >> libjava.so to $LD_LIBRARY_PATH) >> Warning: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >> Goal (directive) failed: jpl:initialization(setup_jvm, now) >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4638: >> Exported procedure jpl:jpl_c_lib_version/1 is not defined >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:20: >> test ancestor_types_1: received error: jpl:jFindClass/2: Undefined >> procedure: jpl:jni_func/3 >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:29: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:39: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:48: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:60: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:74: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:86: >> error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:112: >> error in setup: jpl:jNewIntArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:121: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:136: >> test call_static_param_cyclic_term_1: wrong error >> ERROR: Expected: error(type_error(acyclic, f(**)), >> context(jpl_call/4, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:148: >> error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:161: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:174: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:187: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:199: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:211: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:223: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:235: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:247: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:259: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:272: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:285: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:297: >> test get_field_static_boolean_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:306: >> test get_field_static_boolean_2: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:315: >> test get_field_static_char_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:324: >> test get_field_static_char_2: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:333: >> error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:345: >> test list_to_array_1: received error: jpl:jNewByteArray/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:355: >> test method_static_byte_1: wrong error >> ERROR: Expected: error(type_error(method_params, [-129]), >> context(jpl_call/4, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:367: >> test method_static_echo_boolean_1: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:379: >> test method_static_echo_boolean_2: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:391: >> test method_static_echo_char_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:403: >> test method_static_echo_char_2: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:415: >> test method_static_char_3: wrong error >> ERROR: Expected: error(type_error(method_params, [-1]), >> context(jpl_call/4, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:430: >> test method_static_char_4: wrong error >> ERROR: Expected: error(type_error(method_params, [1.0]), >> context(jpl_call/4, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:445: >> test method_static_char_5: wrong error >> ERROR: Expected: error(type_error(method_params, [a]), >> context(jpl_call/4, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:460: >> test method_static_echo_double_1: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:472: >> test method_static_echo_double_2: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:484: >> test method_static_echo_double_3: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:500: >> test method_static_echo_float_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:512: >> test method_static_echo_float_2: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:525: >> test method_static_echo_float_3: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:558: >> test new_abstract_class_1: wrong error >> ERROR: Expected: error(type_error(concrete_class, >> 'java.util.Dictionary'), context(jpl_new/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:573: >> test new_array_boolean_from_val_1: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:586: >> test new_array_double_from_val_1: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:599: >> test new_array_float_from_val_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:612: >> test new_interface_1: wrong error >> ERROR: Expected: error(type_error(concrete_class, >> 'java.util.Enumeration'), context(jpl_new/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:627: >> test new_param_cyclic_term_1: wrong error >> ERROR: Expected: error(type_error(acyclic, f(**)), >> context(jpl_new/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:642: >> test prolog_calls_java_calls_prolog_1: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:652: >> error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:668: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:683: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:698: >> test set_field_bad_field_spec_1: wrong error >> ERROR: Expected: error(type_error(field_name, 3.7), >> context(jpl_set/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:713: >> error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:729: >> error in setup: jpl:jNewLongArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:738: >> error in setup: jpl:jNewIntArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:756: >> error in setup: jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:766: >> test set_field_static_bad_type_1: wrong error >> ERROR: Expected: error(type_error(boolean, 27), >> context(jpl_set/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:781: >> test set_field_static_boolean_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:790: >> test set_field_static_boolean_2: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:799: >> test set_field_static_boolean_bad_1: wrong error >> ERROR: Expected: error(type_error(field_value, foo(bar)), >> context(jpl_set/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:814: >> test set_field_static_cyclic_term_1: wrong error >> ERROR: Expected: error(type_error(acyclic, f(**)), >> context(jpl_set/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:829: >> test set_field_static_final_int_1: wrong error >> ERROR: Expected: error(permission_error(modify, final_field, >> fieldStaticFinalInt), context(jpl_set/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:852: >> test set_field_static_term_1: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:869: >> test set_field_static_term_2: received error: jpl:jFindClass/2: >> Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:882: >> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:896: >> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:910: >> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:926: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:940: >> error in setup: jpl:jNewByteArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:956: >> error in setup: jpl:jNewCharArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:970: >> error in setup: jpl:jNewDoubleArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:984: >> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:998: >> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1013: >> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1031: >> error in setup: jpl:jNewLongArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1048: >> error in setup: jpl:jNewLongArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1067: >> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1086: >> test set_get_field_static_long_1: received error: >> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1102: >> test set_non_accessible_field_1: wrong error >> ERROR: Expected: error(existence_error(field, gagaga), >> context(jpl_set/3, A)) >> ERROR: Got: error(existence_error(procedure, >> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1114: >> test terms_to_array_1: received error: jpl:jFindClass/2: Undefined >> procedure: jpl:jni_func/3 >> ERROR: /usr/local/lib/pl-5.7.15/library/jpl.pl:32: >> module/2: No permission to redefine module `jpl' (Already loaded >> from /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl) >> ERROR: Failed to load /usr/local/lib/pl-5.7.15/library/jpl >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1137: >> test versions_1: received error: plunit_jpl:'unit body'/2: >> Undefined procedure: plunit_jpl:jpl_c_lib_version/1 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1162: >> test fac10: received error: jpl:jFindClass/2: Undefined procedure: >> jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1167: >> test threads1: received error: jpl:jFindClass/2: Undefined >> procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1176: >> test threads2: received error: jpl:jFindClass/2: Undefined >> procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1181: >> test threads3: received error: jpl:jFindClass/2: Undefined >> procedure: jpl:jni_func/3 >> ERROR: >> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1198: >> test jref1: received error: plunit_jpl:'unit body'/2: Undefined >> procedure: jpl:jni_term_to_jref/2 >> make: *** [check_pl] Error 1 >> _______________________________________________ >> SWI-Prolog mailing list >> SWI-Prolog@... >> https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > _______________________________________________ > SWI-Prolog mailing list > SWI-Prolog@... > https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog > > _______________________________________________ SWI-Prolog mailing list SWI-Prolog@... https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog |
|
|
Re: Error "undefined symbol: PL_new_atom" using jpl on Ubuntu 9.04Don't know from where those pipechars in my mail came. (Rinsed version
below) Samuel Samuel Lampa wrote: > Thanks Andrew! > > Your answer contained the solution. I had encountered the LD_PRELOAD > trick before but had additional problems, but your answer encouraged > me to continue researching this path and now I got it working when > starting Java from commandline! I still have to learn how to do the > below things in Eclipse also though, so any tips regarding that are > highly welcome. > > === Solving my additional problems using LD_PRELOAD === > > (Documenting this here, in case it helps anybody else with similar > problems.) > > I wanted to call java with a custom script/command line call rather > than using the run.sh (and subsequent calls to env.sh) scripts in the > examples packaged with jpl, in order to know exactly what is needed to > do in Eclipse later. This gave me some additional trouble. > > I had the problem that when using LD_PRELOAD to load libjpl.so, > libjava.so and libjvm.so suddenly wasn't found, but this was solved by > first running: > > export > LD_LIBRARY_PATH="/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/client/:/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/" > > > I also had to run (The second path is just the path to the jpl Test > classes): > > export > CLASSPATH="/usr/local/lib/pl-5.7.15/lib/jpl.jar:/home/samuel/install/swi-prolog/pl57/packages/jpl/examples/java/Test" > > > So now I can fire up the Test class (which I modified so it loads all > the blipkit modules) with the following command: > LD_PRELOAD=/usr/local/lib/pl-5.7.15/lib/i686-linux/libjpl.so java > -Djava.library.path=/usr/local/lib/pl-5.7.15/lib/i686-linux/ Test > > I have documented the changes to Test.java, in my project blog: > > > http://saml.rilspace.com/content/finally-got-blipkit-started-from-java-via-jpl > > > > Again, many thanks! > > Regards > Samuel > > Andrew Koster wrote: >> You need to add the LD_PRELOAD environment variable. In it, specify >> the location of the swipl libraries. There's a more detailed post in >> the mailing list which is where I found how to do it. >> >> Cheers, >> Andrew >> >> >> Quoting Samuel Lampa <samuel.lampa.l@...>: >> >>> Hello, >>> >>> I'm trying to use a system built upon Swi-prolog (blipkit) through >>> jpl for integration into a Java project. >>> >>> OS: Ubuntu 9.04. >>> SWI-Prolog version: 5.7.15 (Checked out from Git and compiled from >>> source, including all packages) >>> >>> Blipkit works fine on my system when starting blip from the >>> commandline (Blipkit is basically a SWI-Prolog shell that loads >>> extra prolog modules at startup). But when I try to load the same >>> modules from Java, via jpl, I constantly get this error: >>> >>> /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/bin/java: symbol lookup error: >>> /usr/local/lib/pl-5.7.15/lib/i686-linux/sgml2pl.so: undefined >>> symbol: PL_new_atom >>> >>> I think I've located the defenition of PL_new_atom, to the file >>> src/pl-fli.c:282 but nothing seems wrong with that. >>> >>> Furthermore, the JPL Java test "Test" in the examples folder works >>> well. "make check" results in a whole lot of errors though (but I >>> read somewhere that the tests for this one checks very specific >>> paths to the java bin et.c. which I suppose could easily differ >>> between systems). >>> >>> So, trying to figure out a possible reason. >>> >>> In the packages/jpl/ISSUES file there is some information which >>> makes me thinking if it can be relevant here, but of which I don't >>> fully understand the consequences: >>> >>> packages/jpl/ISSUES says: >>>> <snip> >>>> ...If >>>> libjpl.so is loaded directly from Java it will use the Prolog >>>> kernel >>>> included in libjpl.so. If it is invoked through Prolog, the >>>> Prolog >>>> application is before libjpl.so in the ELF search path and >>>> therefore all >>>> Prolog symbols are resolved against the application. >>> >>> Could this mean that when prolog is started from Java, it does not >>> have access to the same shared libraries et.c. (for example the >>> definitions for PL_new_atom), or am I wrong? >>> >>> Any other hints, or anybody else having experience from working with >>> the jpl on Ubuntu? >>> Any hints are welcome! >>> >>> Kind Regards >>> Samuel Lampa >>> Masters project student >>> Dept. of Pharm. Biosciences >>> Uppsala University, Sweden >>> Project blog: http://saml.ril >>> >>> Attached below is the output from "make check" in the packages/jpl >>> folder, for reference: >>> >>> (cd src/java && make test_jar) >>> make[1]: Entering directory >>> `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' >>> make[1]: Nothing to be done for `test_jar'. >>> make[1]: Leaving directory >>> `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' >>> pl -q -f test_jpl.pl -g run_tests,halt -t 'halt(1)' >>> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >>> '$open_shared_object'/3: libjava.so: cannot open shared object >>> file: No such file or directory >>> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >>> library `java' does not exist (Please add directory holding >>> libjava.so to $LD_LIBRARY_PATH) >>> Warning: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >>> Goal (directive) failed: jpl:initialization(setup_jvm, now) >>> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4638: >>> Exported procedure jpl:jpl_c_lib_version/1 is not defined >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:20: >>> test ancestor_types_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:29: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:39: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:48: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:60: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:74: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:86: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:112: >>> error in setup: jpl:jNewIntArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:121: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:136: >>> test call_static_param_cyclic_term_1: wrong error >>> ERROR: Expected: error(type_error(acyclic, f(**)), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:148: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:161: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:174: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:187: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:199: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:211: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:223: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:235: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:247: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:259: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:272: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:285: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:297: >>> test get_field_static_boolean_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:306: >>> test get_field_static_boolean_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:315: >>> test get_field_static_char_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:324: >>> test get_field_static_char_2: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:333: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:345: >>> test list_to_array_1: received error: jpl:jNewByteArray/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:355: >>> test method_static_byte_1: wrong error >>> ERROR: Expected: error(type_error(method_params, [-129]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:367: >>> test method_static_echo_boolean_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:379: >>> test method_static_echo_boolean_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:391: >>> test method_static_echo_char_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:403: >>> test method_static_echo_char_2: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:415: >>> test method_static_char_3: wrong error >>> ERROR: Expected: error(type_error(method_params, [-1]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:430: >>> test method_static_char_4: wrong error >>> ERROR: Expected: error(type_error(method_params, [1.0]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:445: >>> test method_static_char_5: wrong error >>> ERROR: Expected: error(type_error(method_params, [a]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:460: >>> test method_static_echo_double_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:472: >>> test method_static_echo_double_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:484: >>> test method_static_echo_double_3: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:500: >>> test method_static_echo_float_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:512: >>> test method_static_echo_float_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:525: >>> test method_static_echo_float_3: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:558: >>> test new_abstract_class_1: wrong error >>> ERROR: Expected: error(type_error(concrete_class, >>> 'java.util.Dictionary'), context(jpl_new/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:573: >>> test new_array_boolean_from_val_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:586: >>> test new_array_double_from_val_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:599: >>> test new_array_float_from_val_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:612: >>> test new_interface_1: wrong error >>> ERROR: Expected: error(type_error(concrete_class, >>> 'java.util.Enumeration'), context(jpl_new/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:627: >>> test new_param_cyclic_term_1: wrong error >>> ERROR: Expected: error(type_error(acyclic, f(**)), >>> context(jpl_new/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:642: >>> test prolog_calls_java_calls_prolog_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:652: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:668: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:683: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:698: >>> test set_field_bad_field_spec_1: wrong error >>> ERROR: Expected: error(type_error(field_name, 3.7), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:713: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:729: >>> error in setup: jpl:jNewLongArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:738: >>> error in setup: jpl:jNewIntArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:756: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:766: >>> test set_field_static_bad_type_1: wrong error >>> ERROR: Expected: error(type_error(boolean, 27), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:781: >>> test set_field_static_boolean_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:790: >>> test set_field_static_boolean_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:799: >>> test set_field_static_boolean_bad_1: wrong error >>> ERROR: Expected: error(type_error(field_value, foo(bar)), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:814: >>> test set_field_static_cyclic_term_1: wrong error >>> ERROR: Expected: error(type_error(acyclic, f(**)), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:829: >>> test set_field_static_final_int_1: wrong error >>> ERROR: Expected: error(permission_error(modify, final_field, >>> fieldStaticFinalInt), context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:852: >>> test set_field_static_term_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:869: >>> test set_field_static_term_2: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:882: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:896: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:910: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:926: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:940: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:956: >>> error in setup: jpl:jNewCharArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:970: >>> error in setup: jpl:jNewDoubleArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:984: >>> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:998: >>> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1013: >>> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1031: >>> error in setup: jpl:jNewLongArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1048: >>> error in setup: jpl:jNewLongArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1067: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1086: >>> test set_get_field_static_long_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1102: >>> test set_non_accessible_field_1: wrong error >>> ERROR: Expected: error(existence_error(field, gagaga), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1114: >>> test terms_to_array_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: /usr/local/lib/pl-5.7.15/library/jpl.pl:32: >>> module/2: No permission to redefine module `jpl' (Already loaded >>> from /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl) >>> ERROR: Failed to load /usr/local/lib/pl-5.7.15/library/jpl >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1137: >>> test versions_1: received error: plunit_jpl:'unit body'/2: >>> Undefined procedure: plunit_jpl:jpl_c_lib_version/1 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1162: >>> test fac10: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1167: >>> test threads1: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1176: >>> test threads2: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1181: >>> test threads3: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1198: >>> test jref1: received error: plunit_jpl:'unit body'/2: Undefined >>> procedure: jpl:jni_term_to_jref/2 >>> make: *** [check_pl] Error 1 >>> _______________________________________________ >>> SWI-Prolog mailing list >>> SWI-Prolog@... >>> https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog >>> >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. >> >> _______________________________________________ >> SWI-Prolog mailing list >> SWI-Prolog@... >> https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog >> >> > > _______________________________________________ > SWI-Prolog mailing list > SWI-Prolog@... > https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog > > _______________________________________________ SWI-Prolog mailing list SWI-Prolog@... https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog |
|
|
Re: [SOLVED] Error "undefined symbol: PL_new_atom" using jpl on Ubuntu 9.04Hello,
I succeeded now to start blip from inside eclipse as well, by simply starting eclipse with preceded with LD_PRELOAD (+ first loading the paths to where libjava.so and libjvm.so are located), like so: export LD_LIBRARY_PATH="/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/client/:/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386" LD_PRELOAD=/usr/local/lib/pl-5.7.15/lib/i686-linux/libjpl.so /home/samuel/program/eclipse/eclipse & Kind Regards Samuel Samuel Lampa wrote: > Thanks Andrew! > > Your answer contained the solution. I had encountered the LD_PRELOAD > trick before but had additional problems, but your answer encouraged > me to continue researching this path and now I got it working when > starting Java from commandline! I still have to learn how to do the > below things in Eclipse also though, so any tips regarding that are > highly welcome. > > === Solving my additional problems using LD_PRELOAD === > > |(Documenting this here, in case it helps anybody else with similar > problems.) > > I wanted to call java with a custom script/command line call rather > than using the run.sh (and subsequent calls to env.sh) scripts in the > examples packaged with jpl, in order to know exactly what is needed to > do in Eclipse later. This gave me some additional trouble.|| > | > I had the problem that when using LD_PRELOAD to load libjpl.so, > libjava.so and libjvm.so suddenly wasn't found, but this was solved by > first running: > > export > LD_LIBRARY_PATH=|"/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/client/:/usr/lib/jvm/java-1.5.0-sun-1.5.0.19/jre/lib/i386/" > > > I also had to run (The second path is just the path to the jpl Test > classes): > > export > CLASSPATH="||/usr/local/lib/pl-5.7.15/lib/jpl.jar:/home/samuel/install/swi-prolog/pl57/packages/jpl/examples/java/Test" > > || > So now I can fire up the Test class (which I modified so it loads all > the blipkit modules) with the following command: > || LD_PRELOAD=/usr/local/lib/pl-5.7.15/lib/i686-linux/libjpl.so java > -Djava.library.path=/usr/local/lib/pl-5.7.15/lib/i686-linux/ Test > > I have documented the changes to Test.java, in my project blog: > > > http://saml.rilspace.com/content/finally-got-blipkit-started-from-java-via-jpl > > > > Again, many thanks! > > Regards > Samuel > | > Andrew Koster wrote: >> You need to add the LD_PRELOAD environment variable. In it, specify >> the location of the swipl libraries. There's a more detailed post in >> the mailing list which is where I found how to do it. >> >> Cheers, >> Andrew >> >> >> Quoting Samuel Lampa <samuel.lampa.l@...>: >> >>> Hello, >>> >>> I'm trying to use a system built upon Swi-prolog (blipkit) through >>> jpl for integration into a Java project. >>> >>> OS: Ubuntu 9.04. >>> SWI-Prolog version: 5.7.15 (Checked out from Git and compiled from >>> source, including all packages) >>> >>> Blipkit works fine on my system when starting blip from the >>> commandline (Blipkit is basically a SWI-Prolog shell that loads >>> extra prolog modules at startup). But when I try to load the same >>> modules from Java, via jpl, I constantly get this error: >>> >>> /usr/lib/jvm/java-1.5.0-sun-1.5.0.19/bin/java: symbol lookup error: >>> /usr/local/lib/pl-5.7.15/lib/i686-linux/sgml2pl.so: undefined >>> symbol: PL_new_atom >>> >>> I think I've located the defenition of PL_new_atom, to the file >>> src/pl-fli.c:282 but nothing seems wrong with that. >>> >>> Furthermore, the JPL Java test "Test" in the examples folder works >>> well. "make check" results in a whole lot of errors though (but I >>> read somewhere that the tests for this one checks very specific >>> paths to the java bin et.c. which I suppose could easily differ >>> between systems). >>> >>> So, trying to figure out a possible reason. >>> >>> In the packages/jpl/ISSUES file there is some information which >>> makes me thinking if it can be relevant here, but of which I don't >>> fully understand the consequences: >>> >>> packages/jpl/ISSUES says: >>>> <snip> >>>> ...If >>>> libjpl.so is loaded directly from Java it will use the Prolog >>>> kernel >>>> included in libjpl.so. If it is invoked through Prolog, the >>>> Prolog >>>> application is before libjpl.so in the ELF search path and >>>> therefore all >>>> Prolog symbols are resolved against the application. >>> >>> Could this mean that when prolog is started from Java, it does not >>> have access to the same shared libraries et.c. (for example the >>> definitions for PL_new_atom), or am I wrong? >>> >>> Any other hints, or anybody else having experience from working with >>> the jpl on Ubuntu? >>> Any hints are welcome! >>> >>> Kind Regards >>> Samuel Lampa >>> Masters project student >>> Dept. of Pharm. Biosciences >>> Uppsala University, Sweden >>> Project blog: http://saml.ril >>> >>> Attached below is the output from "make check" in the packages/jpl >>> folder, for reference: >>> >>> (cd src/java && make test_jar) >>> make[1]: Entering directory >>> `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' >>> make[1]: Nothing to be done for `test_jar'. >>> make[1]: Leaving directory >>> `/home/samuel/install/swi-prolog/pl57/packages/jpl/src/java' >>> pl -q -f test_jpl.pl -g run_tests,halt -t 'halt(1)' >>> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >>> '$open_shared_object'/3: libjava.so: cannot open shared object >>> file: No such file or directory >>> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >>> library `java' does not exist (Please add directory holding >>> libjava.so to $LD_LIBRARY_PATH) >>> Warning: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4637: >>> Goal (directive) failed: jpl:initialization(setup_jvm, now) >>> ERROR: /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl:4638: >>> Exported procedure jpl:jpl_c_lib_version/1 is not defined >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:20: >>> test ancestor_types_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:29: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:39: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:48: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:60: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:74: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:86: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:112: >>> error in setup: jpl:jNewIntArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:121: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:136: >>> test call_static_param_cyclic_term_1: wrong error >>> ERROR: Expected: error(type_error(acyclic, f(**)), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:148: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:161: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:174: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:187: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:199: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:211: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:223: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:235: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:247: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:259: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:272: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:285: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:297: >>> test get_field_static_boolean_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:306: >>> test get_field_static_boolean_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:315: >>> test get_field_static_char_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:324: >>> test get_field_static_char_2: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:333: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:345: >>> test list_to_array_1: received error: jpl:jNewByteArray/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:355: >>> test method_static_byte_1: wrong error >>> ERROR: Expected: error(type_error(method_params, [-129]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:367: >>> test method_static_echo_boolean_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:379: >>> test method_static_echo_boolean_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:391: >>> test method_static_echo_char_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:403: >>> test method_static_echo_char_2: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:415: >>> test method_static_char_3: wrong error >>> ERROR: Expected: error(type_error(method_params, [-1]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:430: >>> test method_static_char_4: wrong error >>> ERROR: Expected: error(type_error(method_params, [1.0]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:445: >>> test method_static_char_5: wrong error >>> ERROR: Expected: error(type_error(method_params, [a]), >>> context(jpl_call/4, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:460: >>> test method_static_echo_double_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:472: >>> test method_static_echo_double_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:484: >>> test method_static_echo_double_3: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:500: >>> test method_static_echo_float_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:512: >>> test method_static_echo_float_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:525: >>> test method_static_echo_float_3: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:558: >>> test new_abstract_class_1: wrong error >>> ERROR: Expected: error(type_error(concrete_class, >>> 'java.util.Dictionary'), context(jpl_new/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:573: >>> test new_array_boolean_from_val_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:586: >>> test new_array_double_from_val_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:599: >>> test new_array_float_from_val_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:612: >>> test new_interface_1: wrong error >>> ERROR: Expected: error(type_error(concrete_class, >>> 'java.util.Enumeration'), context(jpl_new/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:627: >>> test new_param_cyclic_term_1: wrong error >>> ERROR: Expected: error(type_error(acyclic, f(**)), >>> context(jpl_new/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:642: >>> test prolog_calls_java_calls_prolog_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:652: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:668: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:683: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:698: >>> test set_field_bad_field_spec_1: wrong error >>> ERROR: Expected: error(type_error(field_name, 3.7), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:713: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:729: >>> error in setup: jpl:jNewLongArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:738: >>> error in setup: jpl:jNewIntArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:756: >>> error in setup: jpl:jFindClass/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:766: >>> test set_field_static_bad_type_1: wrong error >>> ERROR: Expected: error(type_error(boolean, 27), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:781: >>> test set_field_static_boolean_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:790: >>> test set_field_static_boolean_2: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:799: >>> test set_field_static_boolean_bad_1: wrong error >>> ERROR: Expected: error(type_error(field_value, foo(bar)), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:814: >>> test set_field_static_cyclic_term_1: wrong error >>> ERROR: Expected: error(type_error(acyclic, f(**)), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:829: >>> test set_field_static_final_int_1: wrong error >>> ERROR: Expected: error(permission_error(modify, final_field, >>> fieldStaticFinalInt), context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:852: >>> test set_field_static_term_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:869: >>> test set_field_static_term_2: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:882: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:896: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:910: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:926: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:940: >>> error in setup: jpl:jNewByteArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:956: >>> error in setup: jpl:jNewCharArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:970: >>> error in setup: jpl:jNewDoubleArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:984: >>> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:998: >>> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1013: >>> error in setup: jpl:jNewFloatArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1031: >>> error in setup: jpl:jNewLongArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1048: >>> error in setup: jpl:jNewLongArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1067: >>> error in setup: jpl:jNewBooleanArray/2: Undefined procedure: >>> jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1086: >>> test set_get_field_static_long_1: received error: >>> jpl:jFindClass/2: Undefined procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1102: >>> test set_non_accessible_field_1: wrong error >>> ERROR: Expected: error(existence_error(field, gagaga), >>> context(jpl_set/3, A)) >>> ERROR: Got: error(existence_error(procedure, >>> jpl:jni_func/3), context(jpl:jFindClass/2, B)) >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1114: >>> test terms_to_array_1: received error: jpl:jFindClass/2: >>> Undefined procedure: jpl:jni_func/3 >>> ERROR: /usr/local/lib/pl-5.7.15/library/jpl.pl:32: >>> module/2: No permission to redefine module `jpl' (Already loaded >>> from /home/samuel/install/swi-prolog/pl57/packages/jpl/jpl.pl) >>> ERROR: Failed to load /usr/local/lib/pl-5.7.15/library/jpl >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1137: >>> test versions_1: received error: plunit_jpl:'unit body'/2: >>> Undefined procedure: plunit_jpl:jpl_c_lib_version/1 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1162: >>> test fac10: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1167: >>> test threads1: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1176: >>> test threads2: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1181: >>> test threads3: received error: jpl:jFindClass/2: Undefined >>> procedure: jpl:jni_func/3 >>> ERROR: >>> /home/samuel/install/swi-prolog/pl57/packages/jpl/test_jpl.pl:1198: >>> test jref1: received error: plunit_jpl:'unit body'/2: Undefined >>> procedure: jpl:jni_term_to_jref/2 >>> make: *** [check_pl] Error 1 >>> _______________________________________________ >>> SWI-Prolog mailing list >>> SWI-Prolog@... >>> https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog >>> >> >> >> >> ---------------------------------------------------------------- >> This message was sent using IMP, the Internet Messaging Program. >> >> _______________________________________________ >> SWI-Prolog mailing list >> SWI-Prolog@... >> https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog >> >> > > _______________________________________________ > SWI-Prolog mailing list > SWI-Prolog@... > https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog > > _______________________________________________ SWI-Prolog mailing list SWI-Prolog@... https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog |
| Free embeddable forum powered by Nabble | Forum Help |