Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, March 2007
exceptions in native code


Message 1 in thread

The exceptions:
java.lang.NullPointerException
	at com.trolltech.qt.gui.QApplication.exec(Native Method)
	at XXX.main(XXX.java:69)
java.lang.NullPointerException
	at com.trolltech.qt.gui.QApplication.exec(Native Method)
	at XXX.main(XXX.java:69)

The situation:
A window is open.
At some point, a background thread closes it by calling 
QCoreApplication.invokeLater()... and again 
QCoreApplication.invokeLater() is used to open a second window.
After the two Runnables are executed, that exception occurs.

I tried creating a small test case, but I couldn't reproduce the 
problem. Any ideas? Anything I should watch out for?


Message 2 in thread

Vadim Berezniker wrote:
> The exceptions:
> java.lang.NullPointerException
>     at com.trolltech.qt.gui.QApplication.exec(Native Method)
>     at XXX.main(XXX.java:69)
> java.lang.NullPointerException
>     at com.trolltech.qt.gui.QApplication.exec(Native Method)
>     at XXX.main(XXX.java:69)
> 
> The situation:
> A window is open.
> At some point, a background thread closes it by calling 
> QCoreApplication.invokeLater()... and again 
> QCoreApplication.invokeLater() is used to open a second window.
> After the two Runnables are executed, that exception occurs.
> 
> I tried creating a small test case, but I couldn't reproduce the 
> problem. Any ideas? Anything I should watch out for?

I think this related to a bug in QInvokable. You can try to replace the 
one in the package with the one here:

http://chaos.troll.no/~gunnar/QInvokable.java
http://chaos.troll.no/~gunnar/QInvokable.class

Best regards,
Gunnar



Message 3 in thread

Gunnar Sletta wrote:
> 
> I think this related to a bug in QInvokable. You can try to replace the 
> one in the package with the one here:
> 
> http://chaos.troll.no/~gunnar/QInvokable.java
> http://chaos.troll.no/~gunnar/QInvokable.class
> 
> Best regards,
> Gunnar
> 

I gave it a try. The exceptions went away.

Thanks.


Message 4 in thread

Hi,
I'm also having those native code exceptions when, for
example switching between two windows which run in
different threads (although the exceptions aren't
always thrown...).

Therefore I wanted to give the replacement of the
QInvokalbe.class a try.
But when I replace the .class file in the jar and try
my program with it, I get a
UnsupportedClassVersionError, telling me that there's
a bad version number in the .class-file (I am using
the beta, just as info).

Any ideas how I can get the replacement to work? 
Thanks, 
Franziska

--- Vadim Berezniker <kryptolus@xxxxxxxxx> schrieb:

> Gunnar Sletta wrote:
> > 
> > I think this related to a bug in QInvokable. You
> can try to replace the 
> > one in the package with the one here:
> > 
> > http://chaos.troll.no/~gunnar/QInvokable.java
> > http://chaos.troll.no/~gunnar/QInvokable.class
> > 
> > Best regards,
> > Gunnar
> > 
> 
> I gave it a try. The exceptions went away.
> 
> Thanks.
> 
> 





	
		
___________________________________________________________ 
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de


Message 5 in thread

finphoenix13-jambi@xxxxxxxx wrote:
> Hi,
 >
> I'm also having those native code exceptions when, for example
> switching between two windows which run in different threads
> (although the exceptions aren't always thrown...).
> 
> Therefore I wanted to give the replacement of the QInvokalbe.class a
> try. But when I replace the .class file in the jar and try my program
> with it, I get a UnsupportedClassVersionError, telling me that
> there's a bad version number in the .class-file (I am using the beta,
> just as info).
> 
> Any ideas how I can get the replacement to work? 

Hi,

Silly me ;-) I updated the .class file to be 1.5 based. It should also 
be possible to rebuild it yourself based on the .java file in the same 
location.

-
Gunnar