Version 4.10.0

Class TroubleTicket

  extended by hirondelle.web4j.webmaster.TroubleTicket

public final class TroubleTicket
extends Object

Email diagnostic information to support staff when an error occurs.

Uses the following settings in web.xml:

The Controller will create and send a TroubleTicket when:

Warning: some e-mail spam filters may incorrectly treat the default content of these trouble tickets (example below) as spam.

Example content of a TroubleTicket, as returned by toString():

Error for web application Fish And Chips Club/
 java.lang.RuntimeException: Testing application behavior upon failure. ***
Time of error : 2011-09-12 19:59:32
Occurred for user : blah
Web application Build Date: Sat Jul 09 00:00:00 ADT 2011
Web application Author : Hirondelle Systems
Web application Link :
Web application Message : Uses web4j.jar version 4.6.2

Request Info:
HTTP Method: GET
Context Path: /fish
ServletPath: /webmaster/testfailure/
URI: /fish/webmaster/testfailure/
URL: http://localhost:8081/fish/webmaster/testfailure/
Header accept = text/html,application/xhtml+xml,application/xml;q=0.9
Header accept-charset = UTF-8,*
Header accept-encoding = gzip,deflate
Header accept-language = en-us,en;q=0.5
Header connection = keep-alive
Header cookie = JSESSIONID=2C326412C32F6F823673A5FBD1C883A7
Header host = localhost:8081
Header keep-alive = 115
Header referer = http://localhost:8081/fish/webmaster/performance/
Header user-agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: ..[elided]..
Cookie JSESSIONID=2C326412C32F6F823673A5FBD1C883A7

Client Info:
User IP:
User hostname:

Session Info
Logged in user name : blah
Timeout : 900 seconds.
Session Attributes javax.servlet.jsp.jstl.fmt.request.charset = UTF-8
Session Attributes web4j_key_for_form_source_id = 214c125310311a6e4eda5aa6448b3c47d0a85d31
Session Attributes web4j_key_for_locale = en
Session Attributes web4j_key_for_previous_form_source_id = f2d6ae8487e555f90ae7c186f370b05bcf46f0d0

Memory Info:
JRE Memory
 total:  66,650,112
 used:    7,515,624 (11%)
 free:   59,134,488 (89%)

