show vamsasId for aligments.
[vamsas.git] / src / org / vamsas / test / ExampleApplication.java
index 8118295..37e1498 100644 (file)
@@ -99,7 +99,7 @@ public class ExampleApplication {
     return true; // incorrect arguments.
   }
   public static void main(String[] args) {
-    if ((args.length<=2) || parseArgs(args)) {
+    if ((args.length<=2) || !parseArgs(args)) {
       System.err.print(Usage);
     }
 
@@ -114,7 +114,15 @@ public class ExampleApplication {
     // get an Iclient with session data
     app = new ClientHandle("org.vamsas.test.ExampleApplication","0.1");
     user = new UserHandle("arnolduser","deathsdoor");
-    vorbaclient = clientfactory.getIClient(app, user);
+    try {
+      vorbaclient = clientfactory.getIClient(app, user);
+    } catch (NoDefaultSessionException e) {
+      System.err.println("There appear to be several sessions to choose from :");
+      String[] sessions = clientfactory.getCurrentSessions();
+      for (int s=0;s<sessions.length; s++)
+        System.err.println(sessions[s]);
+      System.exit(2);
+    }
     addHandlers(vorbaclient);
     try {
       vorbaclient.joinSession();