Java developers – stack traces aren’t helpful to end users
Tuesday, March 27th, 2007I just tried registering a Solaris 10 11/06 machine using sconadm and here is the resulting output:
/usr/sbin/sconadm register -a -r /tmp/regprofile
sconadm is running
javax.management.remote.JMXProviderException: Connection refused
at com.sun.cacao.rmi.impl.CacaoRMIConnectorProvider.newJMXConnector(Caca oRMIConnectorProvider.java:415)
at javax.management.remote.JMXConnectorFactory.getConnectorAsService(JMX ConnectorFactory.java:415)
at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnec torFactory.java:307)
at com.sun.scn.client.MSCConnection.doMscConnect(MSCConnection.java:155)
at com.sun.scn.client.MSCConnection.mscConnectWithKeystorePassword(MSCCo nnection.java:67)
(about 30 lines snipped out by me)
at com.sun.cns.basicreg.BasicReg.<init>(BasicReg.java:100)
at com.sun.cns.basicreg.BasicRegCLI.main(BasicRegCLI.java:523)
How about something more helpful like:
ERROR 68: Can’t connect to the fuzzbat service on server server99.
Please check that the fuzzbat service is enabled with ‘svcadm enable fuzzbat; svcs fuzzbat’.
While stack traces are helpful to developers, they can largely obfuscate the problem to the end-user and certainly don’t provide guidance on what the likely problem is and what the next step should be. If you want to print stack traces, at least try to provide some actionable information to the end user.
(My error was apparently generated because I had renamed the machine, but hadn’t bounced some services. After I rebooted, the sconadm command worked fine.)
ARCC sponsors informal races every Sunday morning at 8:30am that rotate around the metro Harrisburg area and cover a variety of distances. All runners are welcome, you don’t have to pay any fees or be a member to run in these races. Today’s race was a choice of either 2 or 5 miles. I choose to do the 2 mile course since I wanted to get a feel for my conditioning, but also wanted to make sure I’d be able to recover quickly to get in some solid training the rest of the week. The conditions were close to perfect: 45 degrees and sunny and a very flat out-and-back course.