Hi again Blair,
i am using NewGlobalRef to store the references.Tha "nature" of the problem
is a Exception being thown from the native side when creating a Java object
(an event ). The constructor expects a reference to the source of the event
getting a null instead. This behaviour appears just when the java object
calling the native method is the source of the event. Please don�t worry too
much as i am trying oder solutions :-).
Thanks anyway

----- Original Message -----
From: "Blair Wyman" <[EMAIL PROTECTED]>
To: "jdjlist" <[EMAIL PROTECTED]>
Sent: Thursday, February 20, 2003 6:46 PM
Subject: [jdjlist] Re: jni-saved reference as parameter for new objects
beingcreated



On Thursday, 02/20/2003 at 11:17 CET, "Tomas Bonilla Rau"
<[EMAIL PROTECTED]> wrote:

> does anynone know what the VM does with an object when calling one of its
> instance methods (synchronized).I am having problems when this method
makes
> a native call and i try to use a previously (global) saved reference as a

...by (global), do you mean created by a call to the JNI function
NewGlobalRef?  If not, that's likely your problem -- you're passing an old
local ref, which is almost automatically garbage.  If you are calling
NewGlobalRef, what is the nature of the "problem" that occurs?  Crash?
Panic?  Exception?

N.B. You can't expect to share a ref between threads -- or to save a ref in
static storage for later use, even by the same thread -- unless that ref
was returned by NewGlobalRef (or NewWeakGlobalRef).

> constructor parameter for new java objects being created (from the native
> side obviously). The problem doesn�t appear when the parameter is not the
> source of the native call.Thanks

HTH.

-blair

Blair Wyman -- iSeries JVM -- (507) 253-2891
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"It is a sobering thought that when Mozart was my age,
he had been dead for two years." -- Tom Lehrer




---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
http://www.sys-con.com/fusetalk


---
You are currently subscribed to jdjlist as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
http://www.sys-con.com/fusetalk

Reply via email to