Photon & J9 JNI

Hi, All.

I use SWT to build gui applications and added some extra widgets to SWT
as eclipse recommending. In QNX6.2.1 all my applications work well
but in QNX6.3 during any photon call in JNI j9 is stopped by unhandeled
exception.

What have changed that I can’t create widget in JNI?


Sergiy Uvarov

Can you please post the code where you added the extra widget? You have
to make sure that the mapping in the Display class is correct. If it is
off it will cause this problem.

Thanks,
Rodney


Sergiy Uvarov wrote:

Hi, All.

I use SWT to build gui applications and added some extra widgets to SWT
as eclipse recommending. In QNX6.2.1 all my applications work well
but in QNX6.3 during any photon call in JNI j9 is stopped by unhandeled
exception.

What have changed that I can’t create widget in JNI?


Sergiy Uvarov

Rodney Dowdall wrote:

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure it
is not 0 before you pass it to your create control function. If it is
zero, then you need to have a createHandle function in your class. This
is where you could call jni create control. If it is greater than 0,
and you are actually picking up the Composites handle, then try removing
the return from your createControls. After you call releaseElements, I
don’t think you can access the array anymore.

The constructor calls super(), super() calls createWidet() in Contorl
and last
method calls createHandle() in Widget so handle isn’t able to be zero.
Also I’ve cheched it. Exception occurs in the first call PtCreateWidget().

Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure it
is not 0 before you pass it to your create control function. If it is
zero, then you need to have a createHandle function in your class.
This is where you could call jni create control. If it is greater
than 0, and you are actually picking up the Composites handle, then
try removing the return from your createControls. After you call
releaseElements, I don’t think you can access the array anymore.


The constructor calls super(), super() calls createWidet() in Contorl
and last
method calls createHandle() in Widget so handle isn’t able to be zero.
Also I’ve cheched it. Exception occurs in the first call PtCreateWidget().

Try using the define Pt_DEFUALT_PARENT in the first PtCreateWidget call.

Thanks,
Rodney

Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure it
is not 0 before you pass it to your create control function. If it is
zero, then you need to have a createHandle function in your class.
This is where you could call jni create control. If it is greater
than 0, and you are actually picking up the Composites handle, then
try removing the return from your createControls. After you call
releaseElements, I don’t think you can access the array anymore.


The constructor calls super(), super() calls createWidet() in Contorl
and last
method calls createHandle() in Widget so handle isn’t able to be zero.
Also I’ve cheched it. Exception occurs in the first call PtCreateWidget().

createHandle in the Widget doesn’t do anything, so I believe it should
try and call the createHandle function in Composite, however, I am not
sure if your widget needs to have it’s own create handle function to
setup the initial handle. Your PtCreateWidget call looks fine, as long
as the value for parent is not NULL.

Thanks,
Rodney

Rodney Dowdall wrote:

Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure
it is not 0 before you pass it to your create control function. If
it is zero, then you need to have a createHandle function in your
class. This is where you could call jni create control. If it is
greater than 0, and you are actually picking up the Composites
handle, then try removing the return from your createControls. After
you call releaseElements, I don’t think you can access the array
anymore.



The constructor calls super(), super() calls createWidet() in Contorl
and last
method calls createHandle() in Widget so handle isn’t able to be zero.
Also I’ve cheched it. Exception occurs in the first call
PtCreateWidget().


Try using the define Pt_DEFUALT_PARENT in the first PtCreateWidget call.

As I have already written before the exception occurs in ANY photon
call. The arguments for PtCreateWidget are correct.

If I comment all and then add PpCreatePC() then the result the same. And
this is the problem. I suppose this problem arises due to swt native
compiled for libph.so.2 and my native compiles for libph.so.3.

May you give me the woking source of SWT library for QNX6.3 ?
Appling all those patches isn’t simple task.


Sergiy Uvarov

The source was sent to Sergiy. If anyone else is interested in an SWT
for QNX 6.3 please post here. The source is too big to post in the
newsgroup.

Thanks,
Rodney


Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure
it is not 0 before you pass it to your create control function. If
it is zero, then you need to have a createHandle function in your
class. This is where you could call jni create control. If it is
greater than 0, and you are actually picking up the Composites
handle, then try removing the return from your createControls.
After you call releaseElements, I don’t think you can access the
array anymore.




The constructor calls super(), super() calls createWidet() in Contorl
and last
method calls createHandle() in Widget so handle isn’t able to be
zero. Also I’ve cheched it. Exception occurs in the first call
PtCreateWidget().



Try using the define Pt_DEFUALT_PARENT in the first PtCreateWidget call.


As I have already written before the exception occurs in ANY photon
call. The arguments for PtCreateWidget are correct.

If I comment all and then add PpCreatePC() then the result the same. And
this is the problem. I suppose this problem arises due to swt native
compiled for libph.so.2 and my native compiles for libph.so.3.

May you give me the woking source of SWT library for QNX6.3 ?
Appling all those patches isn’t simple task.


Sergiy Uvarov

I am certainly interested.

Rodney Dowdall wrote:

The source was sent to Sergiy. If anyone else is interested in an SWT
for QNX 6.3 please post here. The source is too big to post in the
newsgroup.

Thanks,
Rodney


Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sergiy Uvarov wrote:

Rodney Dowdall wrote:

Sorry, I missed the JNI.

Can you check the value of handle in your constructor and make sure
it is not 0 before you pass it to your create control function. If
it is zero, then you need to have a createHandle function in your
class. This is where you could call jni create control. If it is
greater than 0, and you are actually picking up the Composites
handle, then try removing the return from your createControls.
After you call releaseElements, I don’t think you can access the
array anymore.





The constructor calls super(), super() calls createWidet() in
Contorl and last
method calls createHandle() in Widget so handle isn’t able to be
zero. Also I’ve cheched it. Exception occurs in the first call
PtCreateWidget().




Try using the define Pt_DEFUALT_PARENT in the first PtCreateWidget call.



As I have already written before the exception occurs in ANY photon
call. The arguments for PtCreateWidget are correct.

If I comment all and then add PpCreatePC() then the result the same.
And this is the problem. I suppose this problem arises due to swt
native compiled for libph.so.2 and my native compiles for libph.so.3.

May you give me the woking source of SWT library for QNX6.3 ?
Appling all those patches isn’t simple task.


Sergiy Uvarov