JTALIS installation problems

119 views
Skip to first unread message

Antonio Alegria

unread,
Dec 3, 2011, 2:19:26 PM12/3/11
to ETALIS
Hi,

I am trying out ETALIS and JTALIS and am struggling with setting
everything up. Hopefully I can set make it work and document it for
others.

First I found a bug in the jtalis-setup.sh script. The patch is
included below.

Then, after building everything the tests fail with a
"java.lang.RuntimeException: Could not load ETALIS sources" in
com.jtalis.core.config.BasicConfig.getEtalisSourceFile(BasicConfig.java:
132). I have tried to put an etalis.zip and/or an etalis source folder
inside src/test/resources to no avail. I have tried configuring maven-
surefire to include these resources in the class path but it still
doesn't work. Can you help me? Maybe we can work together to make the
Getting Started experience much easier.

Thanks,

António Alegria

P.S. PATCH

index d4ea775..734cd0c 100755
--- a/jtalis-core/scripts/jtalis-setup.sh
+++ b/jtalis-core/scripts/jtalis-setup.sh
@@ -74,7 +74,7 @@ fi
###############################################################
# Install Interprolog and JPL dependencies in Maven repo
###############################################################
-if [ ! -e ~/.m2/repository/jpl/jpl/1.0/jpl-1.0.jar ]; then
+if [ ! -e ~/.m2/repository/interprolog/interprolog/1.0/
interprolog-1.0.jar ]; then
echo [SETUP INFO] Installing Interprolog.jar in local Maven
repository ...
mvn install:install-file\
-Dfile=$SCRIPT_DIR/libs/interprolog.jar\
@@ -85,7 +85,7 @@ if [ ! -e ~/.m2/repository/jpl/jpl/1.0/
jpl-1.0.jar ]; then
-DgeneratePom=true
fi

-if [ ! -e ~/.m2/repository/interprolog/interprolog/1.0/
interprolog-1.0.jar ]; then
+if [ ! -e ~/.m2/repository/jpl/jpl/1.0/jpl-1.0.jar ]; then
echo [SETUP INFO] Installing jpl.jar in local Maven
repository ...
mvn install:install-file\
-Dfile=$SWI_HOME_DIR/lib/jpl.jar\

Vesko Georgiev

unread,
Dec 3, 2011, 2:28:38 PM12/3/11
to eta...@googlegroups.com
Hi António,

You should not move etalis.zip anywhere, or touch anything at all. If there is a problem it is most probably in your environment or the installation scripts. mvn isntall should do the job for you after checking out form svn. I have tested this on Widows XP, 7, Open SUSE and Mac OS X and it works out of the box. Also there is a document, which should help people to start with Jtalis: http://code.google.com/p/etalis/downloads/detail?name=Jtalis%20Manual.pdf&can=2&q=

To resolve this issue, could you tell me which OS are you running this on and send me the log.

Cheers,
Vesko Georgiev

Vesko Georgiev

unread,
Dec 3, 2011, 2:36:28 PM12/3/11
to eta...@googlegroups.com
P.S. I have applied your patch. Thanks!

Cheers,
Vesko Georgiev

António Alegria

unread,
Dec 4, 2011, 7:04:00 AM12/4/11
to eta...@googlegroups.com
I am running Mac OS X 10.7.2.

I attached my scripts/build.sh output.

Thanks,

António Alegria

jtalis-error.txt

Vesko Georgiev

unread,
Dec 4, 2011, 8:23:41 AM12/4/11
to eta...@googlegroups.com
Hi Antonio,

That's really strange. I'm also running Mac OS X 10.7.2 and it works out of the box. The first thing I'm noticing in the log is:

[SETUP INFO] SWI_LIB_PATH found at:
[SETUP INFO] SWI_BIN_PATH found at:

After ":" the script should output the actual found path. Like in my case:

==========================================================================================
vMac:scripts vesko$ ./build.sh
[SETUP INFO] Searching for SWI_LIB_DIR and SWI_BIN_DIR ...
[SETUP INFO] SWI_LIB_PATH found at: /opt/local/lib/swipl-5.10.2//lib/i386-darwin10.4.0
[SETUP INFO] SWI_BIN_PATH found at: /opt/local/lib/swipl-5.10.2//bin/i386-darwin10.4.0
[SETUP INFO] /Users/vesko/.profile already contains SWI_HOME_DIR definition. Skipping /Users/vesko/.profile environment setup.
[INFO] Scanning for projects...
……
==========================================================================================


Though it is strange, because etalis source files have nothing to do with the SWI path. One thing I can think of is that "jtalis-utils-osx.sh" is not being executed because of a bug in "jtalis-commons.sh". The second thing I'd like to ask you is to try building the project with "mvn install -Dmaven.test.skip=true" and send me the jar file. After building, try "./scripts/jtalis-run.sh pom.xml resources/basic-run-config.xml". It will probably be the same error, but I just want to be sure.

Cheers,
Vesko Georgiev

> <jtalis-error.txt>

António Alegria

unread,
Dec 9, 2011, 6:45:14 AM12/9/11
to eta...@googlegroups.com
Hi,

I have looked into the SWI Path problem and found it to be my fault: I had obliviously set the variable SWI_LIB_PATH to an empty value, in .profile. After deleting it and letting the scripts set it did not, however, solve the issues I previously reported.

Nevertheless, I am attaching the requested jar. After running the commands you requested an error was raised, albeit a different one than when running ./scripts/build.sh. I pasted the generated output in postscript (btw, If you'd rather I attach it or put it on a github gist let me know :-):

Thanks,

António Alegria

P.S.

gin:jtalis-core tonio$ mvn install -Dmaven.test.skip=true
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jtalis-core 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:resources (default-resources) @ jtalis-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ jtalis-core ---
[INFO] Compiling 81 source files to /Users/tonio/workspace/external/jtalis/jtalis-core/target/classes
[INFO]
[INFO] --- maven-resources-plugin:2.4.3:testResources (default-testResources) @ jtalis-core ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:testCompile (default-testCompile) @ jtalis-core ---
[INFO] Not compiling test sources
[INFO]
[INFO] --- maven-surefire-plugin:2.7.1:test (default-test) @ jtalis-core ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- maven-jar-plugin:2.3.1:jar (default-jar) @ jtalis-core ---
[INFO] Building jar: /Users/tonio/workspace/external/jtalis/jtalis-core/target/jtalis-core-1.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ jtalis-core ---
[INFO] Installing /Users/tonio/workspace/external/jtalis/jtalis-core/target/jtalis-core-1.0.jar to /Users/tonio/.m2/repository/jtalis/jtalis-core/1.0/jtalis-core-1.0.jar
[INFO] Installing /Users/tonio/workspace/external/jtalis/jtalis-core/pom.xml to /Users/tonio/.m2/repository/jtalis/jtalis-core/1.0/jtalis-core-1.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.281s
[INFO] Finished at: Fri Dec 09 11:29:03 WET 2011
[INFO] Final Memory: 9M/81M
[INFO] ------------------------------------------------------------------------


gin:jtalis-core tonio$ ./scripts/jtalis-run.sh pom.xml resources/basic-run-config.xml
Enter your SWI Prolog home directory:
/usr/local/lib/swipl-5.10.5/


[SETUP INFO] Searching for SWI_LIB_DIR and SWI_BIN_DIR ...

[SETUP INFO] SWI_LIB_PATH found at: /usr/local/lib/swipl-5.10.5//lib/i386-darwin11.2.0
[SETUP INFO] SWI_BIN_PATH found at: /usr/local/lib/swipl-5.10.5//bin/i386-darwin11.2.0
[SETUP INFO] /Users/tonio/.profile already contains SWI_HOME_DIR definition. Skipping /Users/tonio/.profile environment setup.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building jtalis-core 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) @ jtalis-core >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) @ jtalis-core <<<
[INFO]
[INFO] --- exec-maven-plugin:1.2.1:java (default-cli) @ jtalis-core ---
Dec 9, 2011 11:39:06 AM com.jtalis.core.event.provider.DefaultInputProvider setup
INFO: No input source is specified. Binding to Standard Input.
Dec 9, 2011 11:39:06 AM com.jtalis.core.event.provider.DefaultOutputProvider setup
INFO: No output source specified. Binding to Standard Output.
[WARNING]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.RuntimeException: Could not load ETALIS sources
at com.jtalis.core.config.BasicConfig.getEtalisSourceFile(BasicConfig.java:132)
at com.jtalis.core.config.XmlConfig.<init>(XmlConfig.java:148)
at com.jtalis.core.JtalisMain.run(JtalisMain.java:63)
at com.jtalis.core.JtalisMain.main(JtalisMain.java:71)
... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.424s
[INFO] Finished at: Fri Dec 09 11:39:06 WET 2011
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project jtalis-core: An exception occured while executing the Java class. null: InvocationTargetException: Could not load ETALIS sources -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

