[Dev] Obtaining a registry value for a PHP application through the Registry REST API

2014-09-08 Thread Madhawa Bandara
Hi all,

In order to perform the $subject following the doc [1]. I am using $curl
based invocation from my php application.

How can I get my requests the authenticated / how can I obtain the oauth
access token?

Thanks in advance.

[1] - https://docs.wso2.com/display/Governance460/Registry+REST+API

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Obtaining a registry value for a PHP application through the Registry REST API

2014-09-08 Thread Madhawa Bandara
Adding to above:

Need to get this done without generating the ouath token manually ( without
using the API store).


On Mon, Sep 8, 2014 at 3:06 PM, Madhawa Bandara madh...@wso2.com wrote:

 Hi all,

 In order to perform the $subject following the doc [1]. I am using $curl
 based invocation from my php application.

 How can I get my requests the authenticated / how can I obtain the oauth
 access token?

 Thanks in advance.

 [1] - https://docs.wso2.com/display/Governance460/Registry+REST+API

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Jenkins gives an error in Appfactory when deploying the built artifacts

2014-09-05 Thread Madhawa Bandara
$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)
TID: [0] [AS] [2014-09-05 12:26:35,639] ERROR
{org.wso2.carbon.appfactory.jenkins.AppfactoryPluginManager} -  Error while
sending deployment message ApplicationDeployerAppFactoryExceptionException
{org.wso2.carbon.appfactory.jenkins.AppfactoryPluginManager}
org.wso2.carbon.appfactory.application.deployer.stub.ApplicationDeployerAppFactoryExceptionException:
ApplicationDeployerAppFactoryExceptionException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:357)
at java.lang.Class.newInstance(Class.java:310)
at
org.wso2.carbon.appfactory.application.deployer.stub.ApplicationDeployerStub.deployArtifact(ApplicationDeployerStub.java:1445)
at
org.wso2.carbon.appfactory.jenkins.AppfactoryPluginManager$1.run(AppfactoryPluginManager.java:436)
at java.lang.Thread.run(Thread.java:662)

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Retrieving the IP/IPs for single tenant cartridge intances

2014-08-29 Thread Madhawa Bandara
Hi Dimuthu,
Thanks, I will follow the instructions.

Sent from Windows phone 

-Original Message-
From: Dimuthu Leelarathne dimut...@wso2.com
Sent: ‎8/‎29/‎2014 15:25
To: Madhawa Bandara madh...@wso2.com
Cc: WSO2 Developers' List dev@wso2.org; Lakmal Warusawithana 
lak...@wso2.com; Sajith Kariyawasam saj...@wso2.com; Ramith Jayasinghe 
ram...@wso2.com
Subject: Re: Retrieving the IP/IPs for single tenant cartridge intances

Hi Madhawa and All,


I have discussed with the Stratos team and provided a PR for master in Apache. 
Meanwhile I have done the same fix in this GitHub branch[1] for Stratos 4.0.0. 
So now you can retrieve the end point. Here are the steps.


1) Build the GitHub branch with branch id STRATOS762. 
2) Replace the following bundles in our dev setup in Stratos Mangaer for all 3 
environments. Update the scripts.
org.apache.stratos.rest.endpoint
org.apache.stratos.manager
3) Now you can retrieve member cluster id and lb cluster id from 
/cartridge/info/{subscriptionAlias}
4) Write a MemberActivated listener for Stratos
5) When you receive the MembereActivated event of the clusterId save it in the 
RXT


Whoa! We are done with retrieving the IP.


thanks,
dimuthu




[1]https://github.com/muthulee/private-paas/tree/STRATOS762








On Tue, Aug 19, 2014 at 12:15 PM, Madhawa Bandara madh...@wso2.com wrote:

Hi,


Assume that an application subscribes to a PHP cartridge using the 
'subscription' call in Stratos REST API [1]. 


How can I retrieve the IP of the spawned instance/instances using the Stratos 
REST API? 


