WebObjects 3.5.1 Java Patch Creation Date: June 2, 1998 Keywords: WebObjects, Java ....Overview ....Windows NT installation ....Problems fixed in this patch Overview This patch corrects several Java-related bugs in WebObjects 3.5.1 for Windows NT. It should be installed on all WebObjects 3.5.1 development and deployment systems running on Windows NT. This patch also incorporates the changes to the Sybase and ODBC EOF adaptors included in a previously released patch. A version of the Java patch for Solaris systems is in development and should be available soon. Windows NT installation You can download the Windows NT version of this patch as NeXTanswer #2632. + Log in as a user with Administrator privileges. + From the WebObjects program group in the Start menu, open a Bourne shell + At the shell prompt, type: gunzip -c 2632.compressed | gnutar xvf - replacing 2632.compressed with the name of the file you downloaded from NeXTanswers, if it is different. This should result in a patch file called 2632_WebObjects_3.5.1_Java_Patch_NT.tar.gz. Skip this step if you downloaded the patch from Apple's ftp server, or if the file you downloaded already has a .tar.gz extension. +To install the patch, type cd $NEXT_ROOT gunzip -c 2632_WebObjects_3.5.1_Java_Patch_NT.tar.gz | gnutar xvf - + Reboot your Windows NT system This patch replaces some of the files in the following directories. If you back up these directories before installing the patch, replacing them will return you to a "clean" installation: $NEXT_ROOT/NextDeveloper/Examples $NEXT_ROOT/NextDeveloper/Java $NEXT_ROOT/NextLibrary/Executables $NEXT_ROOT/NextLibrary/Frameworks $NEXT_ROOT/NextLibrary/Java Problems fixed in this patch DecimalNumber: Several of the next.util.DecimalNumber arithmetic methods raised exceptions when called. These methods now work properly. CalendarDate: The next.util.CalendarDate constructor CalendarDate(java.util.Date date) would sometimes return an incorrect date. This has been fixed. After applying this patch, you may see a message like this one: BRIDGE: _NSAssociateJavaObject assertion failed: java class next/util/DecimalNumber, objective c class NSDecimalNumber, retain count 1, java handle not retained! This message may be safely ignored. Java VM arguments: You may now pass "command line" arguments to the Java Virtual Machine. This is particularly useful for increasing the memory allocation pool (the garbage collected heap), which defaults to a maximum size of 16 MB. You should increase the pool size if you receive a java.lang.OutOfMemoryError exception. Here is some sample code showing how to pass these arguments. Be sure to add the JavaVM framework to your project. In YourApplication_main.m, do something like this: #import int main(int argc, const char *argv[]) { NSAutoreleasePool *pool = [NSAutoreleasePool new]; NSMutableDictionary *myArguments = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:30*1024*1024], @"NSJavaMinHeapSize", [NSNumber numberWithInt:60*1024*1024], @"NSJavaMaxHeapSize", nil]; [NSJavaVirtualMachine setDefaultVirtualMachineArguments:myArguments]; return WOApplicationMain(@"Application", argc, argv); } You can ignore the compiler warning about the unused "pool" variable. For a complete list of arguments, refer to the NSJavaVirtualMachine.h header in the JavaVM framework. NoSuchMethodError exceptions: WebObjects applications written in Java would occasionally raise a java.lang.NoSuchMethodError exception, when the method did in fact exist. This was caused by a race condition on the interaction between Objective C's reference counting and Java's garbage collection. This has been fixed. These exceptions could also be raised if a subclass of next.eo.CustomObject did not implement a default constructor (that is, a constructor with no parameters). Java classes generated by EOModeler already have this constructor. After installing this patch, a missing default constructor will generate a more meaningful error message. Java string retain crashes: A problem was fixed where Java strings were garbage collected before WebObjects had a chance to retain them. The missing strings caused some applications to eventually crash under heavy use. Sybase and ODBC EOF adaptor: This patch incorporates a previously-released patch to the Sybase and ODBC EOF adaptors. See NeXTanswer #2611 for more information on these changes.