Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why doesn the bridge throw a java.lang.RuntimeException or Error as a PHP JavaException by default?

bridge Default Error php throw
0
Posted

Why doesn the bridge throw a java.lang.RuntimeException or Error as a PHP JavaException by default?

0

All exceptions crossing the php/java container must be declared. If you want to catch java.lang.RuntimeException or java.lang.Error from PHP code, add a “throws” declaration. Example: public Object calculateValue(…) throws RuntimeException; It is a good programming practice to not allow java.lang.RuntimeException and java.lang.Error to cross an application container boundary. A JEE “enterprise java beans” container for example will terminate a transaction immediately if it encounters an exception derived from Error or RuntimeException. However, since PHP/Java Bridge version 5.5.3 the bridge reports a java.lang.RuntimeException/Error as a PHP JavaException if the option JAVA_PREFER_VALUES is set. Please see the NEWS entry for version 5.5.3 from the PHP/Java Bridge documentation download for details.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123