Avaya Support Forums  

Go Back   Avaya Support Forums > Avaya Breeze™ Collaboratory

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-17-2016, 12:29 PM
ander548 ander548 is offline
Whiz
 
Join Date: Jun 2016
Posts: 37
ander548 has 10 reputation points
Default Dynamic Task with HTTP post missing dependencies

I have created the scaffolding for a dynamic task with a single added input/output value and it seems to work fine when I install it in ED and test it in a workflow. But, when I try to add the following code below, it installs but I get workflow errors that seem to be pointing to ClassNotFound type errors in the EngagementDesigner.log. My guess is that I'm either using the wrong objects to do an HTTP POST with Breeze, or missing some dependencies. Does anyone have an example of some code to do an HTTP POST in Breeze with the necessary Maven dependencies? Here is what I have. Note that this builds with "mvn clean package" fine and the svar loads/installs in ED, but I get an error when I use it in a workflow. The EngagementDesigner logs (with this code) are saying ClassNotFoundException for org.apache.http.ssl.SSLContext.

NOTE: My project zip file is too large to upload here, but I have uploaded to a post on the devconnect forum here:

http://www.devconnectprogram.com/for...ist/20155.page

Code in my execute method of HelloExecution.java with simple HTTP POST to a test url (Open to a more Breeze-friendly code sample):

CloseableHttpClient httpclient = HttpClients.createDefault();
HttpPost httpPost = new HttpPost("http://testurl.com");
CloseableHttpResponse response2 = httpclient.execute(httpPost);
response2.close();

imports added to top of HelloExecution.java:

import org.apache.http.client.methods.CloseableHttpRespon se;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.HttpRequest;

dependencies added to my pom.xml:

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>1.1.1</version>
<scope>compile</scope>
</dependency>

Import-Package setting in pom.xml (I keep adding classes to this each time I get ClassNotFound in the log and it fixes the one I added and gets another one. With this code, it is griping about org.apache.http.ssl.SSLContext, but if I add that to the Import-Package I get "Failed to Deploy" when I try to install the svar. So I'm not sure what's going on:

<Import-Package>org.apache.http.util,org.apache.http.proto col,org.apache.http,org.apache.http.config,org.apa che.http.client.methods,org.apache.http.impl.clien t.*,com.avaya.collaboration.util.logger,javax.pers istence,org.json,com.avaya.app.entity,com.avaya.wo rkflow.*,com.roobroo.*;!*</Import-Package>
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 10:51 AM.

This Forum is provided solely for the use and convenience of Avaya customers and partners. Use of the Forum is subject to the Terms and Use and Privacy Statement found at www.avaya.com. No other use is permitted. The Forum including all content posted is “AS IS” and Avaya expressly disclaims all warranties and/or guarantees as to its accuracy, reliability, usefulness, quality or non-infringement of intellectual property. Avaya reserves the right to remove any content posted on the Forum at any time and for whatever reason.

Avaya will not be liable for any content posted on this Forum, including, without limitation, any errors or omissions or for any losses or damages of any kind incurred as a result of use or reliance on any content, regardless of its origin.

You expressly understand and agree that you assume all risks associated with use or reliance on this content.