jtalis-core-1.0.jar

Vesko Georgiev

unread,
Dec 10, 2011, 1:32:36 PM12/10/11
to eta...@googlegroups.com
Hi Antonio,

I examined your jar. It really does not have the needed resources inside. Which tells me what your problem might be. jtalis-core SVN project is designed so that the directory 
"jtalis/jtalis-core/src/main/resources/com/jtalis/core/config/etalis" is configured to be fetched from external svn directory which are the original etalis prolog sources. Normally if you check out from svn, this directory should be fetched on your computer without you specifying anything else. This could be verified by the message in the console "Fetching external item into 'src/main/resources/com/jtalis/core/config/etalis/src' " after update or check out. 

Please, check what do you have in this directory: "src/main/resources/com/jtalis/core/config/etalis/src". If the directory is empty, I would assume that you either have got jtalis sources in some other way or there is something wrong with your svn client. Which one do you think it is?

Cheers,
Vesko Georgiev

On Dec 4, 2011, at 1:23 PM, Vesko Georgiev wrote:

Hi Antonio,

That's really strange. I'm also running Mac OS X 10.7.2 and it works out of the box. The first thing I'm noticing in the log is:

[SETUP INFO] SWI_LIB_PATH found at:
[SETUP INFO] SWI_BIN_PATH found at:

After ":" the script should output the actual found path. Like in my case:

==========================================================================================
vMac:scripts vesko$ ./build.sh
[SETUP INFO] Searching for SWI_LIB_DIR and SWI_BIN_DIR ...
[SETUP INFO] SWI_LIB_PATH found at: /opt/local/lib/swipl-5.10.2//lib/i386-darwin10.4.0
[SETUP INFO] SWI_BIN_PATH found at: /opt/local/lib/swipl-5.10.2//bin/i386-darwin10.4.0
[SETUP INFO] /Users/vesko/.profile already contains SWI_HOME_DIR definition. Skipping /Users/vesko/.profile environment setup.
[INFO] Scanning for projects...
……
<jtalis-core-1.0.jar>


António Alegria

unread,
Dec 11, 2011, 11:42:27 AM12/11/11
to eta...@googlegroups.com
Hah! I'm using git-svn, so that's why this didn't work...

Hmm, I will try to do a regular svn checkout, then =)

Do you have any plans to distribute Jtalis as a precompiled Jar or as a Maven artifact?

Cheers,

AA

António Alegria

unread,
Dec 11, 2011, 12:29:42 PM12/11/11
to eta...@googlegroups.com
Ok, I've fetched the Jtalis project using SVN directly and now I have another problem building =) It doesn't seem to be able to find my SWIPL LIB and BIN dirs. Here's part of the output:

