[Dev] [APIM] SecurityContextTTL property for setting JWT expiration period

2015-11-24 Thread Thilini Cooray
Hi,

I was able to find from [1] that we are using "SecurityContextTTL" property
in /repository/conf/api-manager.xml to do $subject. API manager
source also considers this property when deciding expiration time for token.

However, in a fresh APIM pack, this setting is not available even as a
commented out configuration.
Was there a reason for us to omit it from configurations?

Is there any documentation available mentioning about this property and its
usage?

IMHO it would be useful in users' point of view as there is a possibility
that AuthorizationContextTTL of identity.xml may get confused with this
property.

[1] https://wso2.org/jira/browse/APIMANAGER-3493

Thanks.

-- 
Best Regards,

*Thilini Cooray*
Software Engineer
Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194>
E-mail : thili...@wso2.com

WSO2 Inc. www.wso2.com
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Cross origin REST call fails with 403 Forbidden Error

2015-11-24 Thread Thilini Cooray
Hi,

[1] has mentions that Chrome does not support localhost to go through the
Access-Control-Allow-Origin, therefore we need to map localhost to a
different domain. Further details regarding this issue in chrome is
discussed in [2].

Can this be any help for you?

[1]
http://stackoverflow.com/questions/28547288/no-access-control-allow-origin-header-is-present-on-the-requested-resource-err
[2] https://code.google.com/p/chromium/issues/detail?id=67743

Thanks.

On Tue, Nov 24, 2015 at 9:59 PM, Fazlan Nazeem  wrote:

