Version 4.10.0

hirondelle.web4j.webmaster
Class TroubleTicket

Object
  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/4.6.2.0
 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 : http://www.web4j.com/
Web application Message : Uses web4j.jar version 4.6.2

Request Info:
--------------------------------------------------------
HTTP Method: GET
Context Path: /fish
ServletPath: /webmaster/testfailure/ForceFailure.do
URI: /fish/webmaster/testfailure/ForceFailure.do
URL: http://localhost:8081/fish/webmaster/testfailure/ForceFailure.do
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/ShowPerformance.do
Header user-agent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) ..[elided]..
Cookie JSESSIONID=2C326412C32F6F823673A5FBD1C883A7

Client Info:
--------------------------------------------------------
User IP: 127.0.0.1
User hostname: 127.0.0.1

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)
awt.toolkit: sun.awt.windows.WToolkit
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.encoding.pkg: sun.io
file.separator: \
java.awt.graphicsenv: sun.awt.Win32GraphicsEnvironment
java.awt.printerjob: sun.awt.windows.WPrinterJob
java.class.path: .;C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip;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
java.io.tmpdir: 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.initial: org.apache.naming.java.javaURLContextFactory
java.naming.factory.url.pkgs: org.apache.naming
java.runtime.name: Java(TM) 2 Runtime Environment, Standard Edition
java.runtime.version: 1.5.0_07-b03
java.specification.name: 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\logging.properties
java.util.logging.manager: org.apache.juli.ClassLoaderLogManager
java.vendor: Sun Microsystems Inc.
java.vendor.url: http://java.sun.com/
java.vendor.url.bug: http://java.sun.com/cgi-bin/bugreport.cgi
java.version: 1.5.0_07
java.vm.info: mixed mode, sharing
java.vm.name: Java HotSpot(TM) Client VM
java.vm.specification.name: 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
line.separator: 

os.arch: x86
os.name: 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: ;
server.loader: 
shared.loader: 
sun.arch.data.model: 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.cpu.isalist: 
sun.desktop: windows
sun.io.unicode.encoding: UnicodeLittle
sun.jnu.encoding: Cp1252
sun.management.compiler: HotSpot Client Compiler
sun.os.patch.level: Service Pack 3
tomcat.util.buf.StringCache.byte.enabled: true
user.country: CA
user.dir: C:\johanley\Projects\TomcatInstance
user.home: C:\Documents and Settings\John
user.language: en
user.name: John
user.timezone: America/Halifax
user.variant: 
java.class.path: 
.
C:\Program Files\Java\jre1.6.0_07\lib\ext\QTJava.zip
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:  ImplementationFor.hirondelle.web4j.security.LoginTasks = hirondelle.fish.all.preferences.Login
Servlet init-param:  ImplicitMappingRemoveBasePackage = hirondelle.fish
Servlet init-param:  IntegerDisplayFormat = #,###
Servlet init-param:  IsSQLPrecompilationAttempted = true
Servlet init-param:  LoggingDirectory = C:\log\fish\
Servlet init-param:  LoggingLevels = hirondelle.fish.level=FINE, hirondelle.web4j.level=FINE
Servlet init-param:  MailServerConfig = mail.host=mail.blah.com
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 = blah@blah.com
Servlet init-param:  Webmaster = blah@blah.com

Stack Trace:
--------------------------------------------------------
java.lang.RuntimeException: Testing application behavior upon failure.
  at hirondelle.fish.webmaster.testfailure.ForceFailure.execute(ForceFailure.java:29)
  at hirondelle.web4j.Controller.checkOwnershipThenExecuteAction(Unknown Source)
  at hirondelle.web4j.Controller.processRequest(Unknown Source)
  at hirondelle.web4j.Controller.doGet(Unknown Source)
  ...[elided]...
 


Constructor Summary
TroubleTicket(String aCustomBody)
          Constuctor sets custom content for the body of the email.
TroubleTicket(Throwable aException, HttpServletRequest aRequest)
          Constructor.
 
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

TroubleTicket

public TroubleTicket(Throwable aException,
                     HttpServletRequest aRequest)
Constructor.

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

TroubleTicket

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.

Parameters:
aCustomBody - the desired body of the email.
Method Detail

init

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).


toString

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

See example in the class comment.

Overrides:
toString in class Object

mailToRecipients

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.

Throws:
AppException

Version 4.10.0

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