× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



<Barbara Morris>
The RuntimeException is one subclass of Java Exception that apparently causes the JVM to become unusable. D*B, just a guess, but maybe those exceptions would normally be indications that something has gone wrong with the JVM, so Java ends the JVM. For example, it's impossible within Java to have a null instance ("this") within a method when the method is called from Java, but it's possible when the method is called using JNI.
</Barbara Morris>

Barbara,

From the Java Perspective RuntimException is a subclass of Exception, which is a subclass of Throwable. The one and only diffrence to other Exceptions is, that a method doesn't need to declare, that it throws this Exception, if it could be thrown within this method. If we have a look to the Runtime Exceptions, delivered with the JDK, we will find among others for instance: ArithmeticException, ClassCastException, IndexOutOfBoundsException, NoSuchElementException, NullPointerException. None of these Exceptions indicates that there is "going something wrong with the JVM" and the JVM isn't ended, why should it be? What's happening is, that the current Thread is sitting and waiting of somebody who is telling what to do. The only diffrence to other Exceptions is, that the Compiler can't ensure, that its impossible to produce this Error Situation. (BTW: it's possible to have a null instance within a method call!)

Now lets have a look to programmin g in Java. As a RuntimeException doesn't need to be declared and as a conclusion of this the Compiler doesn't force to do any ErrorHandling at all, but you could! And doing this, you would ensure, that the Thread is not stopped! Inside a true Java Application the death of a thread is no global problem! For J2EE applications the Container will manage this, inside a Swing or AWT application, the Runtime manages this and each Event is handled in an isolated Thread.

Having a look to the JNI Support of the RPG Compiler, it uses the same Thread (the main thread, I suppose) for all JNI calls occuring within a Job(!!!) and therefore the death of this Thread produces an unrecoverable error situation!!! And the bat thing of this is, that one function fails and it looks like it has worked and simply the next try (not related to the error) of another function will get an unrecoverable error. And this situation is no go to me!!!!!

I recommend once more very strongly: D o n o t u s e J a v a c a l l s f r o m R P G

Dieter


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.