×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Ellipse 8 Web Services Java - EWSSimpleClientExample

Ellipse 8 Web Services Java - EWSSimpleClientExample

Ellipse 8 Web Services Java - EWSSimpleClientExample

(OP)
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[i], "");
}
for (int i=0;i<args.length;i++) {
StringTokenizer sTokenizer = new StringTokenizer(args[i],"=");
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

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

Hi WeiSu,

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

Regards
Kes

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

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

Regards,

WeiSu

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

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

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

(OP)
Thanks Kes.
It get me to the next step, but I get this error.
In CalEWS set url https://dev-n01-vic.ellipsehosting.com:9099/ews/se...
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

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

Hi WeiSu,

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

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

(OP)
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 https://dev-n01-vic.ellipsehosting.com/ews/service...
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 [https://dev-n01-vic.ellipsehosting.com/ews/service...]
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.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknow... Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnect... Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(... Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(U... Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnect... Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(... 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 [https://dev-n01-vic.ellipsehosting.com/ews/service...]
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.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknow... Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnect... Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(... Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(U... Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnect... Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(... Source)
at com.mincom.ews.client.EWSClientConversation.start(EWSClientConversation.java:95)
... 2 more

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

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 [https://dev-n01-vic.ellipsehosting.com/ews/service...]
java.net.ConnectException: Connection refused: connect

Regards
Kes

RE: Ellipse 8 Web Services Java - EWSSimpleClientExample

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close