Java developers – stack traces aren’t helpful to end users
I 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.)