cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
603
Views
0
Helpful
1
Replies

Webservice access outside of NSO

suvdeshm
Cisco Employee
Cisco Employee

I wrote an action class to access webservice outside of NSO

 

 

Action class uses:

/* HttpClient client = HttpClientBuilder.create().build();

ResourceManager.registerResources(client);

HttpGet request = new HttpGet(url);

request.addHeader("User-Agent", "Mozilla/5.0");

HttpResponse response = client.execute(request);

-------------------

 

The action class gives an error:

<ERROR> 11-Mar-2019::11:55:07.901 DpActionTrans Did-139-Worker-126: - Exception from action callback
com.tailf.dp.DpCallbackException: org/apache/http/client/methods/HttpUriRequest
at com.tailf.dp.annotations.ProxyUtils.invocationTargetCheck(ProxyUtils.java:78)
at com.tailf.dp.annotations.ActionCallbackProxy.action(ActionCallbackProxy.java:139)
at com.tailf.dp.DpActionTrans.protoCallback(DpActionTrans.java:315)
at com.tailf.dp.DpActionTrans.read(DpActionTrans.java:221)
at com.tailf.dp.DpActionTrans.run(DpActionTrans.java:128)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
at com.tailf.dp.DpThread.run(DpThread.java:41)
Caused by: java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
at com.cisco.hsm.hsmgetkeyRFS.hsmgetkey(hsmgetkeyRFS.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.tailf.dp.annotations.ActionCallbackProxy.action(ActionCallbackProxy.java:125)

1 Reply 1

joepak
Cisco Employee
Cisco Employee
It seems stackoverflow has related issue which seem to point to pointing the httpclient to the appropriate librarie/classpath -

https://stackoverflow.com/questions/52965701/error-java-lang-noclassdeffounderror-org-apache-http-client-methods-httpurirequ