Troubleshooting Appkit App Builds and Deployments

TODO - REVIEW THIS

Troubleshoot building and deploying Appkit apps.

Increasing memory allocation to Jetty when running with Maven

If you are using the Social Module with Appkit, you might have to increase the amount of memory available to the application server. When starting Appkit up with Maven set this environment variable:

export MAVEN_OPTS='-Xms128M -Xmx256M -XX:PermSize=128M -XX:MaxPermSize=256M'

Paths with encoded forward slashes not working in Tomcat

By default, specific versions of Tomcat do not allow encoded forward slashes (%2F) in a URL. To work around this problem set this System property:

-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

This can be done either via catalina.sh or catalina.bat or on Windows via the services properties window, which can be accessed by running $CATALINA_HOME/bin/tomcat7w.exe (if using Tomcat 7, change as appropriate for your exact version).

Problem with accented and other UTF-8 characters

Appkit is completely stateless so all information for a Query is contained in the HTTP request. Because Tomcat by default is not configured to handle special characters (such as UTF-8) in URLs, Tomcat might be incorrectly interpreting the HTTP GET request. To correctly handle URLs, open the Tomcat server.xml file [tomcat installation folder]/conf/server.xml, find the <Connector> element, and add the URIEncoding atttribute to it:

<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8" />

For more information, see the Character Encoding FAQ on the Tomcat Wiki.

If you are running Tomcat behind an HTTP server via AJP (Apache or IIS, for example), then you also must add the URIEncoding atttribute to the AJP connector found in the Tomcat server.xml file:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8" />

Error writing to Java Preference Store

In specific cases on Linux, there is an issue with the application server being able to write temporary and other system files. In that case, start up the container with this flag:

-Djava.util.prefs.userRoot=/some/writable/directory

IIS authentication with Tomcat

When using IIS as an authentication layer in front of Tomcat, the AJP connector must be told not to perform authentication in Tomcat:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" tomcatAuthentication="false" />

Long Tomcat startup times

There is a known issue with long Tomcat startup times. To avoid this, add this entry to the JVM params, applied in /usr/share/tomcat7/bin/catalina.sh:

JAVA_OPTS=(all your usual stuff plus:)-Djava.security.egd=file:/dev/./urandom

JVM proxy settings

You can configure your JVM to use an HTTP proxy for all outgoing network traffic by setting these system properties:

-Dhttp.proxyHost=${server}
-Dhttp.proxyPort=${port}
-Dhttp.proxyUser=${username}
-Dhttp.proxyPassword=${password}

When using Tomcat, you can configure proxy settings either via catalina.sh or catalina.bat or on Windows via the services properties window, which can be accessed by running $CATALINA_HOME/bin/tomcat7w.exe (if using Tomcat 7, change as appropriate for your exact version).

Installing Missing Image Codecs on a Windows server

The standard SUN JDK only ships with a limited number of image codecs, which are needed for manipulating images in Appkit (for example, when resizing to generate a preview). In particular, the standard JDK lacks support for TIFF images.

To obtain the missing codecs, we recommend installing the Java Advanced Imaging Image I/O Tools, which are available free of charge from:

Down the page, you should download the JDK version of the toolkit and copy it to each delivery server that will be running Appkit:

Follow the installation instructions for the toolkit.

Note
For Windows users, the installation must be performed with a 32-bit JDK.*

After it has been installed, you must restart Tomcat to get the new codecs into the Java runtime. To verify which codecs are installed on the server, look for this output in Appkit.log when Tomcat starts again:

2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule - Supported image formats:
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - BMP
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - bmp
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - jpg
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - JPG
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - jpeg
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - wbmp
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - png
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - PNG
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - JPEG
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - WBMP
2013-05-23 09:16:08,146 [main] INFO  twigkit.media.MediaModule -    - TIFF
...

Missing web resources

Under some circumstances web resources such as fonts (.ttf/.woff etc.) cannot be retrieved resulting in missing icons in the UI. In many cases this is caused by a bug in the webJAR locator library affecting some Operating Systems. Installing Tomcat on a path containing blanks causes this bug to manifest itself. The fix is simply to move Tomcat to a blank-free location (for example, on Windows in C:\Tomcat\).