|
Version 4.5.0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objecthirondelle.web4j.webmaster.TroubleTicket
public final class TroubleTicket
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 :
Throwable emitted by either the application or the framework.
Example content of a TroubleTicket, as returned by toString() :
Error for web application Fish And Chips/3.0.0.
java.lang.RuntimeException: Testing application behavior upon failure.
--------------------------------------------------------
Time of error : 2010-01-27 20:54:49
Occurred for user : blah
Web application Build Date: Fri Mar 16 00:00:00 ADT 2007
Web application Author : Hirondelle Systems
Web application Link : http://www.javapractices.com/apps/web4j/javadoc/summary.html
Web application Message :
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/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;
Header accept-charset = UTF-8,*
Header accept-language = en-us,en;q=0.5
Header connection = keep-alive
Header cookie = JSESSIONID=3969C9FD46EKLJDD0ASDKLFJAS
Header host = localhost:8081
Header keep-alive = 300
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.8.1.5) Gecko/
Header x-mcproxyfilter = ************
Cookie JSESSIONID=AS3213ASD5F1AS
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 = ISO-8859-1
Session Attributes web4j_key_for_errors = Messages : + [] Has Been Displayed : false
Session Attributes web4j_key_for_locale = en
Session Attributes web4j_key_for_messages = Messages : + [] Has Been Displayed : false
Server And Servlet Info:
--------------------------------------------------------
Name: localhost
Port: 8081
Info: Apache Tomcat/5.5.23
JRE default TimeZone: America/Halifax
JRE default Locale: English (United States)
awt.toolkit: sun.awt.windows.WToolkit
catalina.base: C:\Program Files\Tomcat5\Tomcat 5.5
catalina.home: C:\Program Files\Tomcat5\Tomcat 5.5
catalina.useNaming: true
common.loader: ${catalina.home}/common/classes
file.encoding: Cp1252
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\Tomcat5\Tomcat 5.5\bin\bootstrap.jar
java.class.version: 49.0
java.endorsed.dirs: C:\Program Files\Tomcat5\Tomcat 5.5\common\endorsed
java.ext.dirs: C:\Program Files\Java\jre1.5.0_10\lib\ext
java.home: C:\Program Files\Java\jre1.5.0_10
java.io.tmpdir: C:\Program Files\Tomcat5\Tomcat 5.5\temp
java.library.path: C:\Program Files\Tomcat5\Tomcat 5.5\bin;
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_10-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:\Program Files\Tomcat5\Tomcat 5.5\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_10
java.vm.info: mixed mode
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_10-b03
line.separator:
os.arch: x86
os.name: Windows XP
os.version: 5.1
path.separator: ;
server.loader: ${catalina.home}/server/classes,${catalina.home}/server/lib/*.jar
shared.loader: ${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar
sun.arch.data.model: 32
sun.boot.class.path: C:\Program Files\Java\jre1.5.0_10\lib\rt.jar;
sun.boot.library.path: C:\Program Files\Java\jre1.5.0_10\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 2
tomcat.util.buf.StringCache.byte.enabled: true
user.country: US
user.dir: C:\Program Files\Tomcat5\Tomcat 5.5
user.home: C:\
user.language: en
user.name: SYSTEM
user.timezone: America/Halifax
user.variant:
java.class.path:
C:\Program Files\Tomcat5\Tomcat 5.5\bin\bootstrap.jar
Servlet : Controller
Servlet init-param: BigDecimalDisplayFormat = #,##0.00
Servlet init-param: CharacterEncoding = ISO-8859-1
Servlet init-param: DecimalSeparator = PERIOD
Servlet init-param: DefaultLocale = en
Servlet init-param: DefaultUserTimeZone = America/Halifax
Servlet init-param: EmailInSeparateThread = YES
Servlet init-param: EmptyOrNullDisplayFormat = -
Servlet init-param: ErrorCodeForDuplicateKey = 1062
Servlet init-param: FetchSize = 25
Servlet init-param: FloatDisplayFormat = #,###.00
Servlet init-param: HasAutoGeneratedKeys = true
Servlet init-param: IgnorableParamValue =
Servlet init-param: ImplicitMappingAddSuffix = .do
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: 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: 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:21)
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,
ApplicationInfo aAppInfo)
Called by the framework upon startup, to extract config information from web.xml. |
void |
mailToWebmaster()
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)
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,
ApplicationInfo aAppInfo)
public String toString()
See example in the class comment.
toString in class Object
public void mailToWebmaster()
throws AppException
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.
AppException
|
Version 4.5.0
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||