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\
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
Cheers,
Vesko Georgiev
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>
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
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>
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.