public void startServer ( ) throws Exception { if ( ! externalDatabaseHost ) { try { this . port = Utils . getSystemPort ( Constants . SYS_DB_PORT ) ; server = Server . createTcpServer ( "-tcpPort" , String . valueOf ( port ) , "-tcpAllowOthers" ) . start ( ) ; } catch ( SQLException e ) { if ( e . toString ( ) . contains ( "java.net.UnknownHostException" ) ) { logger . error ( "Startup failure. Potential bug in OSX & Java7. Workaround: add name of local machine to '/etc/hosts.'" ) ; logger . error ( "Example: 127.0.0.1 MacBook" ) ; throw e ; } } } }
Only meant to be called once