> Hi,
>
> I need cross origin support for a REST API. In order to achieve it I am
> trying to set the following headers in the response.
>
>> "Access-Control-Allow-Origin", "*"
>> "Access-Control-Allow-Headers","*"
>> "Access-Control-Allow-Methods","GET, POST, DELETE"
>
>
>
> My current implementation is as follows.
>
> in web.xml
>
>> 
>> CorsFilter
>> org.apache.catalina.filters.CorsFilter
>> 
>>
>
>
>> 
>> CorsFilter
>> /*
>
>
>
>>
>>
>
> the Rest implementation
>
> @Path("/datasets")public class DatasetApiV10 extends MLRestAPI {
>
>   @OPTIONS
> public Response options() {
> return  Response.ok().header("Access-Control-Allow-Origin", 
> "*").header("Access-Control-Allow-Headers","*").header("Access-Control-Allow-Methods","GET,
>  POST, DELETE").build();
> }
>
> Cross origin headers are *not set *in the response header when a cross
> origin call is made, but those headers are *set* when I do a local
> OPTIONS call for the API using cURL or a REST client.
>
> Following is the error message I am getting in chrome console.
>
> XMLHttpRequest cannot load https://localhost:9443/api/datasets. Response
> to preflight request doesn't pass access control check: No
> 'Access-Control-Allow-Origin' header is present on the requested resource.
> Origin 'http://localhost:8080' is therefore not allowed access. The
> response had HTTP status code 403
>
>
> Any suggestion to solve this issue?
>
>
> --
> Thanks & Regards,
>
> Fazlan Nazeem
>
> *Software Engineer*
>
> *WSO2 Inc*
> Mobile : +94772338839
> <%2B94%20%280%29%20773%20451194>
> fazl...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Best Regards,

*Thilini Cooray*
Software Engineer
Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194>
E-mail : thili...@wso2.com

WSO2 Inc. www.wso2.com
lean.enterprise.middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [BPS][DAS] Sorting feature and range faceting for the aggregated records

2015-11-24 Thread Anjana Fernando
Hi,

On Tue, Nov 24, 2015 at 6:21 AM, Gimantha Bandara  wrote:

> Hi Chathura,
>
> In DAS 3.0.0, aggregation of bucketed range is not supported. But if the
> aggregation is summation, we can use score-functions and use facet count
> APIs to aggregate per range.
>
> @Anjana, Shall we add this functionality as an improvement to DAS 3.0.1?
>

+1, let's discuss and plan the required functionality properly and add it.

Cheers,
Anjana.


>
> On Mon, Nov 23, 2015 at 1:46 AM, Chathura Ekanayake 
> wrote:
>
>> Hi Gimantha,
>>
>> Instead of getting record counts, is there a way to get aggregates of
>> some numerical field with range faceting?
>>
>> Also, it would be useful to specify ranges as start value, end value and
>> gap, in addition to the method mentioned in the sample.
>>
>> Regards,
>> Chathura
>>
>>
>> On Mon, Nov 23, 2015 at 7:45 AM, Gimantha Bandara 
>> wrote:
>>
>>> Hi Isuru,
>>>
>>> 1. DAS 3.0.0 does not support sorting aggregated data. But it can be
>>> considered as an improvement in 3.0.01
>>>
>>> 2. DAS 3.0.0  REST API support ranged faceting. You will have to give
>>> the boundaries for each range with a label name. Please refer to [1] for
>>> more info.
>>>
>>> [1]
>>> https://docs.wso2.com/display/DAS300/Retrieving+the+Event+Count+of+Range+Facets
>>>
>>>
>>> On Fri, Nov 20, 2015 at 12:01 PM, Rukshan Premathunga 
>>> wrote:
>>>
 Hi Isuru,

 For 2nd issue, you can try with lucene range search[1].

 [1] https://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Range
 Searches

 Thanks and Regards.

 On Fri, Nov 20, 2015 at 5:37 PM, Isuru Wijesinghe 
 wrote:

> Hi All,
>
> We're currently developing the dashboard for BPS statistics data and
> we encounter some problems mentioned below.
>
> 1.) Does DAS already support a sorting feature to retrieve the
> aggregated data in the ascending order ?
>
> Why we need sorting feature here because let's say as an example,  if
> we are analyzing the involvement of different users in a particular
> process, we have to provide the process ID as the primary filter. There 
> can
> be a large number of users in the system which could result in too many
> entries in the X axis. To overcome this, most graphs have to provide a
> secondary filter to obtain only top X or bottom X entries (asc or dsc
> ordering).
>
> When retrieving the records through the faceted search for the columns
> which have the aggregated values(eg: avg, sum, etc) from the DAS REST API,
> the data is usually listed in random order. As a solution for that, need 
> to
> provide a mechanism in the DAS side to sort the records in the column such
> a way that they will be retrieved in a specific order so that it can be
> used to sort in ascending order, descending order according to the given
> column or multiple columns.
>
> eg: {
> "tableName": "USER_INVOLVE_SUMMARY_DATA",
> "groupByField": "processDefKey",
> "query": "assignee:admin",
> *"sort":"totalInvolvedTime asc"*,
> "aggregateFields": [
> {
> "fieldName": "duration",
> "aggregate": "SUM",
> "alias": "totalInvolvedTime"
> }
> ]
> }
>
> 2.) Is it possible to do range faceting in DAS?
>
> (Here the range facet produces multiple range buckets over numeric
> fields or date fields.)
> Let's say as an example we have a field called *price* in one of the
> summarized tables and we have that field faceted. We want to get the 
> facets
> as ranges of values (*eg:* *0-100, 100-500, 500-1000, etc* - these
> are the ranges that prices fall into). Is it possible to calculate the
> ranges (facet counts for the ranges of prices - eg: say for 5 values) 
> based
> on the values in the table ?
>
> --
> Isuru Wijesinghe
> *Software Engineer*
> WSO2 inc : http://wso2.com
> lean.enterprise.middleware
> Mobile: 0710933706
> isur...@wso2.com
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 Rukshan Chathuranga.
 Software Engineer.
 WSO2, Inc.

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


>>>
>>>
>>> --
>>> Gimantha Bandara
>>> Software Engineer
>>> WSO2. Inc : http://wso2.com
>>> Mobile : +94714961919
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>
>
> --
> Gimantha Bandara
> Software Engineer
> WSO2. Inc : http://wso2.com
> Mobile : +94714961919
>



-- 

Re: [Dev] Cross origin REST call fails with 403 Forbidden Error

2015-11-24 Thread Fazlan Nazeem
Hi Thilini,

I have tried mapping localhost to a different domain and the issue still
remains. Furthermore the options call using curl as following also gives a
403.

curl -X  options -H "Origin: test.com" -H "Content-Type: application/json"
> -H "Authorization: Basic YWRtaW46YWRtaW4=" -v
> https://localhost:9443/api/datasets -k


but the following returns the correct headers.

curl -X  options  -H "Content-Type: application/json" -H "Authorization:
> Basic YWRtaW46YWRtaW4=" -v https://localhost:9443/api/datasets -k



On Wed, Nov 25, 2015 at 9:06 AM, Thilini Cooray  wrote:

> Hi,
>
> [1] has mentions that Chrome does not support localhost to go through the
> Access-Control-Allow-Origin, therefore we need to map localhost to a
> different domain. Further details regarding this issue in chrome is
> discussed in [2].
>
> Can this be any help for you?
>
> [1]
> http://stackoverflow.com/questions/28547288/no-access-control-allow-origin-header-is-present-on-the-requested-resource-err
> [2] https://code.google.com/p/chromium/issues/detail?id=67743
>
> Thanks.
>
> On Tue, Nov 24, 2015 at 9:59 PM, Fazlan Nazeem  wrote:
>
>> Hi,
>>
>> I need cross origin support for a REST API. In order to achieve it I am
>> trying to set the following headers in the response.
>>
>>> "Access-Control-Allow-Origin", "*"
>>> "Access-Control-Allow-Headers","*"
>>> "Access-Control-Allow-Methods","GET, POST, DELETE"
>>
>>
>>
>> My current implementation is as follows.
>>
>> in web.xml
>>
>>> 
>>> CorsFilter
>>> org.apache.catalina.filters.CorsFilter
>>> 
>>>
>>
>>
>>> 
>>> CorsFilter
>>> /*
>>
>>
>>
>>>
>>>
>>
>> the Rest implementation
>>
>> @Path("/datasets")public class DatasetApiV10 extends MLRestAPI {
>>
>>   @OPTIONS
>> public Response options() {
>> return  Response.ok().header("Access-Control-Allow-Origin", 
>> "*").header("Access-Control-Allow-Headers","*").header("Access-Control-Allow-Methods","GET,
>>  POST, DELETE").build();
>> }
>>
>> Cross origin headers are *not set *in the response header when a cross
>> origin call is made, but those headers are *set* when I do a local
>> OPTIONS call for the API using cURL or a REST client.
>>
>> Following is the error message I am getting in chrome console.
>>
>> XMLHttpRequest cannot load https://localhost:9443/api/datasets. Response
>> to preflight request doesn't pass access control check: No
>> 'Access-Control-Allow-Origin' header is present on the requested resource.
>> Origin 'http://localhost:8080' is therefore not allowed access. The
>> response had HTTP status code 403
>>
>>
>> Any suggestion to solve this issue?
>>
>>
>> --
>> Thanks & Regards,
>>
>> Fazlan Nazeem
>>
>> *Software Engineer*
>>
>> *WSO2 Inc*
>> Mobile : +94772338839
>> <%2B94%20%280%29%20773%20451194>
>> fazl...@wso2.com
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Best Regards,
>
> *Thilini Cooray*
> Software Engineer
> Mobile : +94 (0) 774 570 112 <%2B94%20%280%29%20773%20451194>
> E-mail : thili...@wso2.com
>
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
>



-- 
Thanks & Regards,

Fazlan Nazeem

*Software Engineer*

*WSO2 Inc*
Mobile : +94772338839
<%2B94%20%280%29%20773%20451194>
fazl...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [ESB][Connector] Redmine Connector - Adding getVersion Operation

2015-11-24 Thread Shakila Sivagnanarajah
Hi Malaka,

I added latest connector to the store.

Thank you

On Tue, Nov 24, 2015 at 7:44 PM, Malaka Silva  wrote:

> Shakila we may need to upload the latest to the store.
>
> On Tue, Nov 24, 2015 at 4:27 PM, Shakila Sivagnanarajah 
> wrote:
>
>> Merged
>>
>> On Wed, Nov 18, 2015 at 3:36 PM, Lakmini Chathurika 
>> wrote:
>>
>>> Hi Shakila,
>>>
>>> Resolved the commented mistakes.
>>>
>>> Thanks
>>>
>>>
>>> On Wed, Nov 18, 2015 at 1:38 PM, Shakila Sivagnanarajah <
>>> shak...@wso2.com> wrote:
>>>
 Hi Lakmini,

 I added some comments. Please go through and resolve.

 Thanks

 On Wed, Nov 18, 2015 at 1:16 PM, Lakmini Chathurika 
 wrote:

> Hi,
>
>  I want to get list of the versions available for the project of given
> id or identifier (:project_id). The response may include shared versions
> from other projects. Current connector does not support this requirement. 
> I
> have created the JIRA[1] and add the PR[2]. Could you please review and
> merge this.
>
> [1]https://wso2.org/jira/browse/ESBCONNECT-72
> [2]https://github.com/wso2/esb-connectors/pull/417
>
> Thanks & Regards,
> Lakmini.
>



 --
 Shakila Sivagnanarajah
 Associate Software Engineer
 Mobile :+94 (0) 770 760240
 shak...@wso2.com

>>>
>>>
>>
>>
>> --
>> Shakila Sivagnanarajah
>> Associate Software Engineer
>> Mobile :+94 (0) 770 760240
>> shak...@wso2.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/
> 
> https://store.wso2.com/store/
>
> Save a tree -Conserve nature & Save the world for your future. Print this
> email only if it is absolutely necessary.
>



-- 
Shakila Sivagnanarajah
Associate Software Engineer
Mobile :+94 (0) 770 760240
shak...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Orbit] Adding H2O AI 3.2.0.9

2015-11-24 Thread Nirmal Fernando
[Looping Kernel team]

On Wed, Nov 25, 2015 at 1:03 PM, Maheshakya Wijewardena  wrote:

> Hi,
>
> Can you please review and merge this PR[1] for wso2v1 of the H2O AI
> 3.2.0.9.
> This is for deep learning integration of WSO2 ML.
>
> Best regards,
>
> [1] https://github.com/wso2/orbit/pull/150
> --
> Pruthuvi Maheshakya Wijewardena
> Software Engineer
> WSO2 : http://wso2.com/
> Email: mahesha...@wso2.com
> Mobile: +94711228855
>
>
>


-- 

Thanks & regards,
Nirmal

Team Lead - WSO2 Machine Learner
Associate Technical Lead - Data Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [Orbit] Adding H2O AI 3.2.0.9

2015-11-24 Thread Maheshakya Wijewardena
Hi,

Can you please review and merge this PR[1] for wso2v1 of the H2O AI
3.2.0.9.
This is for deep learning integration of WSO2 ML.

Best regards,

[1] https://github.com/wso2/orbit/pull/150
-- 
Pruthuvi Maheshakya Wijewardena
Software Engineer
WSO2 : http://wso2.com/
Email: mahesha...@wso2.com
Mobile: +94711228855
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Cleaning up ML REST API

2015-11-24 Thread Nirmal Fernando
Hi Frank,

Could you please let us know few time slots?

On Mon, Nov 23, 2015 at 9:29 AM, Nirmal Fernando  wrote:

> Absolutely. We'll wait till Frank confirms a time. Thanks.
>
> On Sun, Nov 22, 2015 at 10:18 PM, Sanjeewa Malalgoda 
> wrote:
>
>> Hi nirmal,
>> please invite apim rest api team as well. we would like to join this
>> discussion.
>>
>> Thanks
>> sanjeewa.
>>
>> sent from my phone
>> On Nov 22, 2015 7:00 PM, "Nirmal Fernando"  wrote:
>>
>>> Thanks Frank for the response. +1 for having a call. Could you please
>>> propose few time slots?
>>>
>>> On Sun, Nov 22, 2015 at 6:55 PM, Frank Leymann  wrote:
>>>
 Dear Thamali,

 we (APIM, ES Publisher,... teams) developed some guidelines on making
 all of our APIs more consistent. For example, versioning (major, minor,
 patch) as part of the URL context etc.  Also, you are not using PUT but
 always POST - this has some implications a bunch of REST-folks are serious
 about. Similarly, the use of proper HTTP headers is a REST issue to reduce
 the amount of data transferred, to avoid potential concurrency problems
 etc.

 Should we have a call to discuss the API and check where we can help?



 Best regards,
 Frank

 2015-11-18 12:10 GMT+01:00 Nirmal Fernando :

> Thanks Thamali! Please try to generate the Swagger definition for ML
> API as the next step.
>
> On Wed, Nov 18, 2015 at 12:21 PM, Thamali Wijewardhana <
> tham...@wso2.com> wrote:
>
>> REST API standards define the way to produce a RESTful API. For an
>> API to become a RESTful API, it should confirm to those REST
>> standards.This document includes a set of  improvements to make the WSO2
>> API, a RESTful API.
>>
>>
>>
>> https://docs.google.com/spreadsheets/d/1HYiS-TpqYaZTtBLLSIeYZ_nvZkbt7zAFwetnHLe4vg8/edit#gid=0
>>
>>
>>
>
>
> --
>
> Thanks & regards,
> Nirmal
>
> Team Lead - WSO2 Machine Learner
> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
>
>

>>>
>>>
>>> --
>>>
>>> Thanks & regards,
>>> Nirmal
>>>
>>> Team Lead - WSO2 Machine Learner
>>> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
>>> Mobile: +94715779733
>>> Blog: http://nirmalfdo.blogspot.com/
>>>
>>>
>>>
>
>
> --
>
> Thanks & regards,
> Nirmal
>
> Team Lead - WSO2 Machine Learner
> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
>
>


-- 

Thanks & regards,
Nirmal

Team Lead - WSO2 Machine Learner
Associate Technical Lead - Data Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] is there any issue in adding classloder to connector

2015-11-24 Thread Rajjaz Mohammed
> Seems like a jar version mismatch. Better verify if we are using client
> jars of the same server version?
>

yes malaka,
 i accept with you its because of library version mismatch but if i add the
same jar file inside the connector as Dependency then its work fine. so the
issue may be some existing library affecting this library.


> Check [1] May be it'll help
>
> [1]
> http://www.coderanch.com/t/454071/java-EJB-SCBCD/certification/javax-naming-Reference-cast-org
>
>
i checked but same issue repeating  again and again.


-- 
Thank you
Best Regards

*Rajjaz HM*
Associate Software Engineer
WSO2 Inc. 
lean | enterprise | middleware
Mobile | +94752833834
Email   | raj...@wso2.com
LinkedIn | Blogger | WSO2 Profile

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


Re: [Dev] About Build fails product-apim : org.wso2.carbon.forum.server.feature:zip:2.0.1-SNAPSHOT is missing in nexus repo

2015-11-24 Thread Udara Rathnayake
Hi,

Please find my answers inline.
Make sure you copy dev@wso2.org next time so you will get responses from
wider developer community.

On Tue, Nov 24, 2015 at 2:44 AM, Chen Ling 陈凌-IOV 
wrote:

> Hi Udarar,
>
>
>
> Currently I use Carbon kernel(branch master) + API manager(1.9.1), the
> carbon at 9443 works, but the publisher and API store at 9763 doesn’t work.
>
​Try accessing store/publisher using, https://localhost:9443/store/ and
https://localhost:9443/publisher (use your hostname instead of localhost)​,
Are you getting any errors? If so please share the stack trace.

> So I am trying to use Carbon kernel (master) + API manager(master), but I
> can’t get the 
> org.wso2.carbon.apimgt:org.wso2.carbon.forum.server.feature:zip:2.0.1-SNAPSHOT
> when building API manager.
>
>
>
> It’s heard that the carbon-apimgt should be built at first, may I know
> which version should I get and is there any document about how to debug the
> API manager?
>

​If you are building product-apim master branch you can find the relevant
apimgt component version under properties here(
https://github.com/wso2/product-apim/blob/master/pom.xml).

Eg:-
2.0.1-SNAPSHOT​

​Then you have to find the relevant branch within carbon-apimgt component
repo​, I went through it and found 2.0.1-SNAPSHOT is available within
release-2.0.0 branch (
https://github.com/wso2/carbon-apimgt/blob/release-2.0.0/pom.xml)

Check the 2.0.1-SNAPSHOT property within above pom.

At the same time, you don't need to build Carbon Kernel here, since we are
using already released version (4.4.1)
4.4.1

​If you want to debug APIM backend components (Eg:- org.wso2.carbon.forum
https://github.com/wso2/carbon-apimgt/tree/master/components/forum/org.wso2.carbon.forum
)​

​you can import it as a maven project to your IDE and remote debug.​

check the steps under topic "Remote Debugging" here :
http://pumuduruhunage.blogspot.com/2015/01/remote-debug-wso2-carbon-components.html


>
> Thanks.
>
>
>
> Chen, Ling
>
> Cell: +86 13916508161
>
> Email: chenlin...@saicmotor.com
>
> Address: ShenTong Info Square D, 3rd floor, HuaiHai Xi Road 55, XuHui
> district, Shanghai
>
>
>
>
> 邮件免责申明- 该电子邮件中的信息是保密的,除收件人外任何人无权访问此电子邮件。
> 如果您不是收件人,公开、复制、分发或基于此封邮件的任何行动,都是禁止的,并可能是违法的。该邮件包含的任何意见与建议均应遵循上汽集团关于信息传递与保密的制度或规定。除经上汽集团信函以正式书面方式确认外,任何相关的内容或信息不得作为正式依据。
> Email Disclaimer- The information in this email is confidential and may
> be legally privileged. It is intended solely for the addressee. Access to
> this email by anyone else is unauthorized. If you are not the intended
> recipient, any disclosure, copying, distribution or any action taken or
> omitted to be taken in reliance on it, is prohibited and may be unlawful.
> Any opinions or advice contained in this email are subject to the terms and
> conditions expressed in the governing SAICMOTOR client engagement letter
> and should not be relied upon unless they are confirmed in writing on
> SAICMOTOR's letterhead.
>



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


[Dev] Cross origin REST call fails with 403 Forbidden Error

2015-11-24 Thread Fazlan Nazeem
Hi,

I need cross origin support for a REST API. In order to achieve it I am
trying to set the following headers in the response.

> "Access-Control-Allow-Origin", "*"
> "Access-Control-Allow-Headers","*"
> "Access-Control-Allow-Methods","GET, POST, DELETE"



My current implementation is as follows.

in web.xml

> 
> CorsFilter
> org.apache.catalina.filters.CorsFilter
> 
>


> 
> CorsFilter
> /*

   

>
>

the Rest implementation

@Path("/datasets")public class DatasetApiV10 extends MLRestAPI {

  @OPTIONS
public Response options() {
return  Response.ok().header("Access-Control-Allow-Origin",
"*").header("Access-Control-Allow-Headers","*").header("Access-Control-Allow-Methods","GET,
POST, DELETE").build();
}

Cross origin headers are *not set *in the response header when a cross
origin call is made, but those headers are *set* when I do a local OPTIONS
call for the API using cURL or a REST client.

Following is the error message I am getting in chrome console.

XMLHttpRequest cannot load https://localhost:9443/api/datasets. Response to
preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:8080' is therefore not allowed access. The
response had HTTP status code 403


Any suggestion to solve this issue?


-- 
Thanks & Regards,

Fazlan Nazeem

*Software Engineer*

*WSO2 Inc*
Mobile : +94772338839
<%2B94%20%280%29%20773%20451194>
fazl...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Adding Metrics to APIManager 1.10.0

2015-11-24 Thread Isuru Perera
Hi,

Please refer GitHub readme for Metrics Feature installation instructions &
usage. Latest Metrics release is v1.1.1. If you want to create custom
Metrics UI, you will have to implement an OSGi fragment bundle. MB Team has
created a similar component [1].

JVM Metrics will be there by default [2]. See [3] for the custom Messaging
Metrics UI.

Thanks!

Best Regards,

[1]
https://github.com/wso2/carbon-business-messaging/tree/v3.0.1/components/metrics/org.wso2.carbon.messaging.metrics.ui
[2] https://docs.wso2.com/display/MB300/Using+JVM+Metrics
[3] https://docs.wso2.com/display/MB300/Using+Messaging+Metrics

On Tue, Nov 24, 2015 at 10:30 AM, Dinesh J Weerakkody 
wrote:

> Hi All,
>
> As a part of the effort of performance measuring and improvement of WSO2
> API Manager, we are planing to incorporate the Metrics feature [1], which
> will help us to gather statistics during the runtime.
>
> Initially we will add metrics to all the handlers in APIM and based on the
> results we will add more data collection points as necessary.
>
> [1] https://github.com/wso2/carbon-metrics
>
>
> Thanks
>
> *Dinesh J. Weerakkody*
> Software Engineer
> WSO2 Inc.
> lean | enterprise | middleware
> M : +94 727 868676 | E : dine...@wso2.com | W : www.wso2.com
>



-- 
Isuru Perera
Associate Technical Lead | WSO2, Inc. | http://wso2.com/
Lean . Enterprise . Middleware

about.me/chrishantha
Contact: +IsuruPereraWSO2 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Deploying Capp using Java Client

2015-11-24 Thread Rukshan Premathunga
Hi,

I was trying to deploy carbon-app (.car file) using java client. For that i
used the *CarbonAppUploader *service.

Below the code i used to deploy the capp and it is worked fine.


File file = new File(cAppPath);


//get the byte array of file

byte[] byteArray = FileUtils.readFileToByteArray(file);

DataHandler dataHandler = new DataHandler(byteArray,

APIUsageStatisticsClientConstants.APPLICATION_OCTET_STREAM);


//create the stub to deploy artifacts

CarbonAppUploaderStub stub = new CarbonAppUploaderStub(url +
"/services/CarbonAppUploader");

ServiceClient client = stub._getServiceClient();

Options options = client.getOptions();

//set the security

HttpTransportProperties.Authenticator authenticator = new
HttpTransportProperties.Authenticator();

authenticator.setUsername(user);

authenticator.setPassword(pass);

authenticator.setPreemptiveAuthentication(true);

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
authenticator);

client.setOptions(options);

log.info("Deploying DAS cApp '" + cAppName + "'...");


//create UploadedFileItem array and 1st element contain the deploy artifact

UploadedFileItem[] fileItem = new UploadedFileItem[1];

fileItem[0] = new UploadedFileItem();

fileItem[0].setDataHandler(dataHandler);

fileItem[0].setFileName(cAppName);

*fileItem[0].setFileType("jar");*


//upload the artifacts

stub.uploadApp(fileItem);


But for the capp file type i always have to set "jar". I tried with the
"car" but gave me an error.
So do we have any other correct way to deploy Capp. Or is this behavior is
a bug?

Thanks and Regards.

Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Deploying Capp using Java Client

2015-11-24 Thread Lakshman Udayakantha
what is the error?

On Tue, Nov 24, 2015 at 2:11 PM, Rukshan Premathunga 
wrote:

> Hi,
>
> I was trying to deploy carbon-app (.car file) using java client. For that
> i used the *CarbonAppUploader *service.
>
> Below the code i used to deploy the capp and it is worked fine.
>
>
> File file = new File(cAppPath);
>
>
> //get the byte array of file
>
> byte[] byteArray = FileUtils.readFileToByteArray(file);
>
> DataHandler dataHandler = new DataHandler(byteArray,
>
> APIUsageStatisticsClientConstants.APPLICATION_OCTET_STREAM);
>
>
> //create the stub to deploy artifacts
>
> CarbonAppUploaderStub stub = new CarbonAppUploaderStub(url +
> "/services/CarbonAppUploader");
>
> ServiceClient client = stub._getServiceClient();
>
> Options options = client.getOptions();
>
> //set the security
>
> HttpTransportProperties.Authenticator authenticator = new
> HttpTransportProperties.Authenticator();
>
> authenticator.setUsername(user);
>
> authenticator.setPassword(pass);
>
> authenticator.setPreemptiveAuthentication(true);
>
> options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
> authenticator);
>
> client.setOptions(options);
>
> log.info("Deploying DAS cApp '" + cAppName + "'...");
>
>
> //create UploadedFileItem array and 1st element contain the deploy artifact
>
> UploadedFileItem[] fileItem = new UploadedFileItem[1];
>
> fileItem[0] = new UploadedFileItem();
>
> fileItem[0].setDataHandler(dataHandler);
>
> fileItem[0].setFileName(cAppName);
>
> *fileItem[0].setFileType("jar");*
>
>
> //upload the artifacts
>
> stub.uploadApp(fileItem);
>
>
> But for the capp file type i always have to set "jar". I tried with the
> "car" but gave me an error.
> So do we have any other correct way to deploy Capp. Or is this behavior is
> a bug?
>
> Thanks and Regards.
>
> Rukshan Chathuranga.
> Software Engineer.
> WSO2, Inc.
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Lakshman Udayakantha
WSO2 Inc. www.wso2.com
lean.enterprise.middleware
Mobile: *0714388124*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Deploying Capp using Java Client

2015-11-24 Thread Lakshman Udayakantha
For some time ago I used [1] to upload a capp written by aruna. You can use
that.

[1] https://github.com/arunasujith/capp-upload-admin-service-sample

Thanks

On Tue, Nov 24, 2015 at 2:17 PM, Lakshman Udayakantha 
wrote:

> what is the error?
>
> On Tue, Nov 24, 2015 at 2:11 PM, Rukshan Premathunga 
> wrote:
>
>> Hi,
>>
>> I was trying to deploy carbon-app (.car file) using java client. For that
>> i used the *CarbonAppUploader *service.
>>
>> Below the code i used to deploy the capp and it is worked fine.
>>
>>
>> File file = new File(cAppPath);
>>
>>
>> //get the byte array of file
>>
>> byte[] byteArray = FileUtils.readFileToByteArray(file);
>>
>> DataHandler dataHandler = new DataHandler(byteArray,
>>
>> APIUsageStatisticsClientConstants.APPLICATION_OCTET_STREAM);
>>
>>
>> //create the stub to deploy artifacts
>>
>> CarbonAppUploaderStub stub = new CarbonAppUploaderStub(url +
>> "/services/CarbonAppUploader");
>>
>> ServiceClient client = stub._getServiceClient();
>>
>> Options options = client.getOptions();
>>
>> //set the security
>>
>> HttpTransportProperties.Authenticator authenticator = new
>> HttpTransportProperties.Authenticator();
>>
>> authenticator.setUsername(user);
>>
>> authenticator.setPassword(pass);
>>
>> authenticator.setPreemptiveAuthentication(true);
>>
>> options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
>> authenticator);
>>
>> client.setOptions(options);
>>
>> log.info("Deploying DAS cApp '" + cAppName + "'...");
>>
>>
>> //create UploadedFileItem array and 1st element contain the deploy
>> artifact
>>
>> UploadedFileItem[] fileItem = new UploadedFileItem[1];
>>
>> fileItem[0] = new UploadedFileItem();
>>
>> fileItem[0].setDataHandler(dataHandler);
>>
>> fileItem[0].setFileName(cAppName);
>>
>> *fileItem[0].setFileType("jar");*
>>
>>
>> //upload the artifacts
>>
>> stub.uploadApp(fileItem);
>>
>>
>> But for the capp file type i always have to set "jar". I tried with the
>> "car" but gave me an error.
>> So do we have any other correct way to deploy Capp. Or is this behavior
>> is a bug?
>>
>> Thanks and Regards.
>>
>> Rukshan Chathuranga.
>> Software Engineer.
>> WSO2, Inc.
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Lakshman Udayakantha
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
> Mobile: *0714388124*
>
>


-- 
Lakshman Udayakantha
WSO2 Inc. www.wso2.com
lean.enterprise.middleware
Mobile: *0714388124*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [EMM] Doubt on Server Url to be taken from carbon.xml HostName value or some other configuration.

2015-11-24 Thread Chamara Ariyarathne
Hi Milan,

Your information is also incorrect. I tried changing the  tag in
carbon.xml and tried the same scenario and the QR code is still generated
with the host machine's Ethernet ip-address.

Thanks.

On Tue, Nov 24, 2015 at 12:38 PM, Afkham Azeez  wrote:

> Yes. You have to use the value in the carbon. Xml
> On Nov 24, 2015 8:17 AM, "Selvaratnam Uthaiyashankar" 
> wrote:
>
>> I agree with Chamara. We have a way to configure public hostname
>> (HostName, MgtHostName in carbon.xml) and port (proxy port in
>> tomcat/catalina-server.xml). This is what used in generating service
>> endpoints, WSDL URLs etc. when a server is fronted with LB. I don't see any
>> necessary for EMM to have a new configuration.
>>
>> On Tue, Nov 24, 2015 at 12:41 AM, Geeth Munasinghe 
>> wrote:
>>
>>>
>>>
>>> On Tue, Nov 24, 2015 at 12:12 AM, Chamara Ariyarathne >> > wrote:
>>>
 Hi Milan. Thanks for the information. We will try this tomorrow. But
 our purpose is to replace this whole url with a configured host name.

 However Geeth, I think the EMM team having to introduce a new config to
 put the globally exposed server url deviates from the purpose of having
 HostName and MgtHostname properties in the carbon.xml..

>>>
>>> Chamara,
>>> I think I disagree with on that point. I dont think carbon hostname or
>>> mgt host name cannot be used for globally exposing the server url.  AFAIK
>>> there is no place to put the port number in carbon.xml. There is no point
>>> of having just a host name without the port number. The carbon.xml host
>>> name will be the server ip address or the host name of the server which the
>>> product is running as clearly mentioned in the document [1].
>>>
>>> As another reference, AFAIK in ESB, we use WSDLPrefix [2] in order to
>>> change the address endpoint of generated wsdls to LB's address when ESB is
>>> fronted by a LB.
>>>
>>> So I think introducing a new config to put the LB host name and port is
>>> valid.
>>>
>>> [1] https://docs.wso2.com/display/Carbon440/Configuring+carbon.xml
>>> [2] https://docs.wso2.com/display/ESB490/Setting+Up+Host+Names+and+Ports
>>>
>>> Thanks
>>> Geeth
>>>

 On Mon, Nov 23, 2015 at 9:58 PM, Milan Perera  wrote:

> Hi
> ​Chamara​
> ,
>
> Today we found out that even when the Host Names are configured in the
>> carbonl.xml to be server's identified domain name, the QR code which is
>> generated while device registration, uses the host ip address which is
>> picked up from nowhere.
>>
> ​
> Actually this IP is taking from the PAN. In my machine, if I dont set
> it manually from the carbon.xml to my wlan IP, it pics the pan1
> (10.7.200.1) and it breaks all the download links that are generated by 
> the
> jaggery in most of the time.
>
> pan1  Link encap:Ethernet  HWaddr c2:1e:fe:3b:6a:6e
>   inet addr:10.7.200.1  Bcast:10.7.200.255  Mask:255.255.255.0
>   inet6 addr: fe80::c01e:feff:fe3b:6a6e/64 Scope:Link
>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>   TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
>   collisions:0 txqueuelen:0
>   RX bytes:0 (0.0 B)  TX bytes:28795 (28.7 KB)
>
> wlan0 Link encap:Ethernet  HWaddr 84:3a:4b:9b:cf:66
>   inet addr:192.168.1.10  Bcast:192.168.1.255
> Mask:255.255.255.0
>   inet6 addr: fe80::863a:4bff:fe9b:cf66/64
> Scope:Link
>   UP BROADCAST RUNNING MULTICAST  MTU:1500
> Metric:1
>   RX packets:207466 errors:0 dropped:0 overruns:0
> frame:0
>   TX packets:41603 errors:0 dropped:0 overruns:0
> carrier:0
>   collisions:0
> txqueuelen:1000
>
>   RX bytes:209272568 (209.2 MB)  TX bytes:7936480 (7.9 MB) ​
>
> ​To overcome t​his, what I do is uncomment the  tag from
> the carbon.xml and set it to my wlan ip.
> https://192.168.1.10:
> ${carbon.management.port}${carbon.context}/services/
>
> ​Regards,​
>
> --
> *Milan Perera *| Software Engineer
> WSO2, Inc | lean. enterprise. middleware.
> #20, Palm Grove, Colombo 03, Sri Lanka
> Mobile: +94 77 309 7088 | Work: +94 11 214 5345
> Email: mi...@wso2.com  | Web: www.wso2.com
> 
>



 --
 *Chamara Ariyarathne*
 Associate Technical Lead - QA
 WSO2 Inc; http://www.wso2.com/
 Mobile; *+94772786766 <%2B94772786766>*

>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> S.Uthaiyashankar
>> VP Engineering
>> WSO2 Inc.
>> http://wso2.com/ - "lean . enterprise . 

Re: [Dev] [CARBON] Parameterizing the Maven bundle plugin and moving plugin configuration inside carbon-parent pom

2015-11-24 Thread Manuri Amaya Perera
Having an OSGi parent for a non-OSGi module is not a problem as we are
specifying the needed packaging type(eg: jar) ​

We are just specifying our maven-bundle-plugin in the carbon-parent. Any
child module who use it(i.e. specify packaging type as bundle) will inherit
the configuration and others will not be affected as their packaging type
is different.


On Tue, Nov 24, 2015 at 12:26 PM, Afkham Azeez  wrote:

> We can't make all non-osgi jars make carbon-kernel their parent
> On Nov 24, 2015 11:37 AM, "Manuri Amaya Perera"  wrote:
>
>> Hi Azeez,
>>
>> [1] is a non-osgi jar which has the parent carbon-kernel of which the
>> parent is carbon-parent.
>> Why do we need to add "component" ? Doesn't it already sound generic?
>>
>> [1] https://github.com/wso2/carbon-kernel/blob/master/launcher/pom.xml
>>
>> Thank you.
>>
>> On Tue, Nov 24, 2015 at 11:18 AM, Afkham Azeez  wrote:
>>
>>> Can carbon-parent be the parent of non-osgi jars as well? If so should
>>> we call it carbon-componet-parent?
>>> On Nov 24, 2015 11:13 AM, "Manuri Amaya Perera" 
>>> wrote:
>>>
 Hi,

 I have created a doc[1] on
 1. What configurations should be allowed to be changed by component
 developers (may have default values or not)
 2. What should have default values which cannot be overridden without
 redeclaring the plugin inside the bundle

 Please share your thoughts on this.

 And this[2] is the documentation I created on the usage of this
 approach.

 I have built C5, carbon-transport, product-mss, product-gw with this.

 [1]
 https://docs.google.com/a/wso2.com/spreadsheets/d/1EegtaHbrSVQ1eJf75z9p03PiEkFguCytAYmyQCDSsjI/edit?usp=sharing
 [2]
 https://docs.google.com/a/wso2.com/document/d/1468M7L2vHcJQ-4oChb_5wBpRECNbUX3Om31MFzpZ_nc/edit?usp=sharing


 Thank you.

 On Wed, Nov 11, 2015 at 2:50 PM, Manuri Amaya Perera 
 wrote:

> + architecture@
>
> On Wed, Nov 11, 2015 at 2:46 PM, Manuri Amaya Perera  > wrote:
>
>> Hi,
>>
>> Currently for each carbon component's pom file we need to include the
>> maven bundle plugin. Some of the bundle plugin configuration values such 
>> as
>> group id, artifact id and version are repetitively used in each of these
>> components(eg: [1])
>>
>> We can avoid this repetition by including the bundle plugin inside
>> carbon-parent pom[2] instead of having it inside each component.
>> Here we have to include bundle plugin inside build/plugins[3] section
>> of carbon-parent pom and then the plugin configuration will be inherited 
>> by
>> child modules and any configuration that needs to be overridden could be
>> mentioned as properties inside child poms.
>> This will make maintenance easier and reduce code.
>>
>> There is also a disadvantage with parameterizing the bundle plugin.
>> That is, some headers such as Bundle-NativeCode must have a value if that
>> element is put in the plugin configuration[4], otherwise the build
>> fails.Therefore we cannot have this inside carbon-parent pom's bundle
>> plugin configuration as child modules may not have a value for it.
>> This is the only header we've found out which causes this problem.
>> And I could not find any usage of this header in a WSO2 repository.
>> Therefore if this header is not going to be used we can safely remove it
>> from carbon-parent pom and proceed with parameterizing the bundle plugin.
>>
>> Your ideas on moving the bundle-plugin configuration to carbon-parent
>> pom and parameterization will be highly appreciated.
>>
>>
>> ​[1] https://github.com/wso2/carbon-kernel/blob/5.0.x/core/pom.xml​
>> ​[2] ​https://github.com/wso2/carbon-parent/blob/master/pom.xml
>> [3] https://maven.apache.org/pom.html#Plugins
>> [4] http://bnd.bndtools.org/heads/bundle_nativecode.html
>>
>>
>> ​Thank you.​
>>
>> --
>>
>> *Manuri Amaya Perera*
>>
>> *Software Engineer*
>>
>> *WSO2 Inc.*
>>
>> *Blog: http://manuriamayaperera.blogspot.com
>> *
>>
>
>
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>



 --

 *Manuri Amaya Perera*

 *Software Engineer*

 *WSO2 Inc.*

 *Blog: http://manuriamayaperera.blogspot.com
 *

>>>
>>
>>
>> --
>>
>> *Manuri Amaya Perera*
>>
>> *Software Engineer*
>>
>> *WSO2 Inc.*
>>
>> *Blog: http://manuriamayaperera.blogspot.com
>> *
>>
>


-- 

*Manuri Amaya Perera*

*Software 

Re: [Dev] [APIM 1.10.x] Error while add comment on API

2015-11-24 Thread Malintha Adikari
Hi Nuwan,

We cleaned-up the SVN repo and restarted the distributed setup in order to
stop deploying any old web app. Now I am getting following error while
adding comment.

TID: [-1234] [] [2015-11-24 08:52:44,820]  INFO
{JAGGERY.site.blocks.api-doc.ajax.get:jag} -  carbon.super
{JAGGERY.site.blocks.api-doc.ajax.get:jag}
TID: [-1234] [] [2015-11-24 08:52:44,825]  INFO
{JAGGERY.site.blocks.api-doc.ajax.get:jag} -  carbon.super
{JAGGERY.site.blocks.api-doc.ajax.get:jag}
TID: [-1234] [] [2015-11-24 08:52:54,721] ERROR
{org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO} -  Failed to add comment data,
for  CalculatorAPI-1.0 {org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO}
java.sql.SQLException: Generated keys not requested. You need to specify
Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or
Connection.prepareStatement().
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1817)
at org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addComment(ApiMgtDAO.java:7575)
at
org.wso2.carbon.apimgt.impl.APIConsumerImpl.addComment(APIConsumerImpl.java:2158)
at
org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.addComment(UserAwareAPIConsumer.java:97)
at
org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_addComments(APIStoreHostObject.java:2032)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
at
org.jaggeryjs.rhino.store.modules.comment.c2._c_anonymous_1(/store/modules/comment/add.jag:8)
at
org.jaggeryjs.rhino.store.modules.comment.c2.call(/store/modules/comment/add.jag)
at org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.store.modules.comment.c0._c_anonymous_1(/store/modules/comment/module.jag:5)
at
org.jaggeryjs.rhino.store.modules.comment.c0.call(/store/modules/comment/module.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0._c_anonymous_1(/store/site/blocks/comment/comment-add/ajax/comment-add.jag:57)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0._c_script_0(/store/site/blocks/comment/comment-add/ajax/comment-add.jag:4)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.exec(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:587)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:507)
at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:378)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
at

Re: [Dev] [APIM 1.10.x] Error while add comment on API

2015-11-24 Thread Malintha Adikari
I meant re-prepared the distributed setup by "restart" term.

On Tue, Nov 24, 2015 at 2:31 PM, Malintha Adikari  wrote:

> Hi Nuwan,
>
> We cleaned-up the SVN repo and restarted the distributed setup in order to
> stop deploying any old web app. Now I am getting following error while
> adding comment.
>
> TID: [-1234] [] [2015-11-24 08:52:44,820]  INFO
> {JAGGERY.site.blocks.api-doc.ajax.get:jag} -  carbon.super
> {JAGGERY.site.blocks.api-doc.ajax.get:jag}
> TID: [-1234] [] [2015-11-24 08:52:44,825]  INFO
> {JAGGERY.site.blocks.api-doc.ajax.get:jag} -  carbon.super
> {JAGGERY.site.blocks.api-doc.ajax.get:jag}
> TID: [-1234] [] [2015-11-24 08:52:54,721] ERROR
> {org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO} -  Failed to add comment data,
> for  CalculatorAPI-1.0 {org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO}
> java.sql.SQLException: Generated keys not requested. You need to specify
> Statement.RETURN_GENERATED_KEYS to Statement.executeUpdate() or
> Connection.prepareStatement().
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:996)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870)
> at com.mysql.jdbc.StatementImpl.getGeneratedKeys(StatementImpl.java:1817)
> at
> org.wso2.carbon.apimgt.impl.dao.ApiMgtDAO.addComment(ApiMgtDAO.java:7575)
> at
> org.wso2.carbon.apimgt.impl.APIConsumerImpl.addComment(APIConsumerImpl.java:2158)
> at
> org.wso2.carbon.apimgt.impl.UserAwareAPIConsumer.addComment(UserAwareAPIConsumer.java:97)
> at
> org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_addComments(APIStoreHostObject.java:2032)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
> at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
> at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
> at
> org.jaggeryjs.rhino.store.modules.comment.c2._c_anonymous_1(/store/modules/comment/add.jag:8)
> at
> org.jaggeryjs.rhino.store.modules.comment.c2.call(/store/modules/comment/add.jag)
> at
> org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
> at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
> at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
> at
> org.jaggeryjs.rhino.store.modules.comment.c0._c_anonymous_1(/store/modules/comment/module.jag:5)
> at
> org.jaggeryjs.rhino.store.modules.comment.c0.call(/store/modules/comment/module.jag)
> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
> at
> org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0._c_anonymous_1(/store/site/blocks/comment/comment-add/ajax/comment-add.jag:57)
> at
> org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
> at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
> at
> org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0._c_script_0(/store/site/blocks/comment/comment-add/ajax/comment-add.jag:4)
> at
> org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
> at
> org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
> at
> org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.exec(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
> at
> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
> at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
> at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:587)
> at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:507)
> at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
> at
> 

Re: [Dev] Adding Metrics to APIManager 1.10.0

2015-11-24 Thread Dinesh J Weerakkody
Hi Isuru,
Thanks for the info. I have already added metrics feature to the product.
Now I can see the JVM stats on APIM. Need to have a discussion with the
team regarding custom metrics UIs and will provide a update soon.

Thanks

*Dinesh J. Weerakkody*
Software Engineer
WSO2 Inc.
lean | enterprise | middleware
M : +94 727 868676 | E : dine...@wso2.com | W : www.wso2.com

On Tue, Nov 24, 2015 at 1:57 PM, Isuru Perera  wrote:

> Hi,
>
> Please refer GitHub readme for Metrics Feature installation instructions &
> usage. Latest Metrics release is v1.1.1. If you want to create custom
> Metrics UI, you will have to implement an OSGi fragment bundle. MB Team has
> created a similar component [1].
>
> JVM Metrics will be there by default [2]. See [3] for the custom Messaging
> Metrics UI.
>
> Thanks!
>
> Best Regards,
>
> [1]
> https://github.com/wso2/carbon-business-messaging/tree/v3.0.1/components/metrics/org.wso2.carbon.messaging.metrics.ui
> [2] https://docs.wso2.com/display/MB300/Using+JVM+Metrics
> [3] https://docs.wso2.com/display/MB300/Using+Messaging+Metrics
>
> On Tue, Nov 24, 2015 at 10:30 AM, Dinesh J Weerakkody 
> wrote:
>
>> Hi All,
>>
>> As a part of the effort of performance measuring and improvement of WSO2
>> API Manager, we are planing to incorporate the Metrics feature [1], which
>> will help us to gather statistics during the runtime.
>>
>> Initially we will add metrics to all the handlers in APIM and based on
>> the results we will add more data collection points as necessary.
>>
>> [1] https://github.com/wso2/carbon-metrics
>>
>>
>> Thanks
>>
>> *Dinesh J. Weerakkody*
>> Software Engineer
>> WSO2 Inc.
>> lean | enterprise | middleware
>> M : +94 727 868676 | E : dine...@wso2.com | W : www.wso2.com
>>
>
>
>
> --
> Isuru Perera
> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
> Contact: +IsuruPereraWSO2 
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Deploying Capp using Java Client

2015-11-24 Thread Rukshan Premathunga
Hi Lakshman,

Yes. It is working if we set file type as "jar" like here[1]. But actually
capp have .car file type. So is this way is correct?

[1]
https://github.com/arunasujith/capp-upload-admin-service-sample/blob/master/src/main/java/org/wso2/carbon/cappupload/sample/CarbonAppUploaderClient.java#L58

Thanks and Regards.

On Tue, Nov 24, 2015 at 2:21 PM, Lakshman Udayakantha 
wrote:

> For some time ago I used [1] to upload a capp written by aruna. You can
> use that.
>
> [1] https://github.com/arunasujith/capp-upload-admin-service-sample
>
> Thanks
>
> On Tue, Nov 24, 2015 at 2:17 PM, Lakshman Udayakantha 
> wrote:
>
>> what is the error?
>>
>> On Tue, Nov 24, 2015 at 2:11 PM, Rukshan Premathunga 
>> wrote:
>>
>>> Hi,
>>>
>>> I was trying to deploy carbon-app (.car file) using java client. For
>>> that i used the *CarbonAppUploader *service.
>>>
>>> Below the code i used to deploy the capp and it is worked fine.
>>>
>>>
>>> File file = new File(cAppPath);
>>>
>>>
>>> //get the byte array of file
>>>
>>> byte[] byteArray = FileUtils.readFileToByteArray(file);
>>>
>>> DataHandler dataHandler = new DataHandler(byteArray,
>>>
>>> APIUsageStatisticsClientConstants.APPLICATION_OCTET_STREAM);
>>>
>>>
>>> //create the stub to deploy artifacts
>>>
>>> CarbonAppUploaderStub stub = new CarbonAppUploaderStub(url +
>>> "/services/CarbonAppUploader");
>>>
>>> ServiceClient client = stub._getServiceClient();
>>>
>>> Options options = client.getOptions();
>>>
>>> //set the security
>>>
>>> HttpTransportProperties.Authenticator authenticator = new
>>> HttpTransportProperties.Authenticator();
>>>
>>> authenticator.setUsername(user);
>>>
>>> authenticator.setPassword(pass);
>>>
>>> authenticator.setPreemptiveAuthentication(true);
>>>
>>> options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
>>> authenticator);
>>>
>>> client.setOptions(options);
>>>
>>> log.info("Deploying DAS cApp '" + cAppName + "'...");
>>>
>>>
>>> //create UploadedFileItem array and 1st element contain the deploy
>>> artifact
>>>
>>> UploadedFileItem[] fileItem = new UploadedFileItem[1];
>>>
>>> fileItem[0] = new UploadedFileItem();
>>>
>>> fileItem[0].setDataHandler(dataHandler);
>>>
>>> fileItem[0].setFileName(cAppName);
>>>
>>> *fileItem[0].setFileType("jar");*
>>>
>>>
>>> //upload the artifacts
>>>
>>> stub.uploadApp(fileItem);
>>>
>>>
>>> But for the capp file type i always have to set "jar". I tried with the
>>> "car" but gave me an error.
>>> So do we have any other correct way to deploy Capp. Or is this behavior
>>> is a bug?
>>>
>>> Thanks and Regards.
>>>
>>> Rukshan Chathuranga.
>>> Software Engineer.
>>> WSO2, Inc.
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Lakshman Udayakantha
>> WSO2 Inc. www.wso2.com
>> lean.enterprise.middleware
>> Mobile: *0714388124*
>>
>>
>
>
> --
> Lakshman Udayakantha
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
> Mobile: *0714388124*
>
>


-- 
Rukshan Chathuranga.
Software Engineer.
WSO2, Inc.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Deploying Capp using Java Client

2015-11-24 Thread Aruna Karunarathna
On Tue, Nov 24, 2015 at 2:40 PM, Rukshan Premathunga 
wrote:

> Hi Lakshman,
>
> Yes. It is working if we set file type as "jar" like here[1]. But actually
> capp have .car file type. So is this way is correct?
>
> [1]
> https://github.com/arunasujith/capp-upload-admin-service-sample/blob/master/src/main/java/org/wso2/carbon/cappupload/sample/CarbonAppUploaderClient.java#L58
>

Hi Rukshan,

AFAIR, the type should be "jar", type "car" resulted in some errors.

Regards,
Aruna

>
> Thanks and Regards.
>
> On Tue, Nov 24, 2015 at 2:21 PM, Lakshman Udayakantha 
> wrote:
>
>> For some time ago I used [1] to upload a capp written by aruna. You can
>> use that.
>>
>> [1] https://github.com/arunasujith/capp-upload-admin-service-sample
>>
>> Thanks
>>
>> On Tue, Nov 24, 2015 at 2:17 PM, Lakshman Udayakantha > > wrote:
>>
>>> what is the error?
>>>
>>> On Tue, Nov 24, 2015 at 2:11 PM, Rukshan Premathunga 
>>> wrote:
>>>
 Hi,

 I was trying to deploy carbon-app (.car file) using java client. For
 that i used the *CarbonAppUploader *service.

 Below the code i used to deploy the capp and it is worked fine.


 File file = new File(cAppPath);


 //get the byte array of file

 byte[] byteArray = FileUtils.readFileToByteArray(file);

 DataHandler dataHandler = new DataHandler(byteArray,

 APIUsageStatisticsClientConstants.APPLICATION_OCTET_STREAM);


 //create the stub to deploy artifacts

 CarbonAppUploaderStub stub = new CarbonAppUploaderStub(url +
 "/services/CarbonAppUploader");

 ServiceClient client = stub._getServiceClient();

 Options options = client.getOptions();

 //set the security

 HttpTransportProperties.Authenticator authenticator = new
 HttpTransportProperties.Authenticator();

 authenticator.setUsername(user);

 authenticator.setPassword(pass);

 authenticator.setPreemptiveAuthentication(true);

 options.setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
 authenticator);

 client.setOptions(options);

 log.info("Deploying DAS cApp '" + cAppName + "'...");


 //create UploadedFileItem array and 1st element contain the deploy
 artifact

 UploadedFileItem[] fileItem = new UploadedFileItem[1];

 fileItem[0] = new UploadedFileItem();

 fileItem[0].setDataHandler(dataHandler);

 fileItem[0].setFileName(cAppName);

 *fileItem[0].setFileType("jar");*


 //upload the artifacts

 stub.uploadApp(fileItem);


 But for the capp file type i always have to set "jar". I tried with the
 "car" but gave me an error.
 So do we have any other correct way to deploy Capp. Or is this behavior
 is a bug?

 Thanks and Regards.

 Rukshan Chathuranga.
 Software Engineer.
 WSO2, Inc.

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


>>>
>>>
>>> --
>>> Lakshman Udayakantha
>>> WSO2 Inc. www.wso2.com
>>> lean.enterprise.middleware
>>> Mobile: *0714388124*
>>>
>>>
>>
>>
>> --
>> Lakshman Udayakantha
>> WSO2 Inc. www.wso2.com
>> lean.enterprise.middleware
>> Mobile: *0714388124*
>>
>>
>
>
> --
> Rukshan Chathuranga.
> Software Engineer.
> WSO2, Inc.
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

*Aruna Sujith Karunarathna *| Software Engineer
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 71 9040362 | Work: +94 112145345
Email: ar...@wso2.com | Web: www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [ESB][Connector] Redmine Connector - Adding getVersion Operation

2015-11-24 Thread Shakila Sivagnanarajah
Merged

On Wed, Nov 18, 2015 at 3:36 PM, Lakmini Chathurika 
wrote:

> Hi Shakila,
>
> Resolved the commented mistakes.
>
> Thanks
>
>
> On Wed, Nov 18, 2015 at 1:38 PM, Shakila Sivagnanarajah 
> wrote:
>
>> Hi Lakmini,
>>
>> I added some comments. Please go through and resolve.
>>
>> Thanks
>>
>> On Wed, Nov 18, 2015 at 1:16 PM, Lakmini Chathurika 
>> wrote:
>>
>>> Hi,
>>>
>>>  I want to get list of the versions available for the project of given
>>> id or identifier (:project_id). The response may include shared versions
>>> from other projects. Current connector does not support this requirement. I
>>> have created the JIRA[1] and add the PR[2]. Could you please review and
>>> merge this.
>>>
>>> [1]https://wso2.org/jira/browse/ESBCONNECT-72
>>> [2]https://github.com/wso2/esb-connectors/pull/417
>>>
>>> Thanks & Regards,
>>> Lakmini.
>>>
>>
>>
>>
>> --
>> Shakila Sivagnanarajah
>> Associate Software Engineer
>> Mobile :+94 (0) 770 760240
>> shak...@wso2.com
>>
>
>


-- 
Shakila Sivagnanarajah
Associate Software Engineer
Mobile :+94 (0) 770 760240
shak...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] is there any issue in adding classloder to connector

2015-11-24 Thread Rajjaz Mohammed
Hi All,
while I’m testing alternative way to solve above issue without using java
reflection and without add dependency Lib inside connector I’m getting
below error[1] for first request then for following requests[2] . how can i
solve this issue?


[1]
[2015-11-24 12:40:03,712] DEBUG - wire >> "GET /services/EJBTestConnector
HTTP/1.1[\r][\n]"
[2015-11-24 12:40:03,712] DEBUG - wire >> "Host:
rajjaz-thinkpad-t540p:8280[\r][\n]"
[2015-11-24 12:40:03,712] DEBUG - wire >> "User-Agent: Mozilla/5.0 (X11;
Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0[\r][\n]"
[2015-11-24 12:40:03,712] DEBUG - wire >> "Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[\r][\n]"
[2015-11-24 12:40:03,712] DEBUG - wire >> "Accept-Language: null[\r][\n]"
[2015-11-24 12:40:03,713] DEBUG - wire >> "Accept-Encoding: gzip,
deflate[\r][\n]"
[2015-11-24 12:40:03,713] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
[2015-11-24 12:40:03,713] DEBUG - wire >> "[\r][\n]"
[2015-11-24 12:40:03,757]  INFO - EJBConnector Initializing EJBConnector
[2015-11-24 12:40:03,757]  INFO - EJBConnector Initializing EJBConnector
InitialContext
[2015-11-24 12:40:05,449] ERROR - NativeWorkerPool Uncaught exception
java.lang.ExceptionInInitializerError
at
com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getNameService(SerialContext.java:1244)
at
com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:410)
at
com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:346)
at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:504)
at
com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at
org.wso2.carbon.custom.connector.EJBConnector.callEJB(EJBConnector.java:65)
at
org.wso2.carbon.custom.connector.EJBConnector.connect(EJBConnector.java:45)
at
org.wso2.carbon.connector.core.AbstractConnector.mediate(AbstractConnector.java:32)
at
org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:78)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at
org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:97)
at
org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:129)
at
org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:78)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
at
org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
at
org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
at
org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:185)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at
org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:317)
at
org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:149)
at
org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
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)
Caused by: java.lang.ClassCastException:
com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject cannot be cast to
javax.rmi.CORBA.PortableRemoteObjectDelegate
at javax.rmi.PortableRemoteObject.(PortableRemoteObject.java:74)
... 27 more
Saving framework data ...
Saving bundle data ...
Saving resolver state data ...


[2]
 [2015-11-24 12:41:15,746] DEBUG - wire >> "GET /services/EJBTestConnector
HTTP/1.1[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "Host:
rajjaz-thinkpad-t540p:8280[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "User-Agent: Mozilla/5.0 (X11;
Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "Accept-Language: null[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "Accept-Encoding: gzip,
deflate[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
[2015-11-24 12:41:15,747] DEBUG - wire >> "[\r][\n]"
[2015-11-24 12:41:15,750]  INFO - EJBConnector Initializing EJBConnector
[2015-11-24 12:41:15,751]  INFO - EJBConnector Initializing EJBConnector
InitialContext
[2015-11-24 12:41:15,769] ERROR - NativeWorkerPool Uncaught exception
java.lang.NoClassDefFoundError: Could not initialize class

Re: [Dev] Fwd: MB Performance Test Graph Generator(MB Intern Project)

2015-11-24 Thread Ramith Jayasinghe
Shall we commit this (as per the chat) to some common place (git)

On Mon, Nov 23, 2015 at 10:48 PM, Malaka Gangananda 
wrote:

>
> -- Forwarded message --
> From: Malaka Gangananda 
> Date: Mon, Nov 23, 2015 at 10:03 AM
> Subject: MB Performance Test Graph Generator(MB Intern Project)
> To: Akalanka Pagoda Arachchi , Anuja Herath <
> an...@wso2.com>, Asanka Abeyweera , Asitha Nanayakkara
> , Hasitha Amal De Silva , Hasitha
> Hiranya , Hemika Kodikara , Indika
> Sampath , Pamod Sylvester , Pumudu
> Ruhunage , Ramith Jayasinghe , Sajini
> De Silva , Sasikala Kottegoda ,
> Thilanka Bowala 
>
>
> Hi,
> I have attached the project folder related to $Subject with this mail.
> Also here is the link to the git hub repository of the project
> https://github.com/malakaganga/MB_GraphGen
> This project can be used to visualize the performance test result
> generated by the JMeter using graphs
> Thanks,
> --
> Malaka Ganganand
> Software Engineer Intern
> mobile:0713564340
> mala...@wso2.com
> 
>
>
>
> --
> Malaka Gangananda
> Software Engineer Intern
> mobile:0713564340
> mala...@wso2.com
> 
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Ramith Jayasinghe
Technical Lead
WSO2 Inc., http://wso2.com
lean.enterprise.middleware

E: ram...@wso2.com
P: +94 777542851
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ApplicationDAOImpl trying to query UM_PERMISSION tables against the Identity DB

2015-11-24 Thread Lakmali Baminiwatta
Created a Jira.

[1] https://wso2.org/jira/browse/IDENTITY-4128

On 23 November 2015 at 16:35, Nuwan Dias  wrote:

> Looks like a bug to me. This would require the Identity and UM tables to
> be on a single schema, which would be wrong.
>
> Thanks,
> NuwanD.
>
> On Mon, Nov 23, 2015 at 4:28 PM, Lakmali Baminiwatta 
> wrote:
>
>> Hi all,
>>
>> In APIM 1.10.0, when we try to rename an Application, below error is
>> thrown. When I checked the code, there are queries to UM_PERMISSION table
>> against the Identity DB [1]. Shouldn't we use existing UM APIs or run these
>> against the UM DB?
>>
>> Caused by: org.h2.jdbc.JdbcSQLException: Table "UM_PERMISSION" not found;
>> SQL statement:
>> SELECT UM_ID, UM_RESOURCE_ID FROM UM_PERMISSION WHERE UM_RESOURCE_ID LIKE
>> ? [42102-140]
>> at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
>> at org.h2.message.DbException.get(DbException.java:167)
>> at org.h2.message.DbException.get(DbException.java:144)
>> at org.h2.command.Parser.readTableOrView(Parser.java:4498)
>> at org.h2.command.Parser.readTableFilter(Parser.java:1011)
>> at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1577)
>> at org.h2.command.Parser.parseSelectSimple(Parser.java:1682)
>> at org.h2.command.Parser.parseSelectSub(Parser.java:1571)
>> at org.h2.command.Parser.parseSelectUnion(Parser.java:1416)
>> at org.h2.command.Parser.parseSelect(Parser.java:1404)
>> at org.h2.command.Parser.parsePrepared(Parser.java:392)
>> at org.h2.command.Parser.parse(Parser.java:275)
>> at org.h2.command.Parser.parse(Parser.java:247)
>> at org.h2.command.Parser.prepare(Parser.java:201)
>> at org.h2.command.Parser.prepareCommand(Parser.java:214)
>> at org.h2.engine.Session.prepareLocal(Session.java:434)
>> at org.h2.engine.Session.prepareCommand(Session.java:384)
>> at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1071)
>> at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:71)
>> at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:234)
>> at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> at java.lang.reflect.Method.invoke(Method.java:606)
>> at
>> org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
>> at
>> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
>> at
>> org.wso2.carbon.ndatasource.rdbms.ConnectionRollbackOnReturnInterceptor.invoke(ConnectionRollbackOnReturnInterceptor.java:51)
>> at
>> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
>> at
>> org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:67)
>> at
>> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
>> at
>> org.apache.tomcat.jdbc.pool.interceptor.ConnectionState.invoke(ConnectionState.java:153)
>> at
>> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
>> at org.apache.tomcat.jdbc.pool.TrapException.invoke(TrapException.java:41)
>> at
>> org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
>> at
>> org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:80)
>> at com.sun.proxy.$Proxy13.prepareStatement(Unknown Source)
>> at
>> org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.readApplicationPermissions(ApplicationDAOImpl.java:2752)
>> at
>> org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.updateBasicApplicationData(ApplicationDAOImpl.java:442)
>> at
>> org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.updateApplication(ApplicationDAOImpl.java:337)
>>
>> [1]
>> https://github.com/wso2/carbon-identity/blob/master/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java
>>
>> Thanks,
>> Lakmali
>>
>> --
>> Lakmali Baminiwatta
>> Senior Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean.enterprise.middleware
>> mobile:  +94 71 2335936
>> blog : lakmali.com
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Nuwan Dias
>
> Technical Lead - WSO2, Inc. http://wso2.com
> email : nuw...@wso2.com
> Phone : +94 777 775 729
>



-- 
Lakmali Baminiwatta
Senior Software Engineer
WSO2, Inc.: http://wso2.com
lean.enterprise.middleware
mobile:  +94 71 2335936
blog : lakmali.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] wso2esb 4.8.1 and 4.9.0 different behaviour onError

2015-11-24 Thread Madhuranga Bandara
Hi Nariman,

I have tested the scenario according to your specification.
In the error sequence SOAP body is not present in ESB 4.9.0.
This is a bug in ESB 4.9.0. We will raise a public Jira for this and fix it
in the next release.


Thanks,
Madhuranga.


*Madhuranga Sampath Bandara*
Software Engineer

WSO2, Inc.;http://wso2.com/

lean.enterprise.middleware
Mobile: +94722241065

On Mon, Nov 23, 2015 at 4:44 PM, Nariman Abdullayev (TD) <
itana...@azercell.com> wrote:

> Hello,
>
> Could someone help me with this issue? I cannot understand why SOAP
> message is lost after an http exception
>
> Thank in advance,
>
> Nariman.
>
>
> On 11/17/2015 09:05 AM, Nariman Abdullayev (TD) wrote:
>
> Hi Madhuranga,
>
> Thank you for the sample. There is actually full envelope body in your
> example. Using your sample I was able to understand what cause an empty
> envelope in onError sequence.
>
> if you add just two additional parameters to the endpoint:
>
> 
> 5000
> fault
>  
>
> So that endpoint timeout becomes 5 seconds and after timeout an error must
> be thrown (otherwise error sequence is not called)
>
> and point an endpoint to some url which is actually reply after more than
> 5 seconds...
> For example, I achieve timeout using this simple php script:
>
>  ob_start();
> sleep(40);
> header("Content-type:  text/xml;charset=ISO-8859-1");
> echo 'XXX';
> ob_end_flush();
> ?>
>
> In this case, when timeout occurs, I get empty envelope...
>
> log file sample, with configured timeout:
>
> [2015-11-16 22:15:10,982]  INFO - LogMediator To:
> /services/InOnlyProxy.InOnlyProxyHttpSoap12Endpoint, MessageID:
> urn:uuid:90c7f86d-d11a-4b13-a058-82c9900fefc4, Direction: request,
>  retry_count = null, Envelope:  encoding='utf-8'?> 
> "http://schemas.xmlsoap.org/soap/envelope/;
> 
> >
> [2015-11-16 22:15:10,987]  WARN - TimeoutHandler Expiring message ID :
> urn:uuid:8358adc3-08e7-425b-ab62-3419a477439a; dropping message after
> timeout of : 5 seconds
> [2015-11-16 22:15:25,978]  INFO - LogMediator To:
> /services/InOnlyProxy.InOnlyProxyHttpSoap12Endpoint, MessageID:
> urn:uuid:01b3c6df-ed0d-4ab5-82fd-5630fb24a115, Direction: request,
>  retry_count = 1, Envelope:  encoding='utf-8'?> 
> "http://schemas.xmlsoap.org/soap/envelope/;
> 
> >
> [2015-11-16 22:15:25,980]  WARN - TimeoutHandler Expiring message ID :
> urn:uuid:caacc0ec-5750-4580-9eb6-27be7b593be2; dropping message after
> timeout of : 5 seconds
> [2015-11-16 22:15:37,416]  WARN - SynapseCallbackReceiver Synapse received
> a response for the request with message Id :
> urn:uuid:8358adc3-08e7-425b-ab62-3419a477439a But a callback
>  is not registered (anymore) to process this response
> [2015-11-16 22:15:40,978]  INFO - LogMediator To:
> /services/InOnlyProxy.InOnlyProxyHttpSoap12Endpoint, MessageID:
> urn:uuid:9561bc27-15aa-4523-bf26-404761983f11, Direction: request,
>  retry_count = 2.0, Envelope:  encoding='utf-8'?> 
> "http://schemas.xmlsoap.org/soap/envelope/;
> 
> >
> [2015-11-16 22:15:40,979]  WARN - TimeoutHandler Expiring message ID :
> urn:uuid:80fdc5ae-b31f-42c6-9be6-358c93d8bb4a; dropping message after
> timeout of : 5 seconds
>
> If I deploy the same project to 4.8.1 the SOAP body is not lost. However,
> in 4.9.0 SOAP body is not available.. So the question is why there is such
> a difference? is it done on purpose?
>
> for the reference, my endpoint xml:
>  "http://ws.apache.org/ns/synapse;
> >
>   http://localhost/index.php; >
>   
>   5000
>  fault
> 
> 
> -1
> 1.0
> 
> 
> -1
> 
> 
> 
>
>
> Thanks in advance,
>
> Nariman.
>
>
> On 11/15/2015 08:53 AM, Madhuranga Bandara wrote:
>
> Hi Nariman,
>
> I have tried this in a ESB 4.9.0 fresh pack. Given below is my ESB
> configuration. I could access the SOAP envelop from
> "SimpleSQFault" onError sequence.
>
> 
> http://ws.apache.org/ns/synapse;>
> 
> 15000
> 
>  provider="org.wso2.carbon.mediation.ntask.NTaskTaskManager"/>
>  transports="https http">
> 
> 
>  value="SimpleStockQuoteService"/>
> 
> 
> 
> 
> 
> 
> 
> 
> http://127.0.0.1:9000/services/SimpleStockQuoteService;>
> 
> -1
> 1.0
> 
> 
> -1
> 
> 
> 
> 
> 
>  name="retry_count"
>   

Re: [Dev] [ESB][Connector] Redmine Connector - Adding getVersion Operation

2015-11-24 Thread Malaka Silva
Shakila we may need to upload the latest to the store.

On Tue, Nov 24, 2015 at 4:27 PM, Shakila Sivagnanarajah 
wrote:

> Merged
>
> On Wed, Nov 18, 2015 at 3:36 PM, Lakmini Chathurika 
> wrote:
>
>> Hi Shakila,
>>
>> Resolved the commented mistakes.
>>
>> Thanks
>>
>>
>> On Wed, Nov 18, 2015 at 1:38 PM, Shakila Sivagnanarajah > > wrote:
>>
>>> Hi Lakmini,
>>>
>>> I added some comments. Please go through and resolve.
>>>
>>> Thanks
>>>
>>> On Wed, Nov 18, 2015 at 1:16 PM, Lakmini Chathurika 
>>> wrote:
>>>
 Hi,

  I want to get list of the versions available for the project of given
 id or identifier (:project_id). The response may include shared versions
 from other projects. Current connector does not support this requirement. I
 have created the JIRA[1] and add the PR[2]. Could you please review and
 merge this.

 [1]https://wso2.org/jira/browse/ESBCONNECT-72
 [2]https://github.com/wso2/esb-connectors/pull/417

 Thanks & Regards,
 Lakmini.

>>>
>>>
>>>
>>> --
>>> Shakila Sivagnanarajah
>>> Associate Software Engineer
>>> Mobile :+94 (0) 770 760240
>>> shak...@wso2.com
>>>
>>
>>
>
>
> --
> Shakila Sivagnanarajah
> Associate Software Engineer
> Mobile :+94 (0) 770 760240
> shak...@wso2.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/

https://store.wso2.com/store/

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


Re: [Dev] [IS] How can we retrieve the Service Provider when the Role created for SP is accidentally deleted?

2015-11-24 Thread Darshana Gunawardana
Creating application roles are possible with service level.

There is a mismatch for application roles where we
* allow to delete these but
* not allow to create ones
from the management console.

To remove this gap, we decided to give the option of creating application
roles from the management console. Please create a jira on above issue and
we'll fix it as mentioned here.

Thanks,

On Mon, Nov 23, 2015 at 6:58 PM, Nadeesha Meegoda 
wrote:

> Hi IS team,
>
> I created a Service Provider and automatically
> *Application/Service_Provider_Name* Role was created. This Role is used
> to give permission for users to edit and view the SP. Deleting this Role
> will also delete the Service Provider created. If this Role was deleted
> accidentally,  how am I going to recover the Service Provider since I
> cannot add  the same Role name with domain "Application"?
>
> When creating the SP with the same name it gives error creating the
> application since the Service Provider is in registry but not shown in UI
> due to the deletion of the Application Role.
>
> Any feedback regarding this is highly appreciated!
>
>
> Thanks
> --
> *Nadeesha Meegoda*
> Software Engineer - QA
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
> email : nadees...@wso2.com
> mobile: +94783639540
> <%2B94%2077%202273555>
>



-- 
Regards,


*Darshana Gunawardana*Senior Software Engineer
WSO2 Inc.; http://wso2.com

*E-mail: darsh...@wso2.com *
*Mobile: +94718566859*Lean . Enterprise . Middleware
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] How can we retrieve the Service Provider when the Role created for SP is accidentally deleted?

2015-11-24 Thread Nadeesha Meegoda
Thanks Darshana for the response. Please find the jira created in [1]

[1] - https://wso2.org/jira/browse/IDENTITY-4130

On Tue, Nov 24, 2015 at 5:25 PM, Darshana Gunawardana 
wrote:

> Creating application roles are possible with service level.
>
> There is a mismatch for application roles where we
> * allow to delete these but
> * not allow to create ones
> from the management console.
>
> To remove this gap, we decided to give the option of creating application
> roles from the management console. Please create a jira on above issue and
> we'll fix it as mentioned here.
>
> Thanks,
>
> On Mon, Nov 23, 2015 at 6:58 PM, Nadeesha Meegoda 
> wrote:
>
>> Hi IS team,
>>
>> I created a Service Provider and automatically
>> *Application/Service_Provider_Name* Role was created. This Role is used
>> to give permission for users to edit and view the SP. Deleting this Role
>> will also delete the Service Provider created. If this Role was deleted
>> accidentally,  how am I going to recover the Service Provider since I
>> cannot add  the same Role name with domain "Application"?
>>
>> When creating the SP with the same name it gives error creating the
>> application since the Service Provider is in registry but not shown in UI
>> due to the deletion of the Application Role.
>>
>> Any feedback regarding this is highly appreciated!
>>
>>
>> Thanks
>> --
>> *Nadeesha Meegoda*
>> Software Engineer - QA
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>> email : nadees...@wso2.com
>> mobile: +94783639540
>> <%2B94%2077%202273555>
>>
>
>
>
> --
> Regards,
>
>
> *Darshana Gunawardana*Senior Software Engineer
> WSO2 Inc.; http://wso2.com
>
> *E-mail: darsh...@wso2.com *
> *Mobile: +94718566859 <%2B94718566859>*Lean . Enterprise . Middleware
>



-- 
*Nadeesha Meegoda*
Software Engineer - QA
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware
email : nadees...@wso2.com
mobile: +94783639540
<%2B94%2077%202273555>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] APIM REST API with Subscription Creation Workflows

2015-11-24 Thread Nuwan Dias
On Tue, Nov 24, 2015 at 6:25 PM, Malintha Amarasinghe 
wrote:

> Hi All,
>
> I configured the subscription creation workflow and tested it with the
> current implementation of the REST API.
>
> When we add a subscription in normal scenario we get the following
> response.
>
> *Request*:
>
> POST http://127.0.0.1:9764/api/am/store/v1//subscriptions HTTP/1.1
>
> {
>   "tier": "Silver",
>   "apiId": "2f4a020b-2a0d-4a47-b385-a22a93577082",
>   "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
> }
>
>
> *Response:*
>
> HTTP/1.1 *201* Created
>
> Location: http://127.0.0.1:9764/api/am/store/v1/subscriptions/
> 63ab53d3-0cb7-46df-8ce9-cd84f2882b27
> Content-Type: application/json
>
>
> {
>   "tier": "Silver",
>   "subscriptionId": "63ab53d3-0cb7-46df-8ce9-cd84f2882b27",
>   "apiId": "2f4a020b-2a0d-4a47-b385-a22a93577082",
>   "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
>   *"status": "UNBLOCKED"*
> }
>
>
> When we have a subscription creation workflow enabled, we receive a
> response like follow.
>
> HTTP/1.1 *201* Created
>
> Location: http://127.0.0.1:9764/api/am/store/v1/subscriptions/
> def79733-e55e-464f-9630-c1ae595344f2
> Content-Type: application/json
>
> {
>"subscriptionId": "def79733-e55e-464f-9630-c1ae595344f2",
>"apiId": "admin-pubApi-1.0",
>"tier": "Silver",
>"applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
>*"status": "ON_HOLD"*
> }
>
>
> Here we can see that the status is ON_HOLD. In this case we can also see
> some more information that are coming from APIM underline implementation,
> which are follows:
>
>- redirectUrl : "http://google.lk;
>- displayUrl : "http://wso2.com;
>- workflowRefId : "0b94b11a-2736-48a0-b43e-c7cc35d8516d"
>- CallbackUrl : http://google.lk
>
>
> Do we need to include this info in the response object? If so what would
> be the best approach?
>

What if we add this info to the response payload under a section called
something like "workflowInformation" ?

>
> Few ways that are possible include:
>
>- Add those additional information into the response object
>- Add this redirect URL as HTTP 302 redirection as the Location header
>
> Please share your thoughts.
>
> Thank you,
> Malintha
>
> --
> Malintha Amarasinghe
> Software Engineer
> *WSO2, Inc. - lean | enterprise | middleware*
> http://wso2.com/
>
> Mobile : +94 712383306
>



-- 
Nuwan Dias

Technical Lead - WSO2, Inc. http://wso2.com
email : nuw...@wso2.com
Phone : +94 777 775 729
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] is there any issue in adding classloder to connector

2015-11-24 Thread Malaka Silva
Seems like a jar version mismatch. Better verify if we are using client
jars of the same server version?

Check [1] May be it'll help

[1]
http://www.coderanch.com/t/454071/java-EJB-SCBCD/certification/javax-naming-Reference-cast-org

On Tue, Nov 24, 2015 at 4:19 PM, Rajjaz Mohammed  wrote:

> Hi All,
> while I’m testing alternative way to solve above issue without using java
> reflection and without add dependency Lib inside connector I’m getting
> below error[1] for first request then for following requests[2] . how can i
> solve this issue?
>
>
> [1]
> [2015-11-24 12:40:03,712] DEBUG - wire >> "GET /services/EJBTestConnector
> HTTP/1.1[\r][\n]"
> [2015-11-24 12:40:03,712] DEBUG - wire >> "Host:
> rajjaz-thinkpad-t540p:8280[\r][\n]"
> [2015-11-24 12:40:03,712] DEBUG - wire >> "User-Agent: Mozilla/5.0 (X11;
> Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0[\r][\n]"
> [2015-11-24 12:40:03,712] DEBUG - wire >> "Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[\r][\n]"
> [2015-11-24 12:40:03,712] DEBUG - wire >> "Accept-Language: null[\r][\n]"
> [2015-11-24 12:40:03,713] DEBUG - wire >> "Accept-Encoding: gzip,
> deflate[\r][\n]"
> [2015-11-24 12:40:03,713] DEBUG - wire >> "Connection: keep-alive[\r][\n]"
> [2015-11-24 12:40:03,713] DEBUG - wire >> "[\r][\n]"
> [2015-11-24 12:40:03,757]  INFO - EJBConnector Initializing EJBConnector
> [2015-11-24 12:40:03,757]  INFO - EJBConnector Initializing EJBConnector
> InitialContext
> [2015-11-24 12:40:05,449] ERROR - NativeWorkerPool Uncaught exception
> java.lang.ExceptionInInitializerError
> at
> com.sun.enterprise.naming.impl.SerialContext$ProviderCacheKey.getNameService(SerialContext.java:1244)
> at
> com.sun.enterprise.naming.impl.SerialContext.getRemoteProvider(SerialContext.java:410)
> at
> com.sun.enterprise.naming.impl.SerialContext.getProvider(SerialContext.java:346)
> at
> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:504)
> at
> com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)
> at javax.naming.InitialContext.lookup(InitialContext.java:411)
> at javax.naming.InitialContext.lookup(InitialContext.java:411)
> at
> org.wso2.carbon.custom.connector.EJBConnector.callEJB(EJBConnector.java:65)
> at
> org.wso2.carbon.custom.connector.EJBConnector.connect(EJBConnector.java:45)
> at
> org.wso2.carbon.connector.core.AbstractConnector.mediate(AbstractConnector.java:32)
> at
> org.apache.synapse.mediators.ext.ClassMediator.mediate(ClassMediator.java:78)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
> at
> org.apache.synapse.mediators.template.TemplateMediator.mediate(TemplateMediator.java:97)
> at
> org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:129)
> at
> org.apache.synapse.mediators.template.InvokeMediator.mediate(InvokeMediator.java:78)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:81)
> at
> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:48)
> at
> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:149)
> at
> org.apache.synapse.core.axis2.ProxyServiceMessageReceiver.receive(ProxyServiceMessageReceiver.java:185)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
> at
> org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:317)
> at
> org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:149)
> at
> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
> 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)
> Caused by: java.lang.ClassCastException:
> com.sun.corba.ee.impl.javax.rmi.PortableRemoteObject cannot be cast to
> javax.rmi.CORBA.PortableRemoteObjectDelegate
> at
> javax.rmi.PortableRemoteObject.(PortableRemoteObject.java:74)
> ... 27 more
> Saving framework data ...
> Saving bundle data ...
> Saving resolver state data ...
>
>
> [2]
>  [2015-11-24 12:41:15,746] DEBUG - wire >> "GET /services/EJBTestConnector
> HTTP/1.1[\r][\n]"
> [2015-11-24 12:41:15,747] DEBUG - wire >> "Host:
> rajjaz-thinkpad-t540p:8280[\r][\n]"
> [2015-11-24 12:41:15,747] DEBUG - wire >> "User-Agent: Mozilla/5.0 (X11;
> Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0[\r][\n]"
> [2015-11-24 12:41:15,747] DEBUG - wire >> "Accept:
> text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8[\r][\n]"
> [2015-11-24 12:41:15,747] DEBUG - wire >> "Accept-Language: null[\r][\n]"
> [2015-11-24 

[Dev] APIM REST API with Subscription Creation Workflows

2015-11-24 Thread Malintha Amarasinghe
Hi All,

I configured the subscription creation workflow and tested it with the
current implementation of the REST API.

When we add a subscription in normal scenario we get the following response.

*Request*:

POST http://127.0.0.1:9764/api/am/store/v1//subscriptions HTTP/1.1

{
  "tier": "Silver",
  "apiId": "2f4a020b-2a0d-4a47-b385-a22a93577082",
  "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
}


*Response:*

HTTP/1.1 *201* Created

Location: http://127.0.0.1:9764/api/am/store/v1/subscriptions/
63ab53d3-0cb7-46df-8ce9-cd84f2882b27
Content-Type: application/json


{
  "tier": "Silver",
  "subscriptionId": "63ab53d3-0cb7-46df-8ce9-cd84f2882b27",
  "apiId": "2f4a020b-2a0d-4a47-b385-a22a93577082",
  "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
  *"status": "UNBLOCKED"*
}


When we have a subscription creation workflow enabled, we receive a
response like follow.

HTTP/1.1 *201* Created

Location: http://127.0.0.1:9764/api/am/store/v1/subscriptions/
def79733-e55e-464f-9630-c1ae595344f2
Content-Type: application/json

{
   "subscriptionId": "def79733-e55e-464f-9630-c1ae595344f2",
   "apiId": "admin-pubApi-1.0",
   "tier": "Silver",
   "applicationId": "69041195-1e81-48f5-8892-2ab053b0501c",
   *"status": "ON_HOLD"*
}


Here we can see that the status is ON_HOLD. In this case we can also see
some more information that are coming from APIM underline implementation,
which are follows:

   - redirectUrl : "http://google.lk;
   - displayUrl : "http://wso2.com;
   - workflowRefId : "0b94b11a-2736-48a0-b43e-c7cc35d8516d"
   - CallbackUrl : http://google.lk


Do we need to include this info in the response object? If so what would be
the best approach?

Few ways that are possible include:

   - Add those additional information into the response object
   - Add this redirect URL as HTTP 302 redirection as the Location header

Please share your thoughts.

Thank you,
Malintha

-- 
Malintha Amarasinghe
Software Engineer
*WSO2, Inc. - lean | enterprise | middleware*
http://wso2.com/

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