WebObjects Title: WOF 3.5.1 Monitor Patch Overview Creation Date: May 4, 1998 Procedure Valid for Release: WebObjects 3.5.1 Keywords: WOF, patch, Monitor Disclaimer You may freely copy, distribute, and reuse the code in this example. Apple disclaims any warranty of any kind, expressed or implied, as to its fitness for any particular use. Example code written by David Neumann, SE, Apple Enterprise Software Overview This patch corrects several bugs in the Monitor application that shipped with WebObjects 3.5.1. It should be installed on all WebObjects 3.5.1 installations on all current platforms. You can download this patch as a .tar file as NextAnswer #2628. NextAnswer # 2628 contains the following files: AppDetailDetail.wo Application.wos WOApplicationFix.wo (for Java applications only) Readme.txt (this file) Caution: This patch should only be installed on systems running WebObjects 3.5.1. Problems fixed in this patch: Exception download panel: Whenever Monitor handled an exception for a user in a Netscape 4.x browser window, it would present a download panel. This problem occurred because Monitor wasn't setting the MIME type and length properly. Daily and weekly scheduling problems: Previously, although tasks scheduled hourly worked fine, Monitor did not use the time-of-day, day-of-week or timezone options when scheduling on a daily or weekly basis. To fix this problem, place the enclosed Application.wos script in the Monitor.woa/Resources folder. No soft off: The Monitor did not allow you to schedule a "soft off", that is, to mark an app to refuse new sessions instead of halting immediately. You can only schedule a hard off in the current version. This patch adds a check-box option to the Application Instance Inspector page (the one you get in the lower right frame when you click an instance's More button) allowing you to control whether an instance uses a hard or soft off. To fix the problem, back up the old AppDetailDetail.wo and then add the new file included with this patch to the Monitor.woa/Resources folder. Multi-app load balancing: This service pack also addresses a bug in how the Monitor load balances from a refusing instance to a non-refusing instance. The existing version of the Monitor uses round robin on the non-refusing instances, which causes problems if you are running instances of more than one application. This patch does fix this problem, but to take advantage of it you will also need to add the following method to your application's Application.wos script or add the equivalent Java code in an Application.java file: - (NSString *)_newLocation { id freeInstance, freeHost, freeNumber; NSString *newURI; NSString *httpHost; [self logWithFormat:@"newLocation: OVERRIDE..."]; if(![self remoteMonitor])return nil; // // DLN MOD - 12-97 BEGIN // freeInstance = [[self remoteMonitor] nonRefusingInstance:[[[self context] request] applicationName]]; // // DLN MOD - 12-97 END // freeNumber = [freeInstance objectForKey:@"number"]; [self logWithFormat:@"newLocation: freeNumber: %@",freeNumber]; if(!freeNumber)freeNumber=@"1"; freeHost = [freeInstance objectForKey:@"host"]; [self logWithFormat:@"newLocation: freeHost: %@",freeHost]; if(!freeHost)freeHost=@"XXXXXXXXXXXXX"; httpHost = [[[[self remoteMonitor] userPreferences] objectForKey:@"baseURLDict"] objectForKey:@"httpHost"]; [self logWithFormat:@"newLocation: httpHost: %@",httpHost]; if(!httpHost)httpHost=@"XXXXXXXXXXXXX"; newURI = [NSString stringWithFormat:@"http://%@%@/%@.woa/-/.wo/-/-/%@/%@", httpHost, [[[self context] request] adaptorPrefix], [[[self context] request] applicationName], freeNumber, freeHost]; [self logWithFormat:@"newLocation: newURI: %@",newURI]; return newURI; } In order to make this code work in a Java application, you must use the WOAppliationFix.wo file included in this patch. You will also need to add the following line to the Application.java constructor: pageWithName("WOApplicationFix")