Author Message
RogerNorthrop
Joined: Dec 27, 2010
Messages: 3
Offline
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.


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.CloseableHttpResponse;
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.protocol,org.apache.http,org.apache.http.config,org.apache.http.client.methods,org.apache.http.impl.client.*,com.avaya.collaboration.util.logger,javax.persistence,org.json,com.avaya.app.entity,com.avaya.workflow.*,com.roobroo.*;!*</Import-Package>
PrakashN
Joined: Jun 30, 2015
Messages: 105
Offline
Roger,

Is there a way you can zip up your project and attach here? I can take a look at why it has runtime failures...

From what you are describing, it looks like there is some scope mix ups (compile VS provided) in one of the poms. Most likely the pom.xml that is sitting inside the "tasks" directory. Can you check if the class you are getting the ClassNotFound for while running has a "provided" scope in this pom? If it is, then it expects that class to be available at runtime - which is not.

Use compile scope and it will most likely work. But it may bloat up your deployment artifact (.svar) size.

Let me know. I can help. Thanks!

- Prakash.

Prakash Natarajan System Architecture Consulting Engineer Engagement Designer Avaya
CarverAnderson
Joined: Oct 4, 2016
Messages: 11
Offline
I've attached the project directory, and yes it is the pom.xml in Tasks that I've been editing and I have used compile on all of them. Here are the only ones I've added. This project is getting an error when run in collaboratory about org.apache.http.ssl.SSLContext ClassNotFound. The typical way I've fixed those has been to add the base class (org.apache.http.ssl) to the <import-package> entry in the same pom.xml, but if I do that for this one I get a "failed to deploy" when I try to install it.

<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>
Filename gistt.zip [Disk] Download
CraigJohnson5
Joined: Oct 24, 2013
Messages: 413
Offline
Please send all Collaboratory issues to collaboratory@avaya.com and mention what lab you are working in. Please let me know what lab you are working in.
CarverAnderson
Joined: Oct 4, 2016
Messages: 11
Offline
I was told that I needed the 3.2 SDK, although there seems to be some confusion on your end which SDK(s) I need to update for 3.2. I have installed the 3.2 SDK on this link:

http://www.devconnectprogram.com/site/global/products_resources/avaya_breeze/avaya_snap_ins/engagement_designer/releases/3_2/index.gsp

I then created a new dynamic task project and it prompted me to use 3.2.
So I chose 3.2 and created the basic scaffolding project. Without
editing anything, I just ran "mvn clean package" and get this error. So I can't test my original issue until I get a raw 3.2 scaffolding project to build.

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] watasks ............................................ SUCCESS [
0.123 s]
[INFO] watasks-tasks ...................................... FAILURE [
0.409 s]
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 0.987 s
[INFO] Finished at: 2016-11-01T17:26:12-04:00
[INFO] Final Memory: 7M/155M
[INFO]
------------------------------------------------------------------------
[ERROR] Failed to execute goal on project watasks-tasks: Could not
resolve depen
dencies for project com.avaya:watasks-tasks:jar:1.0: The following
artifacts cou
ld not be resolved: com.roobroo:common:jar:3.2.0.0.08070,
com.avaya.collaboratio
n.api:avaya-aura-collaboration-api-3.2:jar:3.2.0.0.320005: Failure to
find com.r
oobroo:common:jar:3.2.0.0.08070 in
https://repo.maven.apache.org/maven2 was cach
ed in the local repository, resolution will not be reattempted until
the update
interval of central has elapsed or updates are forced -> [Help 1]
CarverAnderson
Joined: Oct 4, 2016
Messages: 11
Offline
After installing the latest SDK, I still get the same error building a blank scaffolding project. Here is the entire log of what I did from command prompt:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Users\canderson>cd \od

C:\OD>cd 1breeze