[1] - 
https://cwiki.apache.org/confluence/display/STRATOS/4.0.0+Subscribing+to+a+Cartridge



THanks.


-- 

Regards,


Madhawa Bandara

Software Engineer
WSO2, Inc.

lean.enterprise.middleware


Mobile - +94777487726
Blog - classdeffound.blogspot.com






-- 

Dimuthu Leelarathne 
Architect  Product Lead of App Factory

WSO2, Inc. (http://wso2.com)
email: dimut...@wso2.com
Mobile : 0773661935 

Lean . Enterprise . Middleware___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Installing the Stratos Cartridge Agent

2014-08-23 Thread Madhawa Bandara
Hi all,

I need to create an image of a machine in openstack with PHP and Stratos
Cartridge Agent installed.

I ran the PHP puppet module and php got installed successfully. But the
agent installation failed.

How can I just install the cartridge agent using puppet?

I tried running the PHP puppet module from the beginning since it installs
the agent too. But it failed giving the following error:

*[Error] Puppet exist on this system.*
*/bin/rm: cannot remove
‘/mnt/apache-stratos-cartridge-agent-4.0.0/wso2carbon.lck’: No such file or
directory*

How shall I proceed?

Thanks

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Installing the Stratos Cartridge Agent

2014-08-23 Thread Madhawa Bandara
Hi all,

I need to create an image in openstack with PHP and Stratos Cartridge Agent
installed.

I ran the PHP puppet module and php got installed successfully. But the
agent installation failed.

How can I just install the cartridge agent using puppet?

I tried running the PHP puppet module from the beginning since it installs
the agent too. But it failed giving the following error:

*[Error] Puppet exist on this system.*
*/bin/rm: cannot remove
‘/mnt/apache-stratos-cartridge-agent-4.0.0/wso2carbon.lck’: No such file or
directory*

How shall I proceed?

Thanks

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Installing the Stratos Cartridge Agent

2014-08-23 Thread Madhawa Bandara
Hi Udara,

Thanks for the reference.

The config.sh and init files are not available at the given URLs. Is there
a location from which I could get them?


On Sat, Aug 23, 2014 at 8:46 PM, Udara Liyanage ud...@wso2.com wrote:

 Hi,

 I hope you want to create a PHP cartridge. Please refer to the blog post
 of [1].

 [1]
 http://udaraliyanage.wordpress.com/2014/04/11/creating-cartridge-for-apache-stratos/comment-page-1/


 On Sat, Aug 23, 2014 at 8:43 PM, Madhawa Bandara madh...@wso2.com wrote:

 Hi all,

 I need to create an image in openstack with PHP and Stratos Cartridge
 Agent installed.

 I ran the PHP puppet module and php got installed successfully. But the
 agent installation failed.

 How can I just install the cartridge agent using puppet?

 I tried running the PHP puppet module from the beginning since it
 installs the agent too. But it failed giving the following error:

 *[Error] Puppet exist on this system.*
 */bin/rm: cannot remove
 ‘/mnt/apache-stratos-cartridge-agent-4.0.0/wso2carbon.lck’: No such file or
 directory*

 How shall I proceed?

 Thanks

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --

 Udara Liyanage
 Software Engineer
  WSO2, Inc.: http://wso2.com
 lean. enterprise. middleware

 web: http://udaraliyanage.wordpress.com
 phone: +94 71 443 6897




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Installing the Stratos Cartridge Agent

2014-08-23 Thread Madhawa Bandara
Hi Akila,

The link [1] is unavailable.

I think I should move this to d...@stratos.apache.org, shouldn't I?


[1] http://stratos.apache.org/community/mailing-lists.html



On Sat, Aug 23, 2014 at 9:15 PM, Akila Ravihansa Perera raviha...@wso2.com
wrote:

 Hi Madhawa,

 It's best if you could discuss this on Apache Stratos mailing list [1].

 Regarding your issue, you need to copy the cartridge agent packs to
 /etc/puppet/modules/agent/files in Puppet master. Also you need to
 copy MB client libraries to /etc/puppet/modules/agent/files/activemq
 as well.

 Please let's continue this discussion on Stratos dev list.

 [1] http://stratos.apache.org/community/mailing-lists.html

 Thanks.


 On Sat, Aug 23, 2014 at 9:00 PM, Udara Liyanage ud...@wso2.com wrote:
  Hi,
 
  The links are provided in the blog post. But links get 404 since git
  repository URL changed after graduation. Please refer to [1] for current
  script location.
 
  [1]
 
 https://git-wip-us.apache.org/repos/asf?p=stratos.git;a=tree;f=tools/puppet3-agent;hb=refs/heads/master
 
 
  On Sat, Aug 23, 2014 at 8:53 PM, Madhawa Bandara madh...@wso2.com
 wrote:
 
  Hi Udara,
 
  Thanks for the reference.
 
  The config.sh and init files are not available at the given URLs. Is
 there
  a location from which I could get them?
 
 
  On Sat, Aug 23, 2014 at 8:46 PM, Udara Liyanage ud...@wso2.com wrote:
 
  Hi,
 
  I hope you want to create a PHP cartridge. Please refer to the blog
 post
  of [1].
 
  [1]
 
 http://udaraliyanage.wordpress.com/2014/04/11/creating-cartridge-for-apache-stratos/comment-page-1/
 
 
  On Sat, Aug 23, 2014 at 8:43 PM, Madhawa Bandara madh...@wso2.com
  wrote:
 
  Hi all,
 
  I need to create an image in openstack with PHP and Stratos Cartridge
  Agent installed.
 
  I ran the PHP puppet module and php got installed successfully. But
 the
  agent installation failed.
 
  How can I just install the cartridge agent using puppet?
 
  I tried running the PHP puppet module from the beginning since it
  installs the agent too. But it failed giving the following error:
 
  [Error] Puppet exist on this system.
  /bin/rm: cannot remove
  ‘/mnt/apache-stratos-cartridge-agent-4.0.0/wso2carbon.lck’: No such
 file or
  directory
 
  How shall I proceed?
 
  Thanks
 
  --
  Regards,
 
  Madhawa Bandara
  Software Engineer
  WSO2, Inc.
  lean.enterprise.middleware
 
  Mobile - +94777487726
  Blog - classdeffound.blogspot.com
 
  ___
  Dev mailing list
  Dev@wso2.org
  http://wso2.org/cgi-bin/mailman/listinfo/dev
 
 
 
 
  --
 
  Udara Liyanage
  Software Engineer
  WSO2, Inc.: http://wso2.com
  lean. enterprise. middleware
 
  web: http://udaraliyanage.wordpress.com
  phone: +94 71 443 6897
 
 
 
 
  --
  Regards,
 
  Madhawa Bandara
  Software Engineer
  WSO2, Inc.
  lean.enterprise.middleware
 
  Mobile - +94777487726
  Blog - classdeffound.blogspot.com
 
 
 
 
  --
 
  Udara Liyanage
  Software Engineer
  WSO2, Inc.: http://wso2.com
  lean. enterprise. middleware
 
  web: http://udaraliyanage.wordpress.com
  phone: +94 71 443 6897
 
  ___
  Dev mailing list
  Dev@wso2.org
  http://wso2.org/cgi-bin/mailman/listinfo/dev
 



 --
 Akila Ravihansa Perera
 WSO2 Inc

 Blog: http://ravihansa3000.blogspot.com




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Retrieving the IP/IPs for single tenant cartridge intances

2014-08-19 Thread Madhawa Bandara
Hi,

Assume that an application subscribes to a PHP cartridge using the
'subscription' call in Stratos REST API [1].

How can I retrieve the IP of the spawned instance/instances using the
Stratos REST API?

[1] -
https://cwiki.apache.org/confluence/display/STRATOS/4.0.0+Subscribing+to+a+Cartridge

THanks.

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Exception when applying the patches for GREG 4.6

2014-07-28 Thread Madhawa Bandara
(ContainerBase.java:1559)

at
org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

at java.util.concurrent.FutureTask.run(FutureTask.java:138)

at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

at java.lang.Thread.run(Thread.java:662)


[2] - https://wso2.org/jira/browse/CARBON-14868

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Committers += Lali Devamanthri

2014-05-30 Thread Madhawa Bandara
congratulations!


On Fri, May 30, 2014 at 12:25 PM, Nuwan Silva nuw...@wso2.com wrote:

 Congratz Lali!!!


 On Fri, May 30, 2014 at 12:11 PM, Dinesh Bandara dine...@wso2.com wrote:

 Congratulations !


 On Fri, May 30, 2014 at 11:08 AM, Jasintha Dasanayake jasin...@wso2.com
 wrote:

 Hi All,

 It's my distinct pleasure to welcome Lali as a WSO2 Committer.

 Lali has  been a valuable contributor for WSO2 Developer Studio since he
 joined WSO2. In recognition of his contributions to WSO2, he has been voted
 as a WSO2 Committer.

 Lali, Congratulations and Keep up the good work!

 Thanks and Regards,
 /Jasintha

 --

 *Jasintha Dasanayake *

 *Senior Software EngineerWSO2 Inc. | http://wso2.com http://wso2.com/
 lean . enterprise . middleware*


 *mobile :- 0711368118*

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 *Dinesh Bandara*

 Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --


 *Nuwan Silva*
 *Senior Software Engineer - QA*
 Mobile: +94779804543


 WSO2 Inc.
 lean . enterprise . middlewear.
 http://www.wso2.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Committers += Sohani Weerasinghe

2014-05-30 Thread Madhawa Bandara
congratulations Sohani


On Fri, May 30, 2014 at 1:03 PM, Isura Karunaratne is...@wso2.com wrote:

 Congratz


 On Friday, May 30, 2014, Chamil Jeewantha cha...@wso2.com wrote:

 Congrats!


 On Fri, May 30, 2014 at 12:25 PM, Nuwan Silva nuw...@wso2.com wrote:

 Congratz Sohani!!!


 On Fri, May 30, 2014 at 12:12 PM, Dinesh Bandara dine...@wso2.com
 wrote:

 Congratulations !


 On Fri, May 30, 2014 at 11:06 AM, Jasintha Dasanayake jasin...@wso2.com
 wrote:

 Hi All,

 It's my distinct pleasure to welcome Sohani as a WSO2 Committer.

 Sohani has  been a valuable contributor for WSO2 Developer Studio since
 she joined WSO2. In recognition of her contributions to WSO2, she has been
 voted as a WSO2 Committer.

 Sohani, Congratulations and Keep up the good work!

 Thanks and Regards,
 /Jasintha


 --

 *Jasintha Dasanayake *

 *Senior Software EngineerWSO2 Inc. | http://wso2.com http://wso2.com/
 lean . enterprise . middleware*


 *mobile :- 0711368118*

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 *Dinesh Bandara*

 Software Engineer
 WSO2 Inc.; http://wso2.com
 lean.enterprise.middleware


 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --


 *Nuwan Silva*
 *Senior Software Engineer - QA*
 Mobile: +94779804543

 WSO2 Inc.
 lean . enterprise . middlewear.
 http://www.wso2.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev

 K.D. Chamil Jeewantha
 Associate Technical Lead
 WSO2, Inc.;  http://wso2.com
 Mobile: +94716813892



 --
 Isura Dilhara Karunaratne
 Software Engineer

 Mob +94 772 254 810



 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] ESB Connectors test: Returning -1 as http response code

