System.exit in tutorial resource

Art Rothstein writes:
 > The System.exit call in the FancyResource source seems a harsh way to
 > respond to an error, especially when that error is likely to be committed
 > by dumber newbies, such as I, using the sample code.
 > 
 > In my case, I renamed the "tutorials" directory to "tutorial" to
 > accommodate the many prehistoric utilities I still use that do not
 > recognize long file names.  As a newbie I had no idea that the string
 > passed to Class.forName had to match the class' package name.  While trying
 > to figure out where to place the class, I commented out the package
 > statement and placed the class in \JAVA\LIB.  The configuration screen
 > found the resource, failed the Class.forName call, and took down the
 > server.  The cause and effect might have been easy to find had I not run
 > the JAVAW version of the JVM, which suppresses all console messages.
 > 
 > Now wiser, I won't make this mistake again, at least not very often.
 > Still, putting such System.exit code in a sample application that is likely
 > to be copied, is a bad idea.  I betray my ignorance of Java by not knowing
 > whether there is a better way of preventing the malformed class from loading.

I will make sure to fix these System.3exit calls by next release. I
initially missed a Java piece of the puzzle.

Anselm.

Received on Wednesday, 12 March 1997 02:38:31 UTC