Index: ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java =================================================================== --- ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java (revision 110879) +++ ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java (working copy) @@ -293,6 +293,10 @@ { e.printStackTrace(); log.error("Invocation of client main failed", e); + if (e instanceof InvocationTargetException) { + log.info("Rethrowing exception InvocationTargetException to client"); + throw (InvocationTargetException) e; + } } } Index: server/src/main/org/jboss/client/AppClientMain.java =================================================================== --- server/src/main/org/jboss/client/AppClientMain.java (revision 110879) +++ server/src/main/org/jboss/client/AppClientMain.java (working copy) @@ -124,6 +124,9 @@ String[] mainArgs = new String [newArgs.size()]; newArgs.toArray(mainArgs); + // Remember if an error occured + boolean errorOccured = false; + // Try each launcher in the order specified for(String launcherName : launchers) { @@ -137,7 +140,14 @@ catch(Throwable t) { log.warn("Failed to launch using: "+launcherName, t); + errorOccured = true; } + + // Give feedback to caller + if (errorOccured) + System.exit(-1); + else + System.exit(0); } }