Trap and report errors failing to load non-available native libraries.
authorEd Swartz <ed.swartz@nokia.com>
Wed, 09 Dec 2009 15:40:36 -0600
changeset 665 12ea338ad1f6
parent 664 18b0c24adafe
child 666 4817219999f0
Trap and report errors failing to load non-available native libraries.
connectivity/com.nokia.tcf/src/com/nokia/tcf/impl/TCAPIConnection.java
debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TRKConnectedService.java
--- a/connectivity/com.nokia.tcf/src/com/nokia/tcf/impl/TCAPIConnection.java	Wed Dec 09 15:39:08 2009 -0600
+++ b/connectivity/com.nokia.tcf/src/com/nokia/tcf/impl/TCAPIConnection.java	Wed Dec 09 15:40:36 2009 -0600
@@ -46,7 +46,12 @@
 			} catch (UnsatisfiedLinkError e) {
 				// if Carbide DLL is not found in DE, 
 				// try to load one from the plugin itself
-				System.loadLibrary("TCFClient");
+				try {
+					System.loadLibrary("TCFClient");
+				} catch (UnsatisfiedLinkError e2) {
+					// no native TCF, e.g., not on Windows or in a misconfigured dev layout
+					e2.printStackTrace();
+				}
 			}
 		}
 	}
--- a/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TRKConnectedService.java	Wed Dec 09 15:39:08 2009 -0600
+++ b/debuggercdi/com.nokia.carbide.trk.support/src/com/nokia/carbide/trk/support/service/TRKConnectedService.java	Wed Dec 09 15:40:36 2009 -0600
@@ -41,7 +41,12 @@
 public class TRKConnectedService extends AbstractConnectedService {
 	
 	static {
-		System.loadLibrary("GetTRKVersion"); //$NON-NLS-1$
+		try {
+			System.loadLibrary("GetTRKVersion"); //$NON-NLS-1$
+		} catch (UnsatisfiedLinkError e) {
+			// no such library, e.g., not on Windows or in a misconfigured dev layout
+			e.printStackTrace();
+		}
 	}
 	
 	public native static void getTRKVersionFromSerial(String portName,