gin:jtalis-core tonio$ ./scripts/build.sh 
Enter your SWI Prolog home directory:
/usr/local/lib/swipl-5.10.5
[SETUP INFO] Searching for SWI_LIB_DIR and SWI_BIN_DIR ...
[SETUP INFO] SWI_LIB_PATH found at:
[SETUP INFO] SWI_BIN_PATH found at:
[SETUP INFO] Defining SWI Prolog environment variables in /Users/tonio/.profile ...


I have installed SWI Prolog via Homebrew. Any clues?

Thanks,

AA

Vesko Georgiev

unread,
Dec 11, 2011, 12:33:13 PM12/11/11
to eta...@googlegroups.com
Hi Antonio,

There is a pre-packed version for Mac OS X and win 7 with all needed jars and embedded prolog. You basically unzip and are ready to go. It's a few changes older than the source, because we don't have automated process that can build a pre-packed version on every commit. You can find it here: http://code.google.com/p/etalis/downloads/list. On this URL you can also find a Jtalis Manual. I have just updated it with the SVN issues.

Cheers,
Vesko Georgiev

Vesko Georgiev

unread,
Dec 11, 2011, 12:36:40 PM12/11/11
to eta...@googlegroups.com
Hi Antonio,

We've been through this already. Here is one of your previous inputs:

gin:jtalis-core tonio$ ./scripts/jtalis-run.sh pom.xml resources/basic-run-config.xml
Enter your SWI Prolog home directory:
/usr/local/lib/swipl-5.10.5/
[SETUP INFO] Searching for SWI_LIB_DIR and SWI_BIN_DIR ...
[SETUP INFO] SWI_LIB_PATH found at: /usr/local/lib/swipl-5.10.5//lib/i386-darwin11.2.0
[SETUP INFO] SWI_BIN_PATH found at: /usr/local/lib/swipl-5.10.5//bin/i386-darwin11.2.0
[SETUP INFO] /Users/tonio/.profile already contains SWI_HOME_DIR definition. Skipping /Users/tonio/.profile environment setup.

What have you changed? 

Cheers,
Vesko Georgiev

António Alegria

unread,
Dec 30, 2011, 12:12:23 PM12/30/11
to eta...@googlegroups.com
Yeah, I know we have. Somehow, the script never asks me for the SWI Prolog path. It manages to auto detect it. However, it cannot find the LIB and BIN paths.

I've looked at the jtalis-setup.sh script and found that it is searching for the SWI_LIB_PATH and SWI_BIN_PATH throught a 'search' command:

export SWI_LIB_PATH=`search "$SWI_HOME_DIR" is_lib_dir`

What is this supposed to do?

Thanks (and sorry for being a pain, I really would like to get the whole process right) =)

António Alegria

Vesko Georgiev

unread,
Dec 30, 2011, 5:14:16 PM12/30/11
to eta...@googlegroups.com
The script asks you for SWI_HOME_DIR if there is no declaration for it in .profile. Actually this part I haven't written quite well. I actually look for the string "SWI_HOME_DIR" in .profile, but we need to look for a definition of the variable.
My idea of the script was that it uses SWI_HOME_DIR to find the LIB and BIN directories. If you don't have it defined in .profile, so it asks you to enter it.  My suggestion is to see what you have defined in .profile

Cheers,
Vesko

António Alegria

unread,
Jan 3, 2012, 7:37:31 AM1/3/12
to eta...@googlegroups.com
Ok. Now it worked. I didn't restart the shell so, despite having removed SWI_HOME_DIR from .profile it was still defined in the environment. The script automatically detected it but did not detect the LIB and BIN.

Anyways, the build and tests were successful. Many thanks for the help =)

Will probably come back with more issues when running and applying this in some of my projects =)

Cheers and Happy New Year!

António Alegria
Reply all
Reply to author
Forward
0 new messages