2014-04-24 Thread Madhawa Bandara
I am using the following sendReuqest() method in the util class in the
integration test base to send a request to an API through the ESB connector
and get the response.
When the *404 Not found *or* 400 Bad request* is returned from the API(
API-ESB connector -Test connection), the method getResponseCode()in
HttpURLConnection
returns -1 instead of the http error code.

public static RestResponse sendRequest(String addUrl, String query) throws
IOException {
RestResponse restResponse = new RestResponse();
String charset = UTF-8;
URLConnection connection = new URL(addUrl).openConnection();
connection.setDoOutput(true);
connection.setRequestProperty(Content-Type, application/json;charset= +
charset);

OutputStream output = null;
try {
output = connection.getOutputStream();
output.write(query.getBytes(charset));
} finally {
if (output != null) {
try {
output.close();
} catch (IOException logOrIgnore) {
log.error(Error while closing the connection);
}
}
}

HttpURLConnection httpConn = (HttpURLConnection) connection;
InputStream response;

if (httpConn.getResponseCode() = 400) {
response = httpConn.getErrorStream();
} else {
response = connection.getInputStream();
}

String out = {};
if (response != null) {
StringBuilder sb = new StringBuilder();
byte[] bytes = new byte[1024];
int len;
while ((len = response.read(bytes)) != -1) {
sb.append(new String(bytes, 0, len));
}

if (!sb.toString().trim().isEmpty()) {
out = sb.toString();
}
}
int resc=httpConn.getResponseCode(); //returns -1
restResponse.setResponseCode(resc);
try {
restResponse.setBody(new JSONObject(out));
} catch (JSONException e) {
log.error(e.getMessage());
}
}

