ToolTwist CLI debugging example 1 - tooltwist/documentation GitHub Wiki
Symptoms
-
The Designer appeared to start correctly, right down to
$ tooltwist designer --------------------------------------------------------------------------- VERSION: 8.3.3-SNAPSHOT MODE: deploy REPOSITORY: [email protected]:twistresources/rpdata-myrp-webdesign.git BRANCH: hub-development_TT8.3 --------------------------------------------------------------------------- Updating webdesign project. *************************************************************************** *** *** *** PHASE 1 - Prepare and run the Designer *** *** *** *************************************************************************** ... $ ./gradlew designer -DTOOLTWIST_HOME=/private/tmp/,weyden/.tooltwist/site-conf -DXms256m -DXmx1024m The ConfigurationContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead. The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead. :compileJava UP-TO-DATE :processResources UP-TO-DATE :classes UP-TO-DATE :expandZipFiles :tomcatRun Started Tomcat Server The Server is running at http://localhost:5000/ttsvr (Server can be stopped with Control-C) THE SERVER IS NOW RUNNING. http://localhost:5000/ttsvr/login Default log file is /private/tmp/,weyden/.tooltwist/tooltwist.log
-
Going to
http://localhost:5000/ttsvr/login
in the browser shows the Tomcat error page.HTTP Status 404 - /ttsvr/login type Status report message /ttsvr/login description The requested resource is not available. Apache Tomcat/7.0.42
-
The log file cannot be found.
$ ls -l /private/tmp/,weyden/.tooltwist/tooltwist.log ls: /private/tmp/,weyden/.tooltwist/tooltwist.log: No such file or directory
Debugging
-
The warnings about ConfigurationContainer.add() and TaskContainer.add() are common with Gradle v1, so I ignore these.
-
I start the Designer with the
-i
option, to display more information. The-d
option is also available, but displays a lot of debug output, so I'll try -i first. The -i and -d options map onto the same options when Gradle is run. -
After again starting normally, the log file becomes available. Strange - what happened different in this second run that didn't happen in the first? In any case, there is nothing in the log file that looks like an error.
-
Given that Tomcat appears to start correctly, isn't reporting any errors, but doesn't work, I'm assuming the problem is in Tomcat. The
tooltwist
command pulls the webdesign project from github, then generates a bunch of config files, then uses Gradle to build and run the Designer.With the ToolTwist CLI, Tomcat is run inside the gradle command within the same Java process, rather than as a standalone Java program. I don't want the delay of checking github each time, or want the CLI re-generating and overwriting config files while I'm debugging, so I'll run just the gradle part of the process.
Looking through the output I find these lines and run them from the command line:
$ cd /private/tmp/,weyden/.tooltwist/PHASE1/ttsvr $ ./gradlew designer -DTOOLTWIST_HOME=/private/tmp/,weyden/.tooltwist/site-conf -DXms256m -DXmx1024m -i
Once again the server again starts correctly, but isn't available from the browser, and the log file reveals nothing interesting.
Comparing to ttdemo
When starting the Designer for ttdemo the output is quite different, from the tomcatRun: onwards.
:tomcatRunSLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/philipcallender/.gradle/wrapper/dists/gradle-1.10-bin/6oa4rff9viiqskhgd6uns5v1f8/gradle-1.10/lib/logback-classic-1.0.13.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/philipcallender/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/0.9.30/3dc754111cfa4cb622a973cd8244378a4bf56612/logback-classic-0.9.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
>>>>>>>>>>>>>>>>>> Tooltwist Startup Commencing <<<<<<<<<<<<<<<<<<
>>>>>> This is tooltwist.misc.LoadConfigsServlet.
>>>>>> Obtaining env-entry for TOOLTWIST_HOME from JNDI (e.g. web.xml)
javax.naming.NameNotFoundException: Name [TOOLTWIST_HOME] is not bound in this Context. Unable to find [TOOLTWIST_HOME]. >>>>>> * Not found, falling back on -D JVM property. >>>>>> * TOOLTWIST_HOME = /private/tmp/,ttdemo/.tooltwist/site-conf >>>>>> Will reconfigure logback if config file found >>>>>> * Looking for (local file: /private/tmp/,ttdemo/.tooltwist/site-conf/conf/logback.xml) >>>>>> * Found - reconfiguring logback. >>>>>> Loading filemap if it's not already loaded >>>>>> * Filemap loaded. >>>>>> Will log test messages immediately after the next line (debug, info, trace, warn, and error) >>>>>>>>>>>>>>>>>> Tooltwist Startup Finished <<<<<<<<<<<<<<<<<<<<<
Started Tomcat Server
...
For rpdata-myrp-webdesign.git the whole section labelled 'Tooltwist Startup Commencing' is missing:
:tomcatRun
Download http://repo.tooltwist.com/artifactory/rpdata-all-in-one/com/tooltwist/rpdata-hub/1.0.2-SNAPSHOT/rpdata-hub-1.0.2-20150417.020000-28.jar
Started Tomcat Server
...
This message is displayed immediately the ttsvr web design project starts. The fact it isn't displayed, and also that there is the missing log file for ttsvr, indicates that there is a problem starting ttsvr.