我有一個使用Eclipse構建的Java應用程序,它使用QTJambi。從命令行運行應用程序完美地工作。問題在Mac OS X上使用web start啓動QT Jambi
java -d32 -XstartOnFirstThread -jar MyApplication.jar someArg
但是,嘗試使用WebStart部署應用程序非常困難。我已經做了大量的閱讀,似乎很多人有問題讓這個在Mac OS X上工作。這個問題似乎是本機庫沒有正確加載。堆棧跟蹤如下所示。
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
這是webstart.jnlp文件的摘錄:
`[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`]
錯誤告訴我,qtjambi-deployment.xml中沒有在classpath中找到。我打開了qtjambi-macosx-gcc-4.5.2_01.jar,那裏肯定有qtjambi-deployment.xml文件。
資源os =「Max OS X」節點肯定是由JNLP加載的,因爲在此之前我收到了不同的錯誤,要求我將-d32放入vm參數中。有誰知道這可能會導致這個錯誤?
編輯:
當webstarting到Windows時,應用程序運行良好。