Anything suggestions? Thanks in advance

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726 %2B94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Jaggery vs Node

2014-04-24 Thread Madhawa Bandara
It's on hold isn't it?


On Fri, Apr 25, 2014 at 9:54 AM, Dakshika Jayathilaka daksh...@wso2.comwrote:

 Hi All,

 I think its really worth, if we answer this question with proper
 elaboration.. please have a look..

 http://stackoverflow.com/questions/23261698/node-js-vs-wso2-jaggery

 Thank you,


 *Dakshika Jayathilaka*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware
 0771100911

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP Patch support by ESB 4.8.1

2014-04-23 Thread Madhawa Bandara
I originally put the following patches:


*synapse-core_2.1.2.wso2v4*

*synapse-nhttp-transport_2.1.2.wso2v4*

*synapse-extensions_2.1.2.wso2v4*
*org.wso2.carbon.mediation.library_4.2.0*

But the I tried only the following 2 patches:


*synapse-core_2.1.2.wso2v4*
*synapse-nhttp-transport_2.1.2.wso2v4*

Now everything works well.



On Wed, Apr 23, 2014 at 1:34 PM, Krishantha Dinesh kr...@krishantha.comwrote:

 Agreed with Miyuru. however this is experienced ONLY on WSO2 environment.
 but not in our local environments.  that's why no idea what is the cause.
 however i have noted this only cause when we use java script mediator.
 appriciate any idea to solve this as few integration testing onhold due to
 this un identified issue :)


 On Wed, Apr 23, 2014 at 7:19 AM, Miyuru Wanninayaka miy...@wso2.comwrote:

 I can't imagine a way which fixed done in [1],[2] cause JSON issues in
 script mediator, it's a only minor change to http request factory and
 nothing to do with script mediator.  It should be a some other fix done
 early causing this issue.

 [1] https://wso2.org/jira/browse/ESBJAVA-3051
 [2] https://wso2.org/jira/browse/ESBJAVA-3061


 On Tue, Apr 22, 2014 at 1:14 PM, Krishantha Dinesh 
 kr...@krishantha.comwrote:

 this is already experienced issue with above patch. hope malaka can help
 you on solve this as he is already solve this on other connector

 Malaka can you share the solution please


 On Tue, Apr 22, 2014 at 5:09 PM, Madhawa Bandara madh...@wso2.comwrote:

 Hi,
 I applied the above patches and the requests with HTTP PATCH method
 work well now.
 But now I get a new exception for the requests in which a JSON payload
 is used (inside the script mediator with language=js):

 com.sun.phobos.script.util.ExtendedScriptException:
 org.mozilla.javascript.EcmaError: ReferenceError: JSON is not defined.

 Note that these methods worked fine *before *applying the patch. Any
 suggestions?


 On Mon, Apr 21, 2014 at 10:38 AM, Malaka Silva mal...@wso2.com wrote:

 Hi Kasun,

 It's already done.

 https://wso2.org/jira/browse/ESBJAVA-3051
 https://wso2.org/jira/browse/ESBJAVA-3061

 Best Regards,
 Malaka


 On Mon, Apr 21, 2014 at 10:23 AM, Kasun Indrasiri ka...@wso2.comwrote:

 Have we committed this in to trunk? If not please do so.


 On Mon, Apr 21, 2014 at 10:21 AM, Malaka Silva mal...@wso2.comwrote:

 Hi Mahawa,

 Currently it's not supported. It'll be available with the next
 release. ESB 4.9.0

 But there is a patch for this.

 Best Regards,
 Malaka


 On Mon, Apr 21, 2014 at 10:13 AM, Madhawa Bandara 
 madh...@wso2.comwrote:

 Hi,
 Does the ESB 4.8.1 support the HTTP patch method?
 When I make a http patch request, it is shown as an HTTP POST on
 the wire.

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/http://wso2.com/about/team/malaka-silva/

 Save a tree -Conserve nature  Save the world for your future. Print
 this email only if it is absolutely necessary.

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 Kasun Indrasiri
 Software Architect
 WSO2, Inc.; http://wso2.com
 lean.enterprise.middleware

 cell: +94 77 556 5206
 Blog : http://kasunpanorama.blogspot.com/




 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/http://wso2.com/about/team/malaka-silva/

 Save a tree -Conserve nature  Save the world for your future. Print
 this email only if it is absolutely necessary.




 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev



 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 Miyuru Wanninayaka
 Senior Technical Lead
 WSO2 Inc. : http://wso2.com

 Mobile : +94 77 209 9788





