I have a Java application, built with eclipse, that uses QTJambi. Running the application from the command line works perfectly.
java -d32 -XstartOnFirstThread -jar MyApplication.jar someArg
However, trying to deploy the application with WebStart is proving difficult. I've done a whole lot of reading and it seems many people have issues getting this to work on Mac OS X. The issue seems to be that the native libraries aren't being correctly loaded. The stack trace is provided below.
CWindow's _nativeHide encountered error: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.javaws.Launcher.invokeMainMethod(Launcher.java:1819) Caused by: java.lang.ExceptionInInitializerError at com.trolltech.qt.QtJambiObject.(QtJambiObject.java:60) at com.engage.agentdesktop.Application.main(Application.java:25) ... 5 more Caused by: java.lang.RuntimeException: Loading library failed, progress so far: No 'qtjambi-deployment.xml' found in classpath, loading libraries via 'java.library.path' Loading library: 'libQtCore.4.dylib'... - using 'java.library.path' at com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(NativeLibraryManager.java:431) at com.trolltech.qt.internal.NativeLibraryManager.loadQtLibrary(NativeLibraryManager.java:355) at com.trolltech.qt.Utilities.loadQtLibrary(Utilities.java:140) at com.trolltech.qt.Utilities.loadQtLibrary(Utilities.java:136) at com.trolltech.qt.QtJambi_LibraryInitializer.(QtJambi_LibraryInitializer.java:56) ... 7 more Caused by: java.lang.RuntimeException: Library 'libQtCore.4.dylib' was not found in 'java.library.path'=/Users/smeatonj/Desktop/Engage Agent Desktop.app/Contents/Resources/Java:/System/Library/PrivateFrameworks/JavaApplicationLauncher.framework/Resources:.:/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java at com.trolltech.qt.internal.NativeLibraryManager.loadLibrary_helper(NativeLibraryManager.java:486) at com.trolltech.qt.internal.NativeLibraryManager.loadNativeLibrary(NativeLibraryManager.java:426) ... 11 more
This is an extract of the webstart.jnlp file:
`[resources`] `[j2se version="1.5+"/`] `[jar href="${MEDIA_URL}application/webstart/MyApplication.jar" /`] .... `[jar href="${MEDIA_URL}application/webstart/MyApplication_lib/qtjambi-4.5.2_01.jar" /`] `[resources os="Mac OS X"`] `[j2se version="1.5+" java-vm-args="-d32 -XstartOnFirstThread"/`] `[jar href="${MEDIA_URL}application/webstart/MyApplication_lib/qtjambi-macosx-gcc-4.5.2_01.jar" /`] `[/resources`]
The error tells me that qtjambi-deployment.xml is not found in the classpath. I've opened up qtjambi-macosx-gcc-4.5.2_01.jar and there is definitely the qtjambi-deployment.xml file there.
The resources os="Max OS X" node is definitely being loaded by the JNLP, because I was receiving different errors before that required me to put -d32 into the vm args. Does anyone know what the hell could be causing this error?
Edit:
The application runs fine when webstarting to Windows.