Server And Servlet Info:
Name: localhost
Port: 8081
Info: Apache Tomcat/6.0.10
JRE default TimeZone: America/Halifax
JRE default Locale: English (Canada)
catalina.base: C:\johanley\Projects\TomcatInstance
catalina.home: C:\Program Files\Tomcat6
catalina.useNaming: true
common.loader: ${catalina.home}/lib,${catalina.home}/lib/*.jar
file.encoding: UTF-8
file.separator: \
java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment
java.class.path: .;C:\Program Files\Java\jre1.6.0_07\lib\ext\;C:\Program Files\Tomcat6\bin\bootstrap.jar
java.class.version: 49.0
java.endorsed.dirs: C:\Program Files\Tomcat6\endorsed
java.ext.dirs: C:\jdk1.5.0\jre\lib\ext
java.home: C:\jdk1.5.0\jre C:\johanley\Projects\TomcatInstance\temp
java.library.path: C:\jdk1.5.0\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:\jdk1.5.0\bin;..e[lided]..
java.naming.factory.url.pkgs: org.apache.naming Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version: 1.5.0_07-b03 Java Platform API Specification
java.specification.vendor: Sun Microsystems Inc.
java.specification.version: 1.5
java.util.logging.config.file: C:\johanley\Projects\TomcatInstance\conf\
java.util.logging.manager: org.apache.juli.ClassLoaderLogManager
java.vendor: Sun Microsystems Inc.
java.version: 1.5.0_07 mixed mode, sharing Java HotSpot(TM) Client VM Java Virtual Machine Specification
java.vm.specification.vendor: Sun Microsystems Inc.
java.vm.specification.version: 1.0
java.vm.vendor: Sun Microsystems Inc.
java.vm.version: 1.5.0_07-b03

os.arch: x86 Windows XP
os.version: 5.1
package.access: sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.,sun.beans.
package.definition: sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
path.separator: ;
shared.loader: 32
sun.boot.class.path: C:\jdk1.5.0\jre\lib\rt.jar;...[elided]
sun.boot.library.path: C:\jdk1.5.0\jre\bin
sun.cpu.endian: little
sun.desktop: windows UnicodeLittle
sun.jnu.encoding: Cp1252 HotSpot Client Compiler
sun.os.patch.level: Service Pack 3
tomcat.util.buf.StringCache.byte.enabled: true CA
user.dir: C:\johanley\Projects\TomcatInstance
user.home: C:\Documents and Settings\John
user.language: en John
user.timezone: America/Halifax
C:\Program Files\Java\jre1.6.0_07\lib\ext\
C:\Program Files\Tomcat6\bin\bootstrap.jar
Servlet : Controller
Servlet init-param:  AccessControlDbConnectionString = java:comp/env/jdbc/fish_access
Servlet init-param:  AllowStringAsBuildingBlock = YES
Servlet init-param:  BigDecimalDisplayFormat = #,##0.00
Servlet init-param:  BooleanFalseDisplayFormat = <input type='checkbox' name='false' value='false' readonly notab>
Servlet init-param:  BooleanTrueDisplayFormat = <input type='checkbox' name='true' value='true' checked readonly notab>
Servlet init-param:  CharacterEncoding = UTF-8
Servlet init-param:  DateTimeFormatForPassingParamsToDb = YYYY-MM-DD^hh:mm:ss^YYYY-MM-DD hh:mm:ss
Servlet init-param:  DecimalSeparator = PERIOD
Servlet init-param:  DecimalStyle = HALF_EVEN,2
Servlet init-param:  DefaultDbConnectionString = java:comp/env/jdbc/fish
Servlet init-param:  DefaultLocale = en
Servlet init-param:  DefaultUserTimeZone = America/Halifax
Servlet init-param:  EmptyOrNullDisplayFormat = -
Servlet init-param:  ErrorCodeForDuplicateKey = 1062
Servlet init-param:  ErrorCodeForForeignKey = 1216,1217,1451,1452
Servlet init-param:  FetchSize = 25
Servlet init-param:  FullyValidateFileUploads = ON
Servlet init-param:  HasAutoGeneratedKeys = true
Servlet init-param:  IgnorableParamValue = 
Servlet init-param: =
Servlet init-param:  ImplicitMappingRemoveBasePackage =
Servlet init-param:  IntegerDisplayFormat = #,###
Servlet init-param:  IsSQLPrecompilationAttempted = true
Servlet init-param:  LoggingDirectory = C:\log\fish\
Servlet init-param:  LoggingLevels =, hirondelle.web4j.level=FINE
Servlet init-param:  MailServerConfig =
Servlet init-param:  MailServerCredentials = NONE
Servlet init-param:  MaxFileUploadRequestSize = 1048576
Servlet init-param:  MaxHttpRequestSize = 51200
Servlet init-param:  MaxRequestParamValueSize = 51200
Servlet init-param:  MaxRows = 300
Servlet init-param:  MinimumIntervalBetweenTroubleTickets = 30
Servlet init-param:  PoorPerformanceThreshold = 20
Servlet init-param:  SpamDetectionInFirewall = OFF
Servlet init-param:  SqlEditorDefaultTxIsolationLevel = DATABASE_DEFAULT
Servlet init-param:  SqlFetcherDefaultTxIsolationLevel = DATABASE_DEFAULT
Servlet init-param:  TimeZoneHint = NONE
Servlet init-param:  TranslationDbConnectionString = java:comp/env/jdbc/fish_translation
Servlet init-param:  TroubleTicketMailingList =
Servlet init-param:  Webmaster =

Stack Trace:
java.lang.RuntimeException: Testing application behavior upon failure.
  at hirondelle.web4j.Controller.checkOwnershipThenExecuteAction(Unknown Source)
  at hirondelle.web4j.Controller.processRequest(Unknown Source)
  at hirondelle.web4j.Controller.doGet(Unknown Source)

Constructor Summary
TroubleTicket(String aCustomBody)
          Constuctor sets custom content for the body of the email.
TroubleTicket(Throwable aException, HttpServletRequest aRequest)
Method Summary
static void init(ServletConfig aConfig)
          Called by the framework upon startup, to save the name of the server (Servlet 3.0 wouldn't need this).
 void mailToRecipients()
          Send an email to the TroubleTicketMailingList recipients configured in web.xml.
 String toString()
          Return extensive listing of items which may be useful in solving the problem.
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public TroubleTicket(Throwable aException,
                     HttpServletRequest aRequest)

aException - has caused the problem.
aRequest - original underlying HTTP request.


public TroubleTicket(String aCustomBody)
Constuctor sets custom content for the body of the email.

When using this constructor, the detailed information shown in the class comment is not generated.

aCustomBody - the desired body of the email.
Method Detail


public static void init(ServletConfig aConfig)
Called by the framework upon startup, to save the name of the server (Servlet 3.0 wouldn't need this).


public String toString()
Return extensive listing of items which may be useful in solving the problem.

See example in the class comment.

toString in class Object


public void mailToRecipients()
                      throws AppException
Send an email to the TroubleTicketMailingList recipients configured in web.xml.

If sufficient time has passed since the last email of a TroubleTicket, then send an email to the webmaster whose body is toString(); otherwise do nothing.

Here, "sufficient time" is defined by a setting in web.xml named MinimumIntervalBetweenTroubleTickets. The intent is to throttle down on emails which likely have the same cause.


Version 4.10.0

Copyright Hirondelle Systems. Published October 19, 2013 - User Guide - All Docs.