-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Re: [Dev] HTTP Patch support by ESB 4.8.1

2014-04-22 Thread Madhawa Bandara
Hi,
I applied the above patches and the requests with HTTP PATCH method work
well now.
But now I get a new exception for the requests in which a JSON payload is
used (inside the script mediator with language=js):

com.sun.phobos.script.util.ExtendedScriptException:
org.mozilla.javascript.EcmaError: ReferenceError: JSON is not defined.

Note that these methods worked fine *before *applying the patch. Any
suggestions?


On Mon, Apr 21, 2014 at 10:38 AM, Malaka Silva mal...@wso2.com wrote:

 Hi Kasun,

 It's already done.

 https://wso2.org/jira/browse/ESBJAVA-3051
 https://wso2.org/jira/browse/ESBJAVA-3061

 Best Regards,
 Malaka


 On Mon, Apr 21, 2014 at 10:23 AM, Kasun Indrasiri ka...@wso2.com wrote:

 Have we committed this in to trunk? If not please do so.


 On Mon, Apr 21, 2014 at 10:21 AM, Malaka Silva mal...@wso2.com wrote:

 Hi Mahawa,

 Currently it's not supported. It'll be available with the next release.
 ESB 4.9.0

 But there is a patch for this.

 Best Regards,
 Malaka


 On Mon, Apr 21, 2014 at 10:13 AM, Madhawa Bandara madh...@wso2.comwrote:

 Hi,
 Does the ESB 4.8.1 support the HTTP patch method?
 When I make a http patch request, it is shown as an HTTP POST on the
 wire.

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/http://wso2.com/about/team/malaka-silva/

 Save a tree -Conserve nature  Save the world for your future. Print
 this email only if it is absolutely necessary.

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 Kasun Indrasiri
 Software Architect
 WSO2, Inc.; http://wso2.com
 lean.enterprise.middleware

 cell: +94 77 556 5206
 Blog : http://kasunpanorama.blogspot.com/




 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/http://wso2.com/about/team/malaka-silva/

 Save a tree -Conserve nature  Save the world for your future. Print this
 email only if it is absolutely necessary.




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] HTTP Patch support by ESB 4.8.1

