This is a followup to the next two postings.

>We've been experiencing an intermittent error when trying to
> reference the second object in the global variable $errorCode.
>
>In the case of a java exception, Tcl blend sets the second object in
>errorCode to a reference to the java exception.  Occaisionally, when
>referencing the java exception to get a stack trace as in:
>
>        set exception [lindex $errorCode 1]
>        $exception printStackTrace
>
>we experience the following error:
>
>        invalid command "java0x12345"
>
>(the memory address  of the exception) at the $exception printStackTrace
>line.  Sometimes we get the stack trace, sometimes we get the error.
>
>Thank you,
>David Birtwell

...

>On Thu, 17 Feb 2000 [EMAIL PROTECTED] wrote:
> 
> 
> 
> Hi,
> 
> I am not positive that this is the answer, but I have experienced a similar
> thing.  I was actually getting a tcl.lang.ReflectObject back and had to use
> something like:
> 
> set exception [lindex $errorCode 1]
> [$exception get] printStackTrace
> 
> Hope this helps.
> Dan Munk


Can this problem be reproduced with some small script?
You could try running [java::info class $exception] and see what
type the second element of the errorCode is getting set to.
It should be the java.lang.Throwable or some type derived
from Throwable (like Exception). It should not be a
tcl.lang.ReflectObject! If it is a ReflectObject, than
something is very wrong. You could also try running
java::isnull to test the ref and make sure the internal
rep is a Java object type. If this problem is caused by
the catch command, would switching to the java::try
command fix it?

Mo DeJong
Red Hat Inc. 

----------------------------------------------------------------
The TclJava mailing list is sponsored by Scriptics Corporation.
To subscribe:    send mail to [EMAIL PROTECTED]  
                 with the word SUBSCRIBE as the subject.
To unsubscribe:  send mail to [EMAIL PROTECTED] 
                 with the word UNSUBSCRIBE as the subject.
To send to the list, send email to '[EMAIL PROTECTED]'. 
An archive is available at http://www.mail-archive.com/tcljava@scriptics.com

Reply via email to