Labels

Sunday, June 26, 2016

Enabling APIM - BPS Workflow Integration In a Cluster + WSO2

Hi All,

This Post show how you could configure WSO2 APIM workflows in a cluster.
Please Note this post is based on the bellow documentation, more like a summary of what you really should do.
https://docs.wso2.com/display/AM1100/Configuring+Workflows+in+a+Cluster
https://docs.wso2.com/display/AM1100/Adding+an+Application+Creation+Workflow

WSO2 Product Versions -
wso2bps 3.5.1
wso2am 1.10.0

Setup Information

  1. 2 bps nodes clustered with a LB
  • <bps1 IP> hostname /IP of the bps node 1
  • <bps2 IP> hostname /IP of the bps node 2
  • <bpsLB IP> hostname /IP of the bps LB
  1. 2 APIM store nodes clustered  with a LB

Important Notes -

  • Assuming that the admin role is not changed.
  • All bps and apim nodes are running in a separate servers and started using offset 0
  • Configuring the Admin Dashboard in store side.
  • Please note both nodes should have the correct server certificates and the client-truststore should know both sides as well

Setting up APIM store node

  1. Change the workFlowServerURL in the admin dashboard configuration. wso2am-1.10.0/repository/deployment/server/jaggeryapps/admin-dashboard/site/conf/site.json
"workFlowServerURL": "https://<bpsLB>:9443/services/",
  1. Changed the WorkflowCallbackService.xml to point the store node.
Since we are configuring the admin-dashboard of the store side, keeping it as  localhost:9443
/wso2am-1.10.0/repository/deployment/server/synapse-configs/default/proxy-services/WorkflowCallbackService.xml
  1. Login to the API Store management console and change the WorkFlowExtensions callbackURL and serviceEndpoint in the registry.
/_system/governance/apimgt/applicationdata/workflow-extensions.xml
E.g - comment the simple workflow executor and enable WS Workflow Executor

<ApplicationCreation executor="org.wso2.carbon.apimgt.impl.workflow.ApplicationCreationWSWorkflowExecutor">
        <Property name="serviceEndpoint"> http://<bpsLB IP>:9763/services/ApplicationApprovalWorkFlowProcess/  </Property>
        <Property name="username">userName</Property>
        <Property name="password">Password</Property>
        <Property name="callbackURL">https://<storeLB IP>:8243/services/WorkflowCallbackService</Property>
    </ApplicationCreation>

Setting Up BPS Node


  1. <BPS_HOME>/repository/conf/humantask.xml file and <BPS_HOME>/repository/conf/b4p-coordination-config.xml file and set the TaskCoordinationEnabled property to true.
