I am experiencing an issue with a simple JNI app on Mac OS X using the 4.4.0 
Cocoa Port alpha and Mac OS X 10.5.2 w/ Apple's JVM 1.5.0_13-b05-237.

The java application is a very simple Swing application. It displays a frame 
with a button. Once the Swing button is clicked it makes a call via JNI to 
the native library which uses Qt to attempt and display a QMessageBox 
modally.

Here is a code snippet from the native implementation:

#include <QtCore>
#include <QtGui>

#include "HelloWorldImp.h"

JNIEXPORT void JNICALL Java_HelloWorld_displayHelloWorld(JNIEnv *env, 
jobject obj)
{
   int argc = 0;
   char *argv[] = {""};
   QApplication *pqapp = new QApplication(argc, argv);

   QMessageBox mb;
   mb.exec();
}

When I click the Swing button and a call is made into native library, the 
application crashes with the following error:

2008-04-21 15:15:09.301 java[29340:13a03] *** -[NSApplicationAWT 
setQtPrivate:]: unrecognized selector sent to instance 0x125430
2008-04-21 15:15:09.303 java[29340:13a03] An uncaught exception was raised
2008-04-21 15:15:09.303 java[29340:13a03] *** -[NSApplicationAWT 
setQtPrivate:]: unrecognized selector sent to instance 0x125430
2008-04-21 15:15:09.304 java[29340:13a03] *** Terminating app due to 
uncaught exception 'NSInvalidArgumentException', reason: 
'*** -[NSApplicationAWT setQtPrivate:]: unrecognized selector sent to 
instance 0x125430'


To unsubscribe - send "unsubscribe" in the subject to [EMAIL PROTECTED]

Reply via email to