Dim mySession As JavaSession
Dim myClass As JavaClass
Dim myMethod As JavaMethod
Dim myObject As JavaObject
Dim myError As JavaError
Set mySession = New JavaSession ()
Set myClass = mySession.GetClass("ClassA")
Set myObject = myClass.CreateObject("()V")
Set myMethod = myClass.getMethod("FunctA", "()I")
On Error GoTo errhandler:
print myMethod.invoke(o)
done:
exit sub
errhandler:
set myError = mySession.getLastJavaError()
MessageBox myError.StackTrace,, Error
Resume done
(Results)
java.lang.ArithmeticException: / by zero
at valid5.javaconn.java.ClassC.FunctC(ClassC.java:6)
at valid5.javaconn.java.ClassB.FunctB(ClassB.java:5)
at valid5.javaconn.java.ClassA.FunctA(ClassA.java:5)