<TaskCoordinationEnabled>true</TaskCoordinationEnabled>
  1. Copy the following from the <APIM_HOME>/business-processes/epr folder to the <BPS_HOME>/repository/conf/epr folder. If the <BPS_HOME>/repository/conf/epr folder does not exist, please create it.
  • In the *CallbackService.epr file change the Address to <storeLB ip> and  also change the username and password
  • In the *Service.epr change the  Address to store node ip or localhost and also change the username and password
  1. Unzip the <APIM_HOME>/business-processes/user-signup/BPEL/*  (Similar to all the other workflows)
  • Change the address port to 9443 in the ApprovalTask wsdl file e.g - UserApprovalTask.wsdl
  • In the CallbackService WSDL point the address elements to <storeLB IP>
  1. Zip back the files and upload it into the BPS.
  2. Unzip the <APIM_HOME>/business-processes/<workflow name>/HumanTask fie.
  • Change the port to 9763 in ApprovalTask WSDL
  1. Zip back the files and upload it into the BPS Human Task.

Create an Application In store side and login to the admin dashboard to check if workflows working properly.

Have Fun !!! 
 

Friday, June 24, 2016

Gadgets Wont display for the IP address ERROR {org.apache.shindig.gadgets.render.DefaultServiceFetcher} + WSO2 Dashboard

Hi All,
I got this error accessing the DAS Dashboard (Portal) from the IP address instead of localhost.

ERROR {org.apache.shindig.gadgets.render.DefaultServiceFetcher} -  Services methods from the https://IP:9443/shindig/rpc endpoint could not be fetched. The following error occurred: javax.net.ssl.SSLException: hostname in certificate didn't match: <IP> != <localhost>. {org.apache.shindig.gadgets.render.DefaultServiceFetcher}
TID: [-1] [] [2016-06-10 12:07:50,257]  INFO {org.apache.shindig.gadgets.http.BasicHttpFetcher} -  The following exception occurred when fetching https://IP:9443/portal/store/carbon.super/gadget/Message_Table/index.xml: 11 ms elapsed. {org.apache.shindig.gadgets.http.BasicHttpFetcher}
TID: [-1] [] [2016-06-10 12:07:50,259]  INFO {org.apache.shindig.gadgets.http.BasicHttpFetcher} -   {org.apache.shindig.gadgets.http.BasicHttpFetcher}
javax.net.ssl.SSLException: hostname in certificate didn't match: <IP> != <localhost>
        at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:238)
        at org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
        at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:159)
        at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:140)
        at org.apache.http.conn.ssl.SSLSocketFactory.verifyHostname(SSLSocketFactory.java:561)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:536)
        at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:403)
        at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
        at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
        at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
        at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
        at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115)
        at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
        at org.apache.shindig.gadgets.http.BasicHttpFetcher.fetch(BasicHttpFetcher.java:359)
        at org.apache.shindig.gadgets.http.DefaultRequestPipeline.fetchResponse(DefaultRequestPipeline.java:191)
        at org.apache.shindig.gadgets.http.DefaultRequestPipeline.execute(DefaultRequestPipeline.java:135)
        at org.apache.shindig.gadgets.AbstractSpecFactory.fetchFromNetwork(AbstractSpecFactory.java:134)
        at org.apache.shindig.gadgets.AbstractSpecFactory.getSpec(AbstractSpecFactory.java:94)
        at org.apache.shindig.gadgets.DefaultGadgetSpecFactory.getGadgetSpec(DefaultGadgetSpecFactory.java:75)
        at org.apache.shindig.gadgets.process.Processor.process(Processor.java:104)
        at org.apache.shindig.gadgets.servlet.GadgetsHandlerService.getMetadata(GadgetsHandlerService.java:210)
        at org.apache.shindig.gadgets.servlet.GadgetsHandler$5.call(GadgetsHandler.java:307)
        at org.apache.shindig.gadgets.servlet.GadgetsHandler$5.call(GadgetsHandler.java:304)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)


If you are also facing the same issueAll you have to do is add a self sign certificate for the server DAS is running.
You could use the bellow article on creating the certificate.
http://wso2.com/library/knowledge-base/2011/08/adding-ca-certificate-authority-signed-certificate-wso2-products/

Not Retrieving Pending Tasks. Check BPS Connectivity + WSO2 APIM 1.10

Hi All,
I got this issue when configuring the APIM workflow support.  Because of this issue APIM admin dashboard cannot retrieve any of the pending tasks which needed to be approve.

WARN {JAGGERY.site.blocks.user.login.ajax.login:jag}- Not Retrieving Pending Tasks. Check BPS Connectivity {JAGGERY.site.blocks.user.login.ajax.login:jag}

WSO2 Versions - 
API Manager 1.10
BPS 3.5.1

Please find the Bellow steps to Identify the correct issue (debug) and fix.

- This issue can mainly occur due to an incorrect bps path given for the workFlowServerURL in the Admin Dashboard.
Verify the workFlowServerURL in the site.json file.
 <APIM HOME>/repository/deployment/server/jaggeryapps/admin-dashboard/site/conf/site.json 

- If your issue is still exists, this can be occur due to a connection timeout or a certificate issues. Easiest way to verify the issue is by putting a log to the login.jag
<APIM HOME>/repository/deployment/server/jaggeryapps/admin-dashboard/modules/user/login.jag

grep the code and find the WARN message "Not Retrieving Pending Tasks" 
Add the bellow mention error log to the code and test again. You will get the full stack trace and it will be easy to identify the main issue.
} catch(e) {
    log.error(e);
    log.warn("Not Retrieving Pending Tasks. Check BPS Connectivity");
}