Re: [Ikvm-developers] Qt Jambi on IKVM
Brought to you by:
jfrijters
|
From: Jeroen F. <je...@su...> - 2006-11-09 13:47:34
|
Hi Jon, I have not yet tried it on Linux, if could try and report the result = that would be very helpful. Thanks, Jeroen > -----Original Message----- > From: Jon Chambers [mailto:jo...@gm...]=20 > Sent: Thursday, November 09, 2006 14:19 > To: Jeroen Frijters > Cc: ikv...@li... > Subject: Re: [Ikvm-developers] Qt Jambi on IKVM >=20 > Jeroen, > I will contact the Qt guys. Did you happen to try on=20 > Linux, as I assume cdecl is the expected calling convention=20 > there and things would work? If not, I can try sometime today. >=20 > Thanks, > Jonathan >=20 >=20 > On 11/9/06, Jeroen Frijters <je...@su...> wrote: >=20 > Hi Jon, > =09 > The name decoration is indeed not required (and ikvm=20 > looks for both the decorated and undecorated names -- this is=20 > actually the reason why ikvm cannot automagically determine=20 > the calling convention, if the decoration was always=20 > consistent, I would be able to dynamically select the proper=20 > calling convention).=20 > =09 > Here's an example of the type of errors I get: > C:\j\qt\qtjambi-win-1.0.0-tp3>\ikvm\bin\ikvm -cp=20 > .;qtjambi.jar com.trolltech.demos.TextEdit > QtJambi: Exception pending in native code > java.lang.IllegalArgumentException : Invalid format of=20 > path: ???=F6 > at=20 > com.trolltech.qt.QClassPathEngine.setFileName(QClassPathFileEn > gineHandler.java) > at=20 > com.trolltech.qt.QClassPathEngine.<init>(QClassPathFileEngineH > andler.java)=20 > at=20 > com.trolltech.qt.QClassPathFileEngineHandler.create(QClassPath > FileEngineHandler.java) > at IKVM.Runtime.JNIEnv.InvokeHelper(Unknown Source) > at=20 > IKVM.Runtime.JNIEnv.CallObjectMethodA(Unknown Source)=20 > at=20 > com.trolltech.qt.gui.QIcon.__qt_QIcon_String(QIcon.java) > at com.trolltech.qt.gui.QIcon.<init>(QIcon.java) > at com.trolltech.demos.TextEdit.init(TextEdit.java) > at com.trolltech.demos.TextEdit.showEvent=20 > (TextEdit.java) > at IKVM.Runtime.JNIEnv.InvokeHelper(Unknown Source) > at IKVM.Runtime.JNIEnv.CallVoidMethodA(Unknown Source) > at com.trolltech.qt.gui.QWidget.__qt_show(QWidget.java) > at com.trolltech.qt.gui.QWidget.show(QWidget.java) > at com.trolltech.demos.TextEdit.main(TextEdit.java) > QtJambi: Exception pending in native code > java.lang.IllegalArgumentException: Invalid format of=20 > path: ???=F6=20 > at=20 > com.trolltech.qt.QClassPathEngine.setFileName(QClassPathFileEn > gineHandler.java) > at=20 > com.trolltech.qt.QClassPathEngine.<init>(QClassPathFileEngineH > andler.java) > at=20 > com.trolltech.qt.QClassPathFileEngineHandler.create=20 > (QClassPathFileEngineHandler.java) > at IKVM.Runtime.JNIEnv.InvokeHelper(Unknown Source) > at IKVM.Runtime.JNIEnv.CallObjectMethodA(Unknown Source) > at com.trolltech.qt.gui.QIcon.__qt_QIcon_String=20 > (QIcon.java) > at com.trolltech.qt.gui.QIcon.<init>(QIcon.java) > at com.trolltech.demos.TextEdit.init(TextEdit.java) > at com.trolltech.demos.TextEdit.showEvent(TextEdit.java) > at IKVM.Runtime.JNIEnv.InvokeHelper(Unknown Source) > at IKVM.Runtime.JNIEnv.CallVoidMethodA(Unknown Source) > at com.trolltech.qt.gui.QWidget.__qt_show(QWidget.java) > at com.trolltech.qt.gui.QWidget.show (QWidget.java) > at com.trolltech.demos.TextEdit.main(TextEdit.java) > *** exception in native code *** > System.NullReferenceException: Object reference not set=20 > to an instance of an object. > at com.trolltech.qt.gui.QWidget.__qt_show (Int64 ) > Exception in thread "main" java.lang.NullPointerException > at IKVM.Runtime.JNIEnv.InvokeHelper(Unknown Source) > at IKVM.Runtime.JNIEnv.CallVoidMethodA(Unknown Source) > at com.trolltech.qt.gui.QWidget.__qt_show(QWidget.java) > at com.trolltech.qt.gui.QWidget.show(QWidget.java) > at com.trolltech.demos.TextEdit.main(TextEdit.java) > =09 > I also looked at the disassembly of=20 > com_trolltech_qt_core.dll and unless I'm mistaken it looks=20 > like it doesn't pop the method arguments from the stack (as=20 > is required by __stdcall).=20 > =09 > Regards, > Jeroen > =09 > > -----Original Message----- > > From: Jon Chambers [mailto:jo...@gm...] > > Sent: Thursday, November 09, 2006 14:00 > > To: Jeroen Frijters=20 > > Cc: ikv...@li... > > Subject: Re: [Ikvm-developers] Qt Jambi on IKVM > > > > Hi Jeroen, > > > > First, thanks for the work on ikvm. The fact this is=20 > > *possible* is very cool. > > > > A google or two found some hits with questions about stdcall > > vs. cdecl with JNI. From what I gather (if information on > > internet is reliable ;-) ), JNI should be stdcall on windows=20 > > *but* alot of links state that the JVM is looking for > > unmangled names anyway. This can be accomplished via a def > > file in VS, or a flag on gcc. So, I'm wondering if the > > undecorated names in com_trolltech_qt_core.dll are still=20 > > stdcall. Would undecorated names cause a problem for the IKVM > > JNI layer? If not, any other thoughts? I'm willing to track > > this down myself with some direction. It seems from the > > output that the library was loaded, was the symbol resolved?=20 > > I'm trying to find out what the exact error is. > > > > Thnaks Alot, > > Jonathan > > > > > > On 11/9/06, Jeroen Frijters <je...@su...> wrote:=20 > > > > Hi Jon, > > > > I can't get *any* of the examples/demos included in the > > preview to work > > on ikvm. From the looks of it, I'd guess that=20 > the various > > com_trolltech_qt_*.dlls use the wrong calling=20 > convention for the=20 > > exported JNI methods. > > > > On Windows, JNI methods need to use the __stdcall > > calling convention > > (usually this is done automatically by the JNICALL > > #define in jni_md.h).=20 > > For some unfortunate reason __cdecl also appears to > > work on the Sun JVM, > > but unfortunately ikvm cannot magically support both. > > > > Also see: > > > >=20 > http://weblog.ikvm.net/PermaLink.aspx?guid=3D42da1751-bf3e-44df- > <http://weblog.ikvm.net/PermaLink.aspx?guid=3D42da1751-bf3e-44df->=20 > > a43a-e198d > > 6a26c06 > > > > Regards, > > Jeroen > > > > > -----Original Message----- > > > From: ikv...@li... > > > [mailto:=20 > ikv...@li... ] On > > > Behalf Of Jon Chambers > > > Sent: Thursday, November 09, 2006 02:50 > > > To: ikv...@li...=20 > > <mailto:ikv...@li...> > > > Subject: [Ikvm-developers] Qt Jambi on IKVM > > > > > > Hi everyone,=20 > > > I am trying out Qt Jambi > > > ( > > http://www.trolltech.com/developer/downloads/qt/qtjambi-techp > > <=20 > http://www.trolltech.com/developer/downloads/qt/qtjambi-techp> > > > review) on IKVM. These are official Java bindings from > > > Trolltech that are about to be released; they=20 > are at their=20 > > > final technology preview right now. Anyway, I=20 > wrote a sample > > > app that works great under ikvm.exe. However,=20 > my goal is > > > really to use Qt from C#. So, I compiled the=20 > qtjambi.jar file > > > with ikvmc, and got an assembly. I wrote my=20 > app in C# an > > > everything built. However, when I run my app I get the > > > following error (note I got some debug=20 > tracing by adding=20 > > > IKVM.Internal.Tracer.EnableTraceForDebug ()=20 > to the beginning > > > of my app). I think the JNI method in=20 > question resides in > > > com_trolltech_qt_core.dll which seems to get=20 > loaded. If this=20 > > > is a problem in qtjambi, I'll like to let=20 > them know before > > > the final release; it would be very cool if=20 > IKVM could help > > > get C# bindings from the java ones. But again=20 > my app runs=20 > > > fine on ikvm, so I'm guessing it's something=20 > specific to > > > ikvmc? Any help/direction would be appreciated. > > > > > > Thanks, > > > Jonathan Chambers=20 > > > > > > C:\eclipse\QtJambiTest\bin\Debug>QtJambiTest.exe > > > [20:41:25.20312 ] Core assembly: > > > C:\eclipse\QtJambiTest\bin\Debug\IKVM.GNU.Class > > > path.dll > > > [20:41:25.20312 ] Remapping type System.Exception to > > > java.lang.Throwable > > > [20:41:25.20312 ] Remapping type System.IComparable to > > > java.lang.Comparable=20 > > > [20:41:25.20312 ] Remapping type System.Object to > > java.lang.Object > > > [20:41:25.20312 ] Remapping type System.String to > > java.lang.String > > > [20:41:25.62500 ] loadLibrary: > > > C:\eclipse\QtJambiTest\bin\Debug\QtCore4.dll, cla > > > ss loader: java.lang.ClassLoader$1@2004EEE > > > [20:41:25.62500 ] loadLibrary: > > > C:\eclipse\QtJambiTest\bin\Debug\qtjambi.dll, cla=20 > > > ss loader: java.lang.ClassLoader$1@2004EEE > > > [20:41:25.62500 ] loadLibrary: > > > C:\eclipse\QtJambiTest\bin\Debug\QtCore4.dll, cla > > > ss loader: java.lang.ClassLoader$1@2004EEE=20 > > > [20:41:25.62500 ] loadLibrary: > > > C:\eclipse\QtJambiTest\bin\Debug\QtGui4.dll, clas > > > s loader: java.lang.ClassLoader$1@2004EEE > > > [20:41:25.62500 ] loadLibrary:=20 > > > C:\eclipse\QtJambiTest\bin\Debug\com_trolltech_qt > > > _core.dll, class loader:=20 > java.lang.ClassLoader$1@2004EEE > > > [20:41: 25.64062 ] Linking native method: > > > com/trolltech/qt/core/QtJambi_LibraryIn=20 > > > itializer.__qt_initLibrary()V, class loader =3D > > > java.lang.ClassLoader$1@2004EEE, s > > > hort =3D > > > > >=20 > Java_com_trolltech_qt_core_QtJambi_1LibraryInitializer__1_1qt_=20 > > > 1initLibrar > > > y, long =3D > > >=20 > Java_com_trolltech_qt_core_QtJambi_1LibraryInitializer__1_1qt_ > > > 1initLib > > > rary__, args =3D 8 > > > [20:41: 25.64062 ] UnsatisfiedLinkError: > > > com/trolltech/qt/core/QtJambi_LibraryIni > > > tializer.__qt_initLibrary()V > > > > > > Unhandled Exception:=20 > System.TypeInitializationException : The > > > type initializer fo > > > r 'com.trolltech.qt.gui.QApplication' threw=20 > an exception. > > > ---> System.TypeInitia > > > lizationException: The type initializer for=20 > > > 'com.trolltech.qt.core.QCoreApplicat > > > ion' threw an exception. ---> > > > System.TypeInitializationException : The type initi > > > alizer for ' com.trolltech.qt.core.QObject ' threw an > > > exception. ---> System.TypeI > > > nitializationException: The type initializer for > > > 'com.trolltech.qt.QtObject' thr > > > ew an exception. --->=20 > System.TypeInitializationException : > > > The type initializer f > > > or=20 > 'com.trolltech.qt.QtJambi_LibraryInitializer' threw an > > > exception. ---> System > > > .TypeInitializationException: The type=20 > initializer for=20 > > > 'com.trolltech.qt.QClassP > > > athFileEngineHandler' threw an exception. ---> > > > System.TypeInitializationExceptio > > > n: The type initializer for > > > ' com.trolltech.qt.core.QAbstractFileEngineHandler' t > > > hrew an exception. --->=20 > System.TypeInitializationException: > > > The type initializer > > > for=20 > 'com.trolltech.qt.core.QtJambi_LibraryInitializer ' > > > threw an exception. ---> > > > java.lang.UnsatisfiedLinkError: > > > com/trolltech/qt/core/QtJambi_LibraryInitialize > > > r.__qt_initLibrary()V > > > --- End of inner exception stack trace ---=20 > > > at=20 > com.trolltech.qt.core.QtJambi_LibraryInitializer.init () > > > at > > com.trolltech.qt.core.QAbstractFileEngineHandler..cctor () > > > --- End of inner exception stack trace ---=20 > > > at > > com.trolltech.qt.core.QAbstractFileEngineHandler.__<clinit>() > > > at=20 > com.trolltech.qt.QClassPathFileEngineHandler..cctor () > > > --- End of inner exception stack trace ---=20 > > > at > > com.trolltech.qt.QClassPathFileEngineHandler.__<clinit>() > > > at=20 > com.trolltech.qt.QtJambi_LibraryInitializer..cctor() > > > --- End of inner exception stack trace ---=20 > > > at=20 > com.trolltech.qt.QtJambi_LibraryInitializer.init () > > > at com.trolltech.qt.QtObject..cctor() > > > --- End of inner exception stack trace --- > > > at com.trolltech.qt.QtObject.__<clinit>() > > > at com.trolltech.qt.core.QObject..cctor () > > > --- End of inner exception stack trace --- > > > at com.trolltech.qt.core.QObject._ _<clinit>() > > > at com.trolltech.qt.core.QCoreApplication..cctor() > > > --- End of inner exception stack trace --- > > > at=20 > com.trolltech.qt.core.QCoreApplication._ _<clinit>() > > > at com.trolltech.qt.gui.QApplication..cctor() > > > --- End of inner exception stack trace --- > > > at com.trolltech.qt.gui.QApplication..ctor > > (String[] strarr)=20 > > > at QtJambiTest.Program.Main(String[] args) in > > > C:\eclipse\QtJambiTest\Program. > > > cs:line 13 > > > > > > > > > > > > > > > =09 >=20 >=20 >=20 |