2014-04-20 Thread Madhawa Bandara
Hi,
Does the ESB 4.8.1 support the HTTP patch method?
When I make a http patch request, it is shown as an HTTP POST on the wire.

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] HTTP Patch support by ESB 4.8.1

2014-04-20 Thread Madhawa Bandara
Thanks, I'll try the patch.


On Mon, Apr 21, 2014 at 10:23 AM, Kasun Indrasiri ka...@wso2.com wrote:

 Have we committed this in to trunk? If not please do so.


 On Mon, Apr 21, 2014 at 10:21 AM, Malaka Silva mal...@wso2.com wrote:

 Hi Mahawa,

 Currently it's not supported. It'll be available with the next release.
 ESB 4.9.0

 But there is a patch for this.

 Best Regards,
 Malaka


 On Mon, Apr 21, 2014 at 10:13 AM, Madhawa Bandara madh...@wso2.comwrote:

 Hi,
 Does the ESB 4.8.1 support the HTTP patch method?
 When I make a http patch request, it is shown as an HTTP POST on the
 wire.

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --

 Best Regards,

 Malaka Silva
 Senior Tech Lead
 M: +94 777 219 791
 Tel : 94 11 214 5345
 Fax :94 11 2145300
 Skype : malaka.sampath.silva
 LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77
 Blog : http://mrmalakasilva.blogspot.com/

 WSO2, Inc.
 lean . enterprise . middleware
 http://www.wso2.com/
 http://www.wso2.com/about/team/malaka-silva/http://wso2.com/about/team/malaka-silva/

 Save a tree -Conserve nature  Save the world for your future. Print this
 email only if it is absolutely necessary.

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 Kasun Indrasiri
 Software Architect
 WSO2, Inc.; http://wso2.com
 lean.enterprise.middleware

 cell: +94 77 556 5206
 Blog : http://kasunpanorama.blogspot.com/




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Regarding the Integration Tests for ESB Connectors

