Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ellipse 8 Web Services Java - EWSSimpleClientExample

Status
Not open for further replies.

WeiSu

Technical User
Dec 15, 2009
9
0
0
AU
Hi all,
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
 
Hi WeiSu,

Can you post your command line parameters so that I can comment.

Regards
Kes
 
Hi Kes,
The parameters are below.
private static String[] cmdLineParameterNames = {"suw", "Sxxxx", "114BQRT411", "VIC1", "dev-n01-vic.ellipsehosting.com", "9099"};

Regards,

WeiSu
 
Hi WeiSu,

I suggest that you change your program as follows :

private static String[] cmdLineParameterNames = {"user", "password", "position", "district", "host","port"};

The command line parameters or Arguments with you will pass will be as follows :

user=suw password=sxxxx position=114BQRT411 district=VIC1 host=dev-n01-vic.ellipsehosting.com port=9099

Hope this works for you,

Regards
Kes
 
Thanks Kes.
It get me to the next step, but I get this error.
In CalEWS set url Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com.mincom.ews.client.EWSClientConversation.<clinit>(EWSClientConversation.java:39)
at com.mincom.ews.client.example.SimpleEWSClient.callEWSService(SimpleEWSClient.java:110)
at com.mincom.ews.client.example.SimpleEWSClient.main(SimpleEWSClient.java:37)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
I add the common logging 1.2, but still get the same error.

Regards,

WeiSu
 
Hi WeiSu,

Seems like there might be a problem with your referenced libraries. It should look close to this (See attachment)

 
Thanks Kes.
After I added all the jar files, it move one more step forward, but it produces the error message below. I had confirm with ABB that the URL is correct.
Sorry to bother you again.

In CalEWS set url Nov 10, 2016 12:22:36 PM com.mincom.ews.client.EWSClientConversation start
WARNING: starting [com.mincom.ews.client.EWSClientConversation]
Nov 10, 2016 12:22:36 PM com.mincom.ews.client.EWSClientConversation start
INFO: using configuration from [META-INF/ews-config/ews-client-core.xml]
Nov 10, 2016 12:22:37 PM com.mincom.ews.client.EWSClientConversation start
WARNING: unable to open connection using []
java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at com.mincom.ews.client.EWSClientConversation.start(EWSClientConversation.java:95)
at com.mincom.ews.client.example.SimpleEWSClient.callEWSService(SimpleEWSClient.java:112)
at com.mincom.ews.client.example.SimpleEWSClient.main(SimpleEWSClient.java:37)

java.lang.RuntimeException: unable to open connection using []
at com.mincom.ews.client.EWSClientConversation.start(EWSClientConversation.java:100)
at com.mincom.ews.client.example.SimpleEWSClient.callEWSService(SimpleEWSClient.java:112)
at com.mincom.ews.client.example.SimpleEWSClient.main(SimpleEWSClient.java:37)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at sun.security.ssl.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at sun.net. Source)
at com.mincom.ews.client.EWSClientConversation.start(EWSClientConversation.java:95)
... 2 more
 
Hi WeiSu,

The error below colud mean.
1) The Site is refusing web service connection or Login user/password etc is invalid

I can't help you further unless i get the actual credentails. you can send it to : MoodleyKes at gm...


WARNING: unable to open connection using []
java.net.ConnectException: Connection refused: connect

Regards
Kes
 
Hi Kes,
This error is caused by our proxy, because the server is in Azure Cloud. Our network team is working on this issue.
Thanks for your help.
Regards,
WeiSu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top