On Thursday 24 August 2006 17:18, Olivier Dragon wrote:
> Hi,
>
> I'm having issues with the emit() routine in QObject
with qtjava and I
> would really appreciate help in troubleshooting this
error. I'm
> writing an KDE app with qtjava and koala. When I run my
program I get:
>
> Exception in thread "main"
java.lang.UnsatisfiedLinkError: emit
> at org.kde.qt.QObject.emit(Native Method)
> at org.kde.qt.QObject.emit(QObject.java:117)
> at
ui.MainNetworkList.slotRefreshNetworks(MainNetworkList.java:
120)
> at
ui.MainNetworkList.<init>(MainNetworkList.java:65)
> at
ui.MainNetworkList.<init>(MainNetworkList.java:32)
> at Sonar.main(Sonar.java:44)
This is the Java emit method:
public native void emit(String signal, Object[] args);
And this is the JNI function it should link against:
JNIEXPORT void JNICALL
Java_org_kde_qt_QObject_emit(JNIEnv* env, jobject obj,
jstring signal,
jobjectArray args)
{
QtSupport::emitJavaSignal(env, obj, signal, args);
return;
}
I would be very surprised if JNI method signatures had
changed in Java 1.5.
The only thing I can suggest is trying an earlier Java with
the Debian libs,
or gcj perhaps. If you can get the sources try building the
.jar files with
the Java 1.5 and 1.4 javacs and see if there is any
difference. Its strange
that it 'half works' if you can get a slot to work with a
KPopupMenu I would
have expected everything to work.
-- Richard
> In Sonar.java I have the required
>
> static
> {
> qtjava.initialize();
> kdejava.initialize();
> }
>
> And all the libs, forms and GUI components load just
fine, which is what
> is throwing me off. QObject.connect() also seems to
work (it doesn't
> throw any errors or exceptions). Could it be a problem
with Java 1.5? I
> am using 1.5 features like generics and enums but not
with emit() or
> connect(). Could it be a mismatch of versions with
libs?
>
> I also tried to make a small program to make sure
nothing else was
> interfering with it but unfortunatly it wouldn't work.
I didn't get the
> UnsatisfiedLinkError exception, but the emit()
wouldn't go through...
> nothing was happening. Linking a KPopupMenu item to a
slot worked though.
>
> I'm running Debian unstable with these libraries:
> ii libqt3-java 3.5.3-1
Java
> bindings for Qt ii libqt3-jni
3.5.3-1
> Java bindings for Qt ( Native libraries ) ii
libkde3-java
> 3.5.3-1 kdelibs bindings for
Java ii libkde3-jni
> 3.5.3-1 kdelibs
bindings for java (
> Native libraries ) ii libqt3-headers
3.3.6-3
> Qt3 header files ii libqt3-mt
3.3.6-3
> Qt GUI Library (Threaded runtime version),
Version 3 ii
> kdelibs4c2a 3.5.4-3
core libraries
> and binaries for all KDE applications ii kdelibs-data
> 3.5.4-3 core shared data for all
KDE applications
>
> And this java compiler and VM:
> java version "1.5.0_04"
> Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_04-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_04-b05, mixed
mode, sharing)
>
>
> Thank you, I really appreciate you time and help.
>
> -Olivier
> _______________________________________________
> Kde-java mailing list
> Kde-java kde.org
> https:
//mail.kde.org/mailman/listinfo/kde-java
_______________________________________________
Kde-java mailing list
Kde-java kde.org
https:
//mail.kde.org/mailman/listinfo/kde-java
|