[Tcl Java] java::bind questions

1999-12-09 Thread Randolph S. Kahle


I am trying to get java::bind to work in the following situation:

* I am developing services for my application as represented by Java interfaces

* The interface has addlistener and removelistener method signatures.

* Access to the service is managed through TclCmd classes (so the Tcl 
script is *not* referencing objects)

* The Service has a method getObject which returns a ReflectObject wrapping 
the interface's implementation.

* set l [Login getObject] works, I get a ref that supports things like $l show

* when I execute java::bind $l processLogin login I get a 
java.lang.NullPointerException

where:

proc login {} {
   do stuff
}

I am going to work my way through this, but if anyone has any helpful 
pointers I would appreciate hearing from you.

Thanks -- Randy Kahle




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]'. 



[Tcl Java] Re: [Tcl Java] java::bind questions

1999-12-09 Thread Mo DeJong

You might want to try this to get a stack trace. That might really
help track down the problem.

java::try {
  java::bind $l processLogin login
} catch {NullPointerException e} {
  $e printStactTrace
}

Mo Dejong
Cygnus Solutions


 * set l [Login getObject] works, I get a ref that supports things like $l show
 
 * when I execute java::bind $l processLogin login I get a 
 java.lang.NullPointerException
 
 where:
 
 proc login {} {
do stuff
 }
 
 I am going to work my way through this, but if anyone has any helpful 
 pointers I would appreciate hearing from you.
 
 Thanks -- Randy Kahle


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]'. 



[Tcl Java] Re: [Tcl Java] Re: [Tcl Java] Re: [Tcl Java] java::bind questions

1999-12-09 Thread Randolph S. Kahle

Mo,

The problem was mine. The collection object that held listeners was null 
(never initialized). That was the null pointer problem.

java::bind seems fine. I'm using it to do queries, etc. and it seems 
reasonable. I will be working over Jacl in the next couple of days as our 
team completes a prototype of a client-side architecture for building a new 
generation of applications. Jacl is really helping us pull this together.

I am running into another block... Now that I can do this --

java::bind $l processLogin login

where

proc login {} {
...
}

When the event is fired from Java, it never returns from the method call on 
processLogin on the listener (the link to the tcl script).

Any suggestions on how I can trace down where my thread went? Can any 
thread fire the event into Tcl? (I remember reading through the source code 
and seeing something about the event system keeps track of the 
interpreter's primary thread...)

(Do I need to have a thread spinning on the interpreter?)

Randy

Was it a bug in the tcljava code or your code? Could the java::bind
command be improved in some way to avoid this type of problem in
the future?

Mo Dejong
Cygnus Solutions

On Thu, 9 Dec 1999, Randolph S. Kahle wrote:

  Mo,
 
  Problem solved in very short order because of your help.
 
  Thank you *very* much for the prompt reply to my email.
 
  Regards,
 
  Randy Kahle
 
 
 
 


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]'.


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]'.