Hi all,
I am trying to run this java example in Eclipse Mars-2, but it doesn't pass the first method.
for (int i=0;i<cmdLineParameterNames.length;i++) {
cmdLineParameters.put(cmdLineParameterNames, "");
}
for (int i=0;i<args.length;i++) {
StringTokenizer sTokenizer = new StringTokenizer(args,"=");
String paramName = null;
if (sTokenizer.countTokens()>0) {
paramName = sTokenizer.nextToken().toLowerCase();
} else {
throw new Exception("error in comand line parameters");
}
if (sTokenizer.countTokens()>=1) {
String value = sTokenizer.nextToken();
String oldValue =cmdLineParameters.put(paramName, value);
if (oldValue==null) {
throw new Exception("Unknown parameter = "+paramName);
}
} else {
throw new Exception("error in comand line parameters");
}
}
String exceptionCause = "missing command line parameters: ";
StringBuilder sBuilder = new StringBuilder(exceptionCause);
for (String paramName : cmdLineParameters.keySet()) {
if ("".equals(cmdLineParameters.get(paramName))&& !"password".equals(paramName)) {
sBuilder.append(paramName);
sBuilder.append(", ");
}
}
if (!sBuilder.toString().endsWith(exceptionCause)) {
throw new Exception(sBuilder.toString().substring(0, sBuilder.toString().lastIndexOf(", ")-1));
}
}
I get this error below,
java.lang.Exception: missing command line parameters: xxx-n01-xxx.ellipsehosting.com, myID, district, password, positionid, 909
at com.mincom.ews.client.example.SimpleEWSClient.processCmdLineParameters(SimpleEWSClient.java:71)
at com.mincom.ews.client.example.SimpleEWSClient.main(SimpleEWSClient.java:32)
Thanks
I am trying to run this java example in Eclipse Mars-2, but it doesn't pass the first method.
private void processCmdLineParameters(String[] args) throws Exception {for (int i=0;i<cmdLineParameterNames.length;i++) {
cmdLineParameters.put(cmdLineParameterNames, "");
}
for (int i=0;i<args.length;i++) {
StringTokenizer sTokenizer = new StringTokenizer(args,"=");
String paramName = null;
if (sTokenizer.countTokens()>0) {
paramName = sTokenizer.nextToken().toLowerCase();
} else {
throw new Exception("error in comand line parameters");
}
if (sTokenizer.countTokens()>=1) {
String value = sTokenizer.nextToken();
String oldValue =cmdLineParameters.put(paramName, value);
if (oldValue==null) {
throw new Exception("Unknown parameter = "+paramName);
}
} else {
throw new Exception("error in comand line parameters");
}
}
String exceptionCause = "missing command line parameters: ";
StringBuilder sBuilder = new StringBuilder(exceptionCause);
for (String paramName : cmdLineParameters.keySet()) {
if ("".equals(cmdLineParameters.get(paramName))&& !"password".equals(paramName)) {
sBuilder.append(paramName);
sBuilder.append(", ");
}
}
if (!sBuilder.toString().endsWith(exceptionCause)) {
throw new Exception(sBuilder.toString().substring(0, sBuilder.toString().lastIndexOf(", ")-1));
}
}
I get this error below,
java.lang.Exception: missing command line parameters: xxx-n01-xxx.ellipsehosting.com, myID, district, password, positionid, 909
at com.mincom.ews.client.example.SimpleEWSClient.processCmdLineParameters(SimpleEWSClient.java:71)
at com.mincom.ews.client.example.SimpleEWSClient.main(SimpleEWSClient.java:32)
Thanks