C:\OD\1Breeze>mvn archetype:generate -DarchetypeCatalog=local
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources
@ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources
@ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom --
-
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.
archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: local -> com.avaya.workflow.sdk:task-archetype (Engagement Designer Task Arch
etype)
2: local -> com.avaya.zephyr.sdk:service-archetype (Engagement Development Platf
orm Service Archetype)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive co
ntains): : 1
Choose com.avaya.workflow.sdk:task-archetype version:
1: 3.1.0.2.3102005
2: 3.2.0.0.08070
3: 3.2.0.0.08081
Choose a number: 3: 3
Define value for property 'groupId': : com.avaya
Define value for property 'artifactId': : watasks
Define value for property 'version': 1.0-SNAPSHOT: : 1.0
Define value for property 'package': com.avaya: : com.avaya.watasks
[INFO] Using property: serviceName = SampleTask
[INFO] Using property: serviceVersion = 1.0.0.0.0
Confirm properties configuration:
groupId: com.avaya
artifactId: watasks
version: 1.0
package: com.avaya.watasks
serviceName: SampleTask
serviceVersion: 1.0.0.0.0
Y: : y
[INFO] -------------------------------------------------------------------------
---
[INFO] Using following parameters for creating project from Archetype: task-arch
etype:3.2.0.0.08081
[INFO] -------------------------------------------------------------------------
---
[INFO] Parameter: groupId, Value: com.avaya
[INFO] Parameter: artifactId, Value: watasks
[INFO] Parameter: version, Value: 1.0
[INFO] Parameter: package, Value: com.avaya.watasks
[INFO] Parameter: packageInPathFormat, Value: com/avaya/watasks
[INFO] Parameter: package, Value: com.avaya.watasks
[INFO] Parameter: version, Value: 1.0
[INFO] Parameter: serviceVersion, Value: 1.0.0.0.0
[INFO] Parameter: groupId, Value: com.avaya
[INFO] Parameter: serviceName, Value: SampleTask
[INFO] Parameter: artifactId, Value: watasks
[INFO] Parent element not overwritten in C:\OD\1Breeze\watasks\tasks\pom.xml
[INFO] project created from Archetype in dir: C:\OD\1Breeze\watasks
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 43.583 s
[INFO] Finished at: 2016-11-02T15:36:00-04:00
[INFO] Final Memory: 13M/155M
[INFO] ------------------------------------------------------------------------

C:\OD\1Breeze>cd watasks

C:\OD\1Breeze\watasks>mvn clean package
[INFO] Scanning for projects...
[WARNING] Failed to build parent project for com.roobroo:roobroo:pom:3.2.0.0.080
81
[WARNING] Failed to build parent project for com.avaya.workflow:sdk:pom:3.2.0.0.
08081
[WARNING] Failed to build parent project for com.avaya:watasks:pom:1.0
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] watasks
[INFO] watasks-tasks
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building watasks 1.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ watasks ---
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building watasks-tasks 1.0
[INFO] ------------------------------------------------------------------------
Downloading: https://repo.maven.apache.org/maven2/com/avaya/collaboration/api/av
aya-aura-collaboration-api-3.2/3.2.0.0.320005/avaya-aura-collaboration-api-3.2-3
.2.0.0.320005.pom
[WARNING] The POM for com.avaya.collaboration.api:avaya-aura-collaboration-api-3
.2:jar:3.2.0.0.320005 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/com/avaya/collaboration/api/av
aya-aura-collaboration-api-3.2/3.2.0.0.320005/avaya-aura-collaboration-api-3.2-3
.2.0.0.320005.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] watasks ............................................ SUCCESS [ 0.100 s]
[INFO] watasks-tasks ...................................... FAILURE [ 2.038 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.673 s
[INFO] Finished at: 2016-11-02T15:36:11-04:00
[INFO] Final Memory: 11M/165M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project watasks-tasks: Could not resolve depen
dencies for project com.avaya:watasks-tasks:jar:1.0: Could not find artifact com
.avaya.collaboration.api:avaya-aura-collaboration-api-3.2:jar:3.2.0.0.320005 in
central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command

[ERROR] mvn <goals> -rf :watasks-tasks

C:\OD\1Breeze\watasks>
Go to:   
Mobile view