Common gradle problems - tooltwist/documentation GitHub Wiki
Problem: Missing tooltwist config files
This usually shows up first with the following message:
Servlet.service() for servlet jsp threw exception
com.dinaa.ui.UiModuleException: com.dinaa.ui.UiConfigException: Fatal Error: no UI configuration files found
at com.dinaa.ui.internal.UiConfigInternal.getModuleType(UiConfigInternal.java:141)
at com.dinaa.ui.UiModule.getAlternateUrl(UiModule.java:1265)
...
In version 8.3 the config files need to get extracted from the ToolTwist jar files, unless you are building from source. If the config files are not extracted, an error will occur in the Designer. The config files, and also widget files should be found within at the extension-project directories:
$ ls -l extension-projects/*/
extension-projects/tooltwist/:
total 0
drwxr-xr-x 3 philipcallender wheel 102 2 Feb 16:08 config
drwxr-xr-x 3 philipcallender wheel 102 2 Feb 16:08 widgets
extension-projects/ttStd/:
total 0
drwxr-xr-x 13 philipcallender wheel 442 2 Feb 16:08 config
extension-projects/ttWbd/:
total 0
drwxr-xr-x 10 philipcallender wheel 340 2 Feb 16:08 config
drwxr-xr-x 10 philipcallender wheel 340 2 Feb 16:08 widgets
Extraction is normally done within the build.gradle file for ttsvr, by a task named extractConfigFromJars. This task will not be able to identify the jar files from which to extract if the version of tooltwist jars specified in build.gradle does not match the versions specified in the package.json for the webdesign project.
Problem: Extension project widgets missing in the Designer
This is usually a result of not definition the extension project in the webdesign project's project.json.
Problem: Web Content missing in the Designer
If your project looks correct in the Designer but in the test tab is missing web assets, stylesheets or javascripts from the WebContent directory of an extension project, then the build.gradle in the extension project might not be adding Web Content to the jar file correctly.
Check the contents of the jar file, and that your web content files are being placed under META-INF/resources.
$ jar tvf ~/Development/gradle-repo/com/tooltwist/guroopro_t/1.0-SNAPSHOT/guroopro_t-1.0-SNAPSHOT.jar
...
0 Sun Feb 02 18:33:08 PHT 2014 META-INF/resources/guroopro/scripts/modules/
57891 Sun Feb 02 18:33:08 PHT 2014 META-INF/resources/guroopro/scripts/modules/canvas-tools.js
100770 Sun Feb 02 18:33:08 PHT 2014 META-INF/resources/guroopro/scripts/modules/canvas-tools.src.js
7589 Sun Feb 02 18:33:08 PHT 2014 META-INF/resources/guroopro/scripts/modules/exporting.js
17609 Sun Feb 02 18:33:08 PHT 2014 META-INF/resources/guroopro/scripts/modules/exporting.src.js
...
Check that there is code like this in build.gradle:
//----------------------------------------------------------------------
// Copy extra resources into the jar file
//
processResources {
}
processResources.dependsOn("copyWebContent")
processResources.dependsOn("copyConfig")
processResources.dependsOn("copyWidgets")
task copyWebContent(type: Copy) {
from('WebContent')
into 'build/classes/main/META-INF/resources'
}
task copyConfig(type: Copy) {
from('config')
into 'build/resources/main/META-INF/tooltwist/config'
}
task copyWidgets(type: Copy) {
from('widgets')
into 'build/resources/main/META-INF/tooltwist/widgets'
}
Note that the META-INF/tooltwist
should not be substituted with the project's name.
--