2014-04-11 Thread Madhawa Bandara
Hi,
I am implementing the integration test cases for a Google Tasks ESB
connector.

We were asked to implement the integration tests in a way that, the
response of the test case though the ESB connector is asserted against the
response through a *direct API call*.
This is opposed to the existing method: asserting against a *known *value.

Consider an API call that *creates* or *deletes a *resource.
So how can we assert the connector response against the direct API call
response in such a case, since the response values of the two requests
would be different?

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Exception when running ESB Test Suite for ESB Connectors Integration Tests

2014-04-10 Thread Madhawa Bandara
Hi,
I have written integration tests for an ESB Connector using ESB Test suit.
When I run the tests I get an exception as follows:

java.io.FileNotFoundException:
/src/test/resources/artifacts/AXIS2/aar/LBService1.aar (No such file or
directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.init(FileInputStream.java:120)
at java.io.FileInputStream.init(FileInputStream.java:79)
at
org.wso2.carbon.automation.core.utils.axis2serverutils.SampleAxis2Server.copyResourceToFileSystem(SampleAxis2Server.java:148)
at
org.wso2.carbon.automation.core.utils.axis2serverutils.SampleAxis2Server.deployService(SampleAxis2Server.java:131)
at
org.wso2.carbon.automation.core.PlatformExecutionManager.startSimpleAxis2Server(PlatformExecutionManager.java:230)
at
org.wso2.carbon.automation.core.PlatformExecutionManager.startSevers(PlatformExecutionManager.java:190)
at
org.wso2.carbon.automation.core.PlatformExecutionManager.onExecutionStart(PlatformExecutionManager.java:76)
at org.testng.TestNG.runExecutionListeners(TestNG.java:1032)
at org.testng.TestNG.run(TestNG.java:983)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

This *hasn't* affected the execution and the test results up to now. How
does this affect the build and how can I fix this if it is required?

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Exception when running ESB Test Suite for ESB Connectors Integration Tests

2014-04-10 Thread Madhawa Bandara
Thanks.


On Thu, Apr 10, 2014 at 1:35 PM, Krishantha Samaraweera krishan...@wso2.com
 wrote:

 Hi,

 Can you check whether the aar file exists at
 /src/test/resources/artifacts/AXIS2/aar/LBService1.aar

 If it is not, then copy it from ESB
 4.8.1/modules/integration/tests/src/test/resources/artifacts/ESB

 Thanks,
 Krishantha.


 On Thu, Apr 10, 2014 at 1:13 PM, Madhawa Bandara madh...@wso2.com wrote:

 Hi,
 I have written integration tests for an ESB Connector using ESB Test
 suit. When I run the tests I get an exception as follows:

 java.io.FileNotFoundException:
 /src/test/resources/artifacts/AXIS2/aar/LBService1.aar (No such file or
 directory)
  at java.io.FileInputStream.open(Native Method)
 at java.io.FileInputStream.init(FileInputStream.java:120)
  at java.io.FileInputStream.init(FileInputStream.java:79)
 at
 org.wso2.carbon.automation.core.utils.axis2serverutils.SampleAxis2Server.copyResourceToFileSystem(SampleAxis2Server.java:148)
  at
 org.wso2.carbon.automation.core.utils.axis2serverutils.SampleAxis2Server.deployService(SampleAxis2Server.java:131)
  at
 org.wso2.carbon.automation.core.PlatformExecutionManager.startSimpleAxis2Server(PlatformExecutionManager.java:230)
 at
 org.wso2.carbon.automation.core.PlatformExecutionManager.startSevers(PlatformExecutionManager.java:190)
  at
 org.wso2.carbon.automation.core.PlatformExecutionManager.onExecutionStart(PlatformExecutionManager.java:76)
 at org.testng.TestNG.runExecutionListeners(TestNG.java:1032)
  at org.testng.TestNG.run(TestNG.java:983)
 at
 org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
  at
 org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
 at
 org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
  at
 org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
 at
 org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
  at
 org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
 at
 org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
  at
 org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

 This *hasn't* affected the execution and the test results up to now. How
 does this affect the build and how can I fix this if it is required?

 --
 Regards,

 *Madhawa Bandara*
 Software Engineer
 WSO2, Inc.
 lean.enterprise.middleware

 Mobile - *+94777487726 %2B94777487726*
 Blog* - *classdeffound.blogspot.com

 ___
 Dev mailing list
 Dev@wso2.org
 http://wso2.org/cgi-bin/mailman/listinfo/dev




 --
 Krishantha Samaraweera
 Senior Technical Lead - Test Automation
 Mobile: +94 77 7759918
 WSO2, Inc.; http://wso2.com/
 lean . enterprise . middlewear.




-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Sending HTTP POST requests without payload

2014-04-03 Thread Madhawa Bandara
Hi,
I'm working on an ESB connector for Google Tasks API. I need to invoke some
API methods using HTTP POST according to the Google Tasks API specs.

e.g.
To clear a task:

POST 
https://www.googleapis.com/tasks/v1/lists/MTUxMjgwNjU3MTg0OTI4MDA5Njk6MTM2Mzk2ODY5Mzow/clear


Here the payload is empty as per the Google Tasks API reference.

when I send this request, it gives a *411 Length Required* response which
should be caused by missing content-length header.

So how can I send a POST request with an *empty payload* via *synapse
configurations* while the *content-length* is automatically set, in order
to avoid this problem?

Thank you.

-- 
Regards,

*Madhawa Bandara*
Software Engineer
WSO2, Inc.
lean.enterprise.middleware

Mobile - *+94777487726*
Blog* - *classdeffound.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev