updated example application to handle IClient.getDocument() exceptions and ensured...
[vamsas.git] / src / org / vamsas / test / ExampleApplication.java
index e8bce3c..8118295 100644 (file)
@@ -105,7 +105,7 @@ public class ExampleApplication {
 
     // get IClientFactory
     try {
-      clientfactory = new org.vamsas.client.SimpleClientFactory(args[0]);
+      clientfactory = new org.vamsas.client.simpleclient.SimpleClientFactory(args[0]);
     } catch (IOException e) {
       System.err.println(e+"\n"+Usage);
       System.exit(1);
@@ -126,7 +126,14 @@ public class ExampleApplication {
     }
     // register an update listener and a close listener.
     // get document data
-    processVamsasDocument(vorbaclient.getClientDocument());
+    try {
+      IClientDocument cdoc = vorbaclient.getClientDocument();
+      processVamsasDocument(cdoc);
+    } catch (Exception e) {
+      System.err.println("Unexpected exception when retrieving the client document for the first time!");
+      e.printStackTrace(System.err);
+      System.exit(1);
+    }
 
     // Main application event loop - wait around and do stuff...
     while (!isShuttingdown) {