From: Marek L. <ma...@le...> - 2005-10-05 18:52:51
|
Hello, Today, when there is a problem with connection to Java, PHP throws fatal error like this: [05-Oct-2005 18:38:29] PHP Fatal error: php_mod_java(52) system error: Connection refused. Could not connect to server. Have you started the java backend (either a servlet engine, an application server, JavaBridge.jar or MonoBridge.exe) and set the java.socketname or java.hosts option?. in... on line 343 So, when you do $s = new Java("java.lang.String", "e") and connection cannot be obtained then fatal error will be thrown. It would be great to catch connection problems with try/catch - maybe it is worth to replace fatal errors with PHP exceptions ? With exceptions we could write: try { $s = new Java("java.lang.String", "e"); } catch (JavaException $exception) { print "Connection failed or object cannot be created."; } What do you think ? ML |