[Dev] Fwd: Pull request to include tenant deletion support

2015-01-08 Thread Lakshman Udayakantha
[fowarding to dev]

Since new method introduced in *TenantMgtListener *interface, There may be
build failures after committing this. how should we proceed with that?


Hi Carbon team,

Please review and merge the pull requests [1] and [2] that is include the
changes in tenant deletion support.

[1] https://github.com/wso2-dev/carbon4-kernel/pull/134
[2] https://github.com/wso2-dev/carbon-multitenancy/pull/15

Thanks
-- 
Lakshman Udayakantha
WSO2 Inc. www.wso2.com
lean.enterprise.middleware
Mobile: *0711241005*




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


Re: [Dev] Build failures observed in Carbon-Utils

2015-01-08 Thread Rajith Vitharana
Hi,

Faced with the same issue. Seems "org.wso2.carbon.wsdl.tools.ui.feature"
dependency version needs to be updated to either released 4.3.0 version or
snapshot versions should be kept in the maven repo.

Thanks,

On Fri, Jan 9, 2015 at 10:22 AM, Prabath Abeysekera 
wrote:

> Folks,
>
> Carbon-Utils build fails due to not having proper versions configured upon
> "org.wso2.carbon.ui.menu.tools" in dependent modules. Please note that the
> modules "org.wso2.carbon.reporting.ui.feature",
> "org.wso2.carbon.tryit.ui.feature" and
> "org.wso2.carbon.wsdl.tools.ui.feature", all fails indicating the same
> problem. Please refer the following log for details.
>
> [INFO] WSO2 Carbon - SOAP Tracer Core Feature  SKIPPED
>
> [INFO] WSO2 Carbon - SOAP Tracer UI Feature .. SKIPPED
>
> [INFO] WSO2 Carbon - SOAP Tracer Feature . SKIPPED
>
> [INFO] WSO2 Carbon - Message Flows Feature Aggregator Module  SKIPPED
>
> [INFO] WSO2 Carbon - Message Flows Core Feature .. SKIPPED
>
> [INFO] WSO2 Carbon - Message Flows UI Feature  SKIPPED
>
> [INFO] WSO2 Carbon - Message Flows Feature ... SKIPPED
>
> [INFO]
> 
>
> [INFO] BUILD FAILURE
>
> [INFO]
> 
>
> [INFO] Total time: 2:29.337s
>
> [INFO] Finished at: Fri Jan 09 09:54:58 IST 2015
>
> [INFO] Final Memory: 87M/2485M
>
> [INFO]
> 
>
> [ERROR] Failed to execute goal
> org.wso2.maven:carbon-p2-plugin:1.5.3:p2-feature-gen
> (4-p2-feature-generation) on project org.wso2.carbon.reporting.ui.feature:
> ERROR: Could not find artifact
> org.wso2.carbon:org.wso2.carbon.ui.menu.tools:jar:4.3.0-SNAPSHOT in
> wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/)
>
> [ERROR]
>
> [ERROR] Try downloading the file manually from the project website.
>
> [ERROR]
>
> [ERROR] Then, install it using the command:
>
> [ERROR] mvn install:install-file -DgroupId=org.wso2.carbon
> -DartifactId=org.wso2.carbon.ui.menu.tools -Dversion=4.3.0-SNAPSHOT
> -Dpackaging=jar -Dfile=/path/to/file
>
> [ERROR]
>
> [ERROR] Alternatively, if you host your own repository you can deploy the
> file there:
>
> [ERROR] mvn deploy:deploy-file -DgroupId=org.wso2.carbon
> -DartifactId=org.wso2.carbon.ui.menu.tools -Dversion=4.3.0-SNAPSHOT
> -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
>
> [ERROR]
>
> [ERROR]
>
> [ERROR] org.wso2.carbon:org.wso2.carbon.ui.menu.tools:jar:4.3.0-SNAPSHOT
>
> [ERROR]
>
> [ERROR] from the specified remote repositories:
>
> [ERROR] wso2-nexus (
> http://maven.wso2.org/nexus/content/groups/wso2-public/, releases=true,
> snapshots=true),
>
> [ERROR] wso2.releases (
> http://maven.wso2.org/nexus/content/repositories/releases/,
> releases=true, snapshots=true),
>
> [ERROR] wso2.snapshots (
> http://maven.wso2.org/nexus/content/repositories/snapshots/,
> releases=false, snapshots=true),
>
> [ERROR] central (http://repo.maven.apache.org/maven2, releases=true,
> snapshots=false)
>
> [ERROR] -> [Help 1]
>
> [ERROR]
>
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
>
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
>
> [ERROR]
>
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
>
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
>
> [ERROR]
>
> [ERROR] After correcting the problems, you can resume the build with the
> command
>
> [ERROR]   mvn  -rf :org.wso2.carbon.reporting.ui.feature
>
>
> Cheers,
> Prabath
> --
> Prabath Abeysekara
> Associate Technical Lead, Data TG.
> WSO2 Inc.
> Email: praba...@wso2.com
> Mobile: +94774171471
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Rajith Vitharana

Software Engineer,
WSO2 Inc. : wso2.com
Mobile : +94715883223
Blog : http://lankavitharana.blogspot.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Payload mediation of JSON message using Script Mediator

2015-01-08 Thread Keerthika Mahendralingam
Hi Maz,

You can use payload factory mediator to mediate the payload of the message.

I tried as follows. It worked for me:


  
 

 
 

   { "IP_Address": "$1"}
   
  
   


 
  
   

Request:

curl -X POST -d "{\"origin\":\"202.37.75.130\"}" -H "Content-Type:
application/json" http://192.168.0.102:8280/test

Response:

{ "IP_Address": "202.37.75.130"}


Thank you,

On Thu, Jan 8, 2015 at 4:43 PM, Buddhima Wijeweera 
wrote:

> Hi Maz,
>
> There's a problem with the JS script. It should be like follows:
>
>  var older = mc.getPayloadJSON(); var
> newer={"IP_Address":older['origin']}; mc.setPayloadJSON(newer);
>
>
> I tried the following API (with ESB 4.8.1) to make the situation quite
> similar to yours :
>
> 
>   
>  
> 
>
> 
> 
>  
>  
> 
>
> 
> var older = mc.getPayloadJSON();var
> newer={"IP_Address":older['origin']};mc.setPayloadJSON(newer);
> 
>  
>   
>
>
>
> Following image shows the request and the response:
>
>
> ​
>
>
>
> For your reference I would like to point out following link:
> http://www.w3schools.com/js/js_json.asp
>
> Thank You!
>
>
>
> On Thu, Jan 8, 2015 at 12:47 PM, Malaka Silva  wrote:
>
>> Hi Maz,
>>
>> Since you need to generate payload dynamically you can use script
>> mediator for that purpose.
>>
>> On Thu, Jan 8, 2015 at 12:23 AM, Maz Lakadia 
>> wrote:
>>
>>> I will be mapping resources that are in a particular format into another
>>> format. This means I will have a lot of template mappings that I could load
>>> into script mediator and let it use the appropriate one for the task. I am
>>> unsure of how I could do that will payload factory mediator. Do you have
>>> any clues?
>>>
>>> --
>>> Date: Wed, 7 Jan 2015 09:07:13 +0530
>>> Subject: Re: [Dev] Payload mediation of JSON message using Script
>>> Mediator
>>> From: va...@wso2.com
>>> To: awanth...@wso2.com
>>> CC: mlaka...@hotmail.com; dev@wso2.org
>>>
>>>
>>> What is the real motivation you to use script mediator instead of
>>> payload factory?
>>>
>>> You can easly construct jaon payload with payload factory
>>>
>>> On Wednesday, January 7, 2015, Awanthika Senarath 
>>> wrote:
>>>
>>> Hi Maz,
>>>
>>> Can you follow the format at [1] and see whether it works? This explains
>>> the sample 351 in ESB.
>>>
>>> [1]
>>> https://docs.wso2.com/display/ESB480/Sample+351%3A+Inline+script+mediation+with+JavaScript
>>> 
>>>
>>> On Wed, Jan 7, 2015 at 4:03 AM, Maz Lakadia 
>>> wrote:
>>>
>>> Hi, I'm using script mediator to mediate the response payload from my
>>> server. The unmediated response is:
>>>
>>> {"origin":"202.37.75.130"}
>>>
>>> I then add in a mediator via source code, that should change "origin" to
>>> "IP_Address":
>>>
>>> 
>>> >> old_payload = mc.getPayloadJSON();
>>> payload["IP_Address"] = old_payload["origin"];
>>> mc.setPayloadJSON(payload);
>>> ]]>
>>> 
>>> 
>>> >> expression="get-property('CORS_ORIGIN')" scope="transport"/>
>>> >> value="Assertion,X-Jwt-Assertion,X-User-Name,X-User-Domain"
>>> scope="transport"/>
>>> 
>>> 
>>> 
>>> 
>>>
>>> However, my response remains unchanged (same as the unmediated
>>> response). I do not know how I can fix this. Is there an error I am making?
>>>
>>> Thanks,
>>> Maz
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>>
>>>
>>> --
>>> Awanthika Senarath
>>> Software Engineer, WSO2 Inc.
>>> Mobile: +94717681791
>>>
>>>
>>>
>>>
>>> --
>>> Sent from Gmail Mobile
>>>
>>> ___
>>> 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/
>> 
>>
>> 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
>>
>>
>
>
> --
> Buddhima Wijeweera
> Software Engineer; WSO2 Inc.; http://wso2.com ,
>
> Mobile: +94 71 

[Dev] Build failures observed in Carbon-Utils

2015-01-08 Thread Prabath Abeysekera
Folks,

Carbon-Utils build fails due to not having proper versions configured upon
"org.wso2.carbon.ui.menu.tools" in dependent modules. Please note that the
modules "org.wso2.carbon.reporting.ui.feature",
"org.wso2.carbon.tryit.ui.feature" and
"org.wso2.carbon.wsdl.tools.ui.feature", all fails indicating the same
problem. Please refer the following log for details.

[INFO] WSO2 Carbon - SOAP Tracer Core Feature  SKIPPED

[INFO] WSO2 Carbon - SOAP Tracer UI Feature .. SKIPPED

[INFO] WSO2 Carbon - SOAP Tracer Feature . SKIPPED

[INFO] WSO2 Carbon - Message Flows Feature Aggregator Module  SKIPPED

[INFO] WSO2 Carbon - Message Flows Core Feature .. SKIPPED

[INFO] WSO2 Carbon - Message Flows UI Feature  SKIPPED

[INFO] WSO2 Carbon - Message Flows Feature ... SKIPPED

[INFO]


[INFO] BUILD FAILURE

[INFO]


[INFO] Total time: 2:29.337s

[INFO] Finished at: Fri Jan 09 09:54:58 IST 2015

[INFO] Final Memory: 87M/2485M

[INFO]


[ERROR] Failed to execute goal
org.wso2.maven:carbon-p2-plugin:1.5.3:p2-feature-gen
(4-p2-feature-generation) on project org.wso2.carbon.reporting.ui.feature:
ERROR: Could not find artifact
org.wso2.carbon:org.wso2.carbon.ui.menu.tools:jar:4.3.0-SNAPSHOT in
wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/)

[ERROR]

[ERROR] Try downloading the file manually from the project website.

[ERROR]

[ERROR] Then, install it using the command:

[ERROR] mvn install:install-file -DgroupId=org.wso2.carbon
-DartifactId=org.wso2.carbon.ui.menu.tools -Dversion=4.3.0-SNAPSHOT
-Dpackaging=jar -Dfile=/path/to/file

[ERROR]

[ERROR] Alternatively, if you host your own repository you can deploy the
file there:

[ERROR] mvn deploy:deploy-file -DgroupId=org.wso2.carbon
-DartifactId=org.wso2.carbon.ui.menu.tools -Dversion=4.3.0-SNAPSHOT
-Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

[ERROR]

[ERROR]

[ERROR] org.wso2.carbon:org.wso2.carbon.ui.menu.tools:jar:4.3.0-SNAPSHOT

[ERROR]

[ERROR] from the specified remote repositories:

[ERROR] wso2-nexus (http://maven.wso2.org/nexus/content/groups/wso2-public/,
releases=true, snapshots=true),

[ERROR] wso2.releases (
http://maven.wso2.org/nexus/content/repositories/releases/, releases=true,
snapshots=true),

[ERROR] wso2.snapshots (
http://maven.wso2.org/nexus/content/repositories/snapshots/,
releases=false, snapshots=true),

[ERROR] central (http://repo.maven.apache.org/maven2, releases=true,
snapshots=false)

[ERROR] -> [Help 1]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

[ERROR]

[ERROR] For more information about the errors and possible solutions,
please read the following articles:

[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

[ERROR]

[ERROR] After correcting the problems, you can resume the build with the
command

[ERROR]   mvn  -rf :org.wso2.carbon.reporting.ui.feature


Cheers,
Prabath
-- 
Prabath Abeysekara
Associate Technical Lead, Data TG.
WSO2 Inc.
Email: praba...@wso2.com
Mobile: +94774171471
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB / Carbon Mediation Build Stabilization

2015-01-08 Thread Malaka Silva
Related features should be fixed by relevant product teams and may take
some time.

Meanwhile you can just run integration tests with released 490 M4 pack (May
need to patch your changes), rather building it.

On Fri, Jan 9, 2015 at 9:44 AM, Maheeka Jayasuriya  wrote:

> Hi,
>
> I am getting the same error as @Malaka. Any work around? I am writing
> integration tests for mediator.
>
>
> Thanks,
>
> Maheeka Jayasuriya
> Software Engineer
> Mobile : +9450661
>
> On Wed, Jan 7, 2015 at 9:42 PM, Malaka Silva  wrote:
>
>> Hi,
>>
>> I checked the product-esb and it's fixed upto some extend. [1]
>>
>> However getting the following while installing features.
>>
>> ->
>> Installing org.wso2.carbon.service.mgt.server.feature.group
>> 4.3.0.SNAPSHOT.
>> Installation failed.
>> Cannot complete the install because one or more required items could not
>> be found.
>>  Software being installed: WSO2 Carbon - Governance Metadata Server
>> Feature 4.3.0.SNAPSHOT
>> (org.wso2.carbon.governance.metadata.server.feature.group 4.3.0.SNAPSHOT)
>>  Missing requirement: org.wso2.carbon.registry.extensions 4.3.0.SNAPSHOT
>> (org.wso2.carbon.registry.extensions 4.3.0.SNAPSHOT) requires 'package
>> org.wso2.carbon.registry.core [4.3.0,4.4.0)' but it could not be found
>>  Cannot satisfy dependency:
>>   From: org.wso2.carbon.governance.api 4.3.0.SNAPSHOT
>> (org.wso2.carbon.governance.api 4.3.0.SNAPSHOT)
>>   To: package org.wso2.carbon.registry.extensions.handlers.utils 0.0.0
>>  Cannot satisfy dependency:
>>   From: WSO2 Carbon - Governance Metadata Server Feature 4.3.0.SNAPSHOT
>> (org.wso2.carbon.governance.metadata.server.feature.group 4.3.0.SNAPSHOT)
>>   To: org.wso2.carbon.governance.api [4.3.0.SNAPSHOT]
>> -->
>>
>> [1]
>> https://github.com/wso2-dev/product-esb/commit/372a3741179192136741308f7fb3b172b9caa0f8
>>
>> On Wed, Jan 7, 2015 at 1:33 PM, Ishan Jayawardena  wrote:
>>
>>> Hi,
>>> Currently the carbon mediation and product esb builds are unstable due
>>> to a number of dependency version issues (released and snapshot versions).
>>> We are currently fixing them. Will update this thread about the progress.
>>>
>>> Thanks,
>>> Ishan.
>>>
>>> --
>>> Ishan Jayawardena
>>> Senior Software Engineer
>>>
>>> ___
>>> 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/
>> 
>>
>> 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
>>
>>
>


-- 

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/


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] ESB / Carbon Mediation Build Stabilization

2015-01-08 Thread Maheeka Jayasuriya
Hi,

I am getting the same error as @Malaka. Any work around? I am writing
integration tests for mediator.


Thanks,

Maheeka Jayasuriya
Software Engineer
Mobile : +9450661

On Wed, Jan 7, 2015 at 9:42 PM, Malaka Silva  wrote:

> Hi,
>
> I checked the product-esb and it's fixed upto some extend. [1]
>
> However getting the following while installing features.
>
> ->
> Installing org.wso2.carbon.service.mgt.server.feature.group 4.3.0.SNAPSHOT.
> Installation failed.
> Cannot complete the install because one or more required items could not
> be found.
>  Software being installed: WSO2 Carbon - Governance Metadata Server
> Feature 4.3.0.SNAPSHOT
> (org.wso2.carbon.governance.metadata.server.feature.group 4.3.0.SNAPSHOT)
>  Missing requirement: org.wso2.carbon.registry.extensions 4.3.0.SNAPSHOT
> (org.wso2.carbon.registry.extensions 4.3.0.SNAPSHOT) requires 'package
> org.wso2.carbon.registry.core [4.3.0,4.4.0)' but it could not be found
>  Cannot satisfy dependency:
>   From: org.wso2.carbon.governance.api 4.3.0.SNAPSHOT
> (org.wso2.carbon.governance.api 4.3.0.SNAPSHOT)
>   To: package org.wso2.carbon.registry.extensions.handlers.utils 0.0.0
>  Cannot satisfy dependency:
>   From: WSO2 Carbon - Governance Metadata Server Feature 4.3.0.SNAPSHOT
> (org.wso2.carbon.governance.metadata.server.feature.group 4.3.0.SNAPSHOT)
>   To: org.wso2.carbon.governance.api [4.3.0.SNAPSHOT]
> -->
>
> [1]
> https://github.com/wso2-dev/product-esb/commit/372a3741179192136741308f7fb3b172b9caa0f8
>
> On Wed, Jan 7, 2015 at 1:33 PM, Ishan Jayawardena  wrote:
>
>> Hi,
>> Currently the carbon mediation and product esb builds are unstable due to
>> a number of dependency version issues (released and snapshot versions). We
>> are currently fixing them. Will update this thread about the progress.
>>
>> Thanks,
>> Ishan.
>>
>> --
>> Ishan Jayawardena
>> Senior Software Engineer
>>
>> ___
>> 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/
> 
>
> 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
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Dimuthu Leelarathne
Hi,

On Fri, Jan 9, 2015 at 9:32 AM, Danushka Fernando 
wrote:

> What about the possibility of second option I mentioned?
>


It is just one util method we have to change if SS changes the appending
String. How many methods do we change during an SS upgrade? :) I think we
are thinking too much!

thanks,
dimuthu



>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Fri, Jan 9, 2015 at 9:29 AM, Dimuthu Leelarathne 
> wrote:
>
>> Hi all,
>>
>> For the appending string lets take the code from SS and then use runtime
>> DB to verify existence of the name. If we use code from the util method we
>> can just limit the changes to one method.
>>
>> thanks,
>> dimuthu
>>
>> On Fri, Jan 9, 2015 at 8:19 AM, Danushka Fernando 
>> wrote:
>>
>>> @Bhathiya :
>>> Yes, That what we expect to do.
>>>
>>> @Asanka :
>>> I am not sure how anuruddha planned the implementation. But yes that
>>> should be the way to do it since that how we have done it in other places.
>>>
>>> Thanks & Regards
>>> Danushka Fernando
>>> Software Engineer
>>> WSO2 inc. http://wso2.com/
>>> Mobile : +94716332729
>>>
>>> On Fri, Jan 9, 2015 at 8:12 AM, Asanka Dissanayake 
>>> wrote:
>>>
 Hi Danushka,
 Please find my comments inline.

 On Thu, Jan 8, 2015 at 3:56 PM, Danushka Fernando 
 wrote:

> Hi All
>
> @Bhathiya : This is about usability. We cannot let user do something
> and let it fail and then let know the user that you cannot do this. We 
> need
> to inform that to user when he try to do it. That's what we are trying to
> achieve here.
>

 How are you going to verify this. After user clicks Submit ? you gonna
 pass the user name to back end and check whether it is valid. In that case
 trying to add the user and handle the exception has same weight I think. Or
 else if you want to improve the usability what you can do is, get the
 database user names from backned without hashed tenant domain prefix
 during the page loading  and verify it within there . You can write
 validate logic in the "onblur" event of the input field.

 Just my two cents .



> @Anuruddha :
> However there are few notes. In [1] what Dimuthu mentioned is to use
> af runtime database data for this.
>
> When we use that you need to have full name. One way is to use same
> logic used by SS in our code to generate the code in our side as well.
> Downside of this is if SS change this we need to change it in our code as
> well. Or else we can search using some pattern like this in db.
> "_%". However in the latter case the regular 
> expression
> should be carefully selected.
>
> @Dimuthu :
> WDYT?
>
> [1] https://wso2.org/jira/browse/APPFAC-2723
>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara <
> bhath...@wso2.com> wrote:
>
>> Hi Anurudhdha,
>>
>> In this use case, why are you trying to check the user existence? Are
>> you trying to do it before user creation? In that case, you don't have to
>> check it yourself because create user service will do it internally, and
>> throw an exception if the user exists. So your try-catch approach is 
>> fine.
>>
>> Thanks,
>> Bhathiya
>>
>> On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal <
>> anurud...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I'm working on APPFAC-2723 and there is a requirement to check
>>> whether a user is already created in storage server.
>>>
>>> In RssAdminService there is a method to check whether a database
>>> user exists.
>>>
>>> Issue with this method is, there has a hashed tenant domain value
>>> appended to the username once we create  a databaseuser, and it requires
>>> the full name (with the appended value) to check the user existence.
>>>
>>> Isn't it the RSSAdmin service responsibility to append the hashed
>>> value and perform the search?.
>>>
>>> For now I can use a try catch block in the jaggery layer and handle
>>> the duplicate user creation exception.
>>>
>>> AppFactory_Resource_DB has this full user name and perform
>>> isDataBaseuserExist operation. However this method always resurns false
>>> because we haven't passed the appended hashed value with the username.
>>>
>>> Shall we remove this isDataBaseUserExist method from the
>>> ResourceManger and use try catch approach to check the user existence?
>>>
>>> Regards,
>>> --
>>> *Anuruddha Premalal*
>>> Software Eng. | WSO2 Inc.
>>> Mobile : +94710461070
>>> Web site : www.regilandvalley.com
>>>
>>>
>>> ___
>>> Dev mail

Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Danushka Fernando
What about the possibility of second option I mentioned?

Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729

On Fri, Jan 9, 2015 at 9:29 AM, Dimuthu Leelarathne 
wrote:

> Hi all,
>
> For the appending string lets take the code from SS and then use runtime
> DB to verify existence of the name. If we use code from the util method we
> can just limit the changes to one method.
>
> thanks,
> dimuthu
>
> On Fri, Jan 9, 2015 at 8:19 AM, Danushka Fernando 
> wrote:
>
>> @Bhathiya :
>> Yes, That what we expect to do.
>>
>> @Asanka :
>> I am not sure how anuruddha planned the implementation. But yes that
>> should be the way to do it since that how we have done it in other places.
>>
>> Thanks & Regards
>> Danushka Fernando
>> Software Engineer
>> WSO2 inc. http://wso2.com/
>> Mobile : +94716332729
>>
>> On Fri, Jan 9, 2015 at 8:12 AM, Asanka Dissanayake 
>> wrote:
>>
>>> Hi Danushka,
>>> Please find my comments inline.
>>>
>>> On Thu, Jan 8, 2015 at 3:56 PM, Danushka Fernando 
>>> wrote:
>>>
 Hi All

 @Bhathiya : This is about usability. We cannot let user do something
 and let it fail and then let know the user that you cannot do this. We need
 to inform that to user when he try to do it. That's what we are trying to
 achieve here.

>>>
>>> How are you going to verify this. After user clicks Submit ? you gonna
>>> pass the user name to back end and check whether it is valid. In that case
>>> trying to add the user and handle the exception has same weight I think. Or
>>> else if you want to improve the usability what you can do is, get the
>>> database user names from backned without hashed tenant domain prefix
>>> during the page loading  and verify it within there . You can write
>>> validate logic in the "onblur" event of the input field.
>>>
>>> Just my two cents .
>>>
>>>
>>>
 @Anuruddha :
 However there are few notes. In [1] what Dimuthu mentioned is to use af
 runtime database data for this.

 When we use that you need to have full name. One way is to use same
 logic used by SS in our code to generate the code in our side as well.
 Downside of this is if SS change this we need to change it in our code as
 well. Or else we can search using some pattern like this in db.
 "_%". However in the latter case the regular expression
 should be carefully selected.

 @Dimuthu :
 WDYT?

 [1] https://wso2.org/jira/browse/APPFAC-2723

 Thanks & Regards
 Danushka Fernando
 Software Engineer
 WSO2 inc. http://wso2.com/
 Mobile : +94716332729

 On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara >>> > wrote:

> Hi Anurudhdha,
>
> In this use case, why are you trying to check the user existence? Are
> you trying to do it before user creation? In that case, you don't have to
> check it yourself because create user service will do it internally, and
> throw an exception if the user exists. So your try-catch approach is fine.
>
> Thanks,
> Bhathiya
>
> On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal  > wrote:
>
>> Hi,
>>
>> I'm working on APPFAC-2723 and there is a requirement to check
>> whether a user is already created in storage server.
>>
>> In RssAdminService there is a method to check whether a database user
>> exists.
>>
>> Issue with this method is, there has a hashed tenant domain value
>> appended to the username once we create  a databaseuser, and it requires
>> the full name (with the appended value) to check the user existence.
>>
>> Isn't it the RSSAdmin service responsibility to append the hashed
>> value and perform the search?.
>>
>> For now I can use a try catch block in the jaggery layer and handle
>> the duplicate user creation exception.
>>
>> AppFactory_Resource_DB has this full user name and perform
>> isDataBaseuserExist operation. However this method always resurns false
>> because we haven't passed the appended hashed value with the username.
>>
>> Shall we remove this isDataBaseUserExist method from the
>> ResourceManger and use try catch approach to check the user existence?
>>
>> Regards,
>> --
>> *Anuruddha Premalal*
>> Software Eng. | WSO2 Inc.
>> Mobile : +94710461070
>> Web site : www.regilandvalley.com
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Bhathiya Jayasekara*
> *Software Engineer,*
> *WSO2 inc., http://wso2.com *
>
> *Phone: +94715478185 <%2B94715478185>*
> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
> *
> *Twitter: https://twitter.com/bhathiyax
> *
> *

Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Dimuthu Leelarathne
Hi all,

For the appending string lets take the code from SS and then use runtime DB
to verify existence of the name. If we use code from the util method we can
just limit the changes to one method.

thanks,
dimuthu

On Fri, Jan 9, 2015 at 8:19 AM, Danushka Fernando 
wrote:

> @Bhathiya :
> Yes, That what we expect to do.
>
> @Asanka :
> I am not sure how anuruddha planned the implementation. But yes that
> should be the way to do it since that how we have done it in other places.
>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Fri, Jan 9, 2015 at 8:12 AM, Asanka Dissanayake 
> wrote:
>
>> Hi Danushka,
>> Please find my comments inline.
>>
>> On Thu, Jan 8, 2015 at 3:56 PM, Danushka Fernando 
>> wrote:
>>
>>> Hi All
>>>
>>> @Bhathiya : This is about usability. We cannot let user do something and
>>> let it fail and then let know the user that you cannot do this. We need to
>>> inform that to user when he try to do it. That's what we are trying to
>>> achieve here.
>>>
>>
>> How are you going to verify this. After user clicks Submit ? you gonna
>> pass the user name to back end and check whether it is valid. In that case
>> trying to add the user and handle the exception has same weight I think. Or
>> else if you want to improve the usability what you can do is, get the
>> database user names from backned without hashed tenant domain prefix
>> during the page loading  and verify it within there . You can write
>> validate logic in the "onblur" event of the input field.
>>
>> Just my two cents .
>>
>>
>>
>>> @Anuruddha :
>>> However there are few notes. In [1] what Dimuthu mentioned is to use af
>>> runtime database data for this.
>>>
>>> When we use that you need to have full name. One way is to use same
>>> logic used by SS in our code to generate the code in our side as well.
>>> Downside of this is if SS change this we need to change it in our code as
>>> well. Or else we can search using some pattern like this in db.
>>> "_%". However in the latter case the regular expression
>>> should be carefully selected.
>>>
>>> @Dimuthu :
>>> WDYT?
>>>
>>> [1] https://wso2.org/jira/browse/APPFAC-2723
>>>
>>> Thanks & Regards
>>> Danushka Fernando
>>> Software Engineer
>>> WSO2 inc. http://wso2.com/
>>> Mobile : +94716332729
>>>
>>> On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Anurudhdha,

 In this use case, why are you trying to check the user existence? Are
 you trying to do it before user creation? In that case, you don't have to
 check it yourself because create user service will do it internally, and
 throw an exception if the user exists. So your try-catch approach is fine.

 Thanks,
 Bhathiya

 On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal 
 wrote:

> Hi,
>
> I'm working on APPFAC-2723 and there is a requirement to check
> whether a user is already created in storage server.
>
> In RssAdminService there is a method to check whether a database user
> exists.
>
> Issue with this method is, there has a hashed tenant domain value
> appended to the username once we create  a databaseuser, and it requires
> the full name (with the appended value) to check the user existence.
>
> Isn't it the RSSAdmin service responsibility to append the hashed
> value and perform the search?.
>
> For now I can use a try catch block in the jaggery layer and handle
> the duplicate user creation exception.
>
> AppFactory_Resource_DB has this full user name and perform
> isDataBaseuserExist operation. However this method always resurns false
> because we haven't passed the appended hashed value with the username.
>
> Shall we remove this isDataBaseUserExist method from the
> ResourceManger and use try catch approach to check the user existence?
>
> Regards,
> --
> *Anuruddha Premalal*
> Software Eng. | WSO2 Inc.
> Mobile : +94710461070
> Web site : www.regilandvalley.com
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


 --
 *Bhathiya Jayasekara*
 *Software Engineer,*
 *WSO2 inc., http://wso2.com *

 *Phone: +94715478185 <%2B94715478185>*
 *LinkedIn: http://www.linkedin.com/in/bhathiyaj
 *
 *Twitter: https://twitter.com/bhathiyax *
 *Blog: http://movingaheadblog.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/list

Re: [Dev] getPayloadJSON returning an empty object

2015-01-08 Thread Malaka Silva
Also specify what is the ESB version used? 4.9.0 M4 or 4.8.1?

On Fri, Jan 9, 2015 at 7:54 AM, Asanka Dissanayake  wrote:

> Hi Maz,
> What is the JSON builder and formatter you are using? You can find them in
> /repository/conf/axis2/axis2.xml under Formatters and Builders.
>
> Thanks,
> Asanka
>
> On Thu, Jan 8, 2015 at 8:14 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Maz,
>>
>> I quickly tried out your config and it worked fine for me. I'm copying my
>> full config here for your reference.
>>
>> http://ws.apache.org/ns/synapse"; name="jsonTest"
>> context="/json">
>>
>>   
>>  
>>   
>>   
>>  *var older = mc.getPayloadJSON(); var
>> newer=older; mc.setPayloadJSON(newer);*
>>  
>>   
>>
>> 
>>
>>
>> *Request:*
>> curl -X POST -d "{\"origin\":\"202.37.75.130\"}" -H "Content-Type:
>> application/json" http://10.113.56.222:8281/json
>>
>> *Response:*
>> {"origin":"202.37.75.130"}
>>
>> Hope this helps.
>>
>> Thanks,
>> Bhathiya
>>
>> On Fri, Jan 9, 2015 at 3:55 AM, Maz Lakadia  wrote:
>>
>>> I am doing some very simple script mediation as a test to see if I can
>>> change the payload being returned by my server.
>>>
>>> My unmediated payload comes out as:
>>>
>>> {"origin":"202.37.75.130"}
>>>
>>> Then I try doing a very simple check to see whether get and set work for
>>> payloads:
>>>
>>> 
>>> var older = mc.getPayloadJSON();
>>> var newer=older;
>>> mc.setPayloadJSON(newer);
>>> 
>>>
>>> My result from this is:
>>>
>>> {"jsonObject":""}
>>>
>>> I have done testing that shows that setPayloadJSON() works, which means
>>> that my getPayloadJSON must be returning an empty object.
>>>
>>> Looking at the log file shows this:
>>>
>>> ERROR {org.apache.synapse.mediators.bsf.ScriptMessageContext} -  JSON 
>>> object is null. {org.apache.synapse.mediators.bsf.ScriptMessageContext}
>>>
>>> Is there anyone else having this error? Is this happening because the
>>> Payload is actually a Java object rather than a JSON object?
>>>
>>>
>>> Thanks,
>>> Maz
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Bhathiya Jayasekara*
>> *Software Engineer,*
>> *WSO2 inc., http://wso2.com *
>>
>> *Phone: +94715478185 <%2B94715478185>*
>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>> *
>> *Twitter: https://twitter.com/bhathiyax *
>> *Blog: http://movingaheadblog.blogspot.com
>> *
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
>
> *Asanka DissanayakeSoftware Engineer*
> *WSO2 Inc. - lean . enterprise . middleware |  wso2.com *
>
> *email: asan...@wso2.com ,   blog:
> cyberwaadiya.blogspot.com
> , asankastechtalks.wordpress.com
>   mobile: +94 71 8373821*
>
> ___
> 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/


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] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Danushka Fernando
@Bhathiya :
Yes, That what we expect to do.

@Asanka :
I am not sure how anuruddha planned the implementation. But yes that should
be the way to do it since that how we have done it in other places.

Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729

On Fri, Jan 9, 2015 at 8:12 AM, Asanka Dissanayake  wrote:

> Hi Danushka,
> Please find my comments inline.
>
> On Thu, Jan 8, 2015 at 3:56 PM, Danushka Fernando 
> wrote:
>
>> Hi All
>>
>> @Bhathiya : This is about usability. We cannot let user do something and
>> let it fail and then let know the user that you cannot do this. We need to
>> inform that to user when he try to do it. That's what we are trying to
>> achieve here.
>>
>
> How are you going to verify this. After user clicks Submit ? you gonna
> pass the user name to back end and check whether it is valid. In that case
> trying to add the user and handle the exception has same weight I think. Or
> else if you want to improve the usability what you can do is, get the
> database user names from backned without hashed tenant domain prefix
> during the page loading  and verify it within there . You can write
> validate logic in the "onblur" event of the input field.
>
> Just my two cents .
>
>
>
>> @Anuruddha :
>> However there are few notes. In [1] what Dimuthu mentioned is to use af
>> runtime database data for this.
>>
>> When we use that you need to have full name. One way is to use same logic
>> used by SS in our code to generate the code in our side as well. Downside
>> of this is if SS change this we need to change it in our code as well. Or
>> else we can search using some pattern like this in db.
>> "_%". However in the latter case the regular expression
>> should be carefully selected.
>>
>> @Dimuthu :
>> WDYT?
>>
>> [1] https://wso2.org/jira/browse/APPFAC-2723
>>
>> Thanks & Regards
>> Danushka Fernando
>> Software Engineer
>> WSO2 inc. http://wso2.com/
>> Mobile : +94716332729
>>
>> On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Anurudhdha,
>>>
>>> In this use case, why are you trying to check the user existence? Are
>>> you trying to do it before user creation? In that case, you don't have to
>>> check it yourself because create user service will do it internally, and
>>> throw an exception if the user exists. So your try-catch approach is fine.
>>>
>>> Thanks,
>>> Bhathiya
>>>
>>> On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal 
>>> wrote:
>>>
 Hi,

 I'm working on APPFAC-2723 and there is a requirement to check whether
 a user is already created in storage server.

 In RssAdminService there is a method to check whether a database user
 exists.

 Issue with this method is, there has a hashed tenant domain value
 appended to the username once we create  a databaseuser, and it requires
 the full name (with the appended value) to check the user existence.

 Isn't it the RSSAdmin service responsibility to append the hashed value
 and perform the search?.

 For now I can use a try catch block in the jaggery layer and handle the
 duplicate user creation exception.

 AppFactory_Resource_DB has this full user name and perform
 isDataBaseuserExist operation. However this method always resurns false
 because we haven't passed the appended hashed value with the username.

 Shall we remove this isDataBaseUserExist method from the ResourceManger
 and use try catch approach to check the user existence?

 Regards,
 --
 *Anuruddha Premalal*
 Software Eng. | WSO2 Inc.
 Mobile : +94710461070
 Web site : www.regilandvalley.com


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


>>>
>>>
>>> --
>>> *Bhathiya Jayasekara*
>>> *Software Engineer,*
>>> *WSO2 inc., http://wso2.com *
>>>
>>> *Phone: +94715478185 <%2B94715478185>*
>>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>>> *
>>> *Twitter: https://twitter.com/bhathiyax *
>>> *Blog: http://movingaheadblog.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
>>
>>
>
>
> --
>
>
> *Asanka DissanayakeSoftware Engineer*
> *WSO2 Inc. - lean . enterprise . middleware |  wso2.com *
>
> *email: asan...@wso2.com ,   blog:
> cyberwaadiya.blogspot.com
> , asankastechtalks.wordpress.com
>   mobile: +94 71 8373821*
>
___
Dev mailing list
Dev@wso2.org
htt

Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Asanka Dissanayake
Hi Danushka,
Please find my comments inline.

On Thu, Jan 8, 2015 at 3:56 PM, Danushka Fernando 
wrote:

> Hi All
>
> @Bhathiya : This is about usability. We cannot let user do something and
> let it fail and then let know the user that you cannot do this. We need to
> inform that to user when he try to do it. That's what we are trying to
> achieve here.
>

How are you going to verify this. After user clicks Submit ? you gonna pass
the user name to back end and check whether it is valid. In that case
trying to add the user and handle the exception has same weight I think. Or
else if you want to improve the usability what you can do is, get the
database user names from backned without hashed tenant domain prefix
during the page loading  and verify it within there . You can write
validate logic in the "onblur" event of the input field.

Just my two cents .



> @Anuruddha :
> However there are few notes. In [1] what Dimuthu mentioned is to use af
> runtime database data for this.
>
> When we use that you need to have full name. One way is to use same logic
> used by SS in our code to generate the code in our side as well. Downside
> of this is if SS change this we need to change it in our code as well. Or
> else we can search using some pattern like this in db.
> "_%". However in the latter case the regular expression
> should be carefully selected.
>
> @Dimuthu :
> WDYT?
>
> [1] https://wso2.org/jira/browse/APPFAC-2723
>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Anurudhdha,
>>
>> In this use case, why are you trying to check the user existence? Are you
>> trying to do it before user creation? In that case, you don't have to check
>> it yourself because create user service will do it internally, and throw an
>> exception if the user exists. So your try-catch approach is fine.
>>
>> Thanks,
>> Bhathiya
>>
>> On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm working on APPFAC-2723 and there is a requirement to check whether
>>> a user is already created in storage server.
>>>
>>> In RssAdminService there is a method to check whether a database user
>>> exists.
>>>
>>> Issue with this method is, there has a hashed tenant domain value
>>> appended to the username once we create  a databaseuser, and it requires
>>> the full name (with the appended value) to check the user existence.
>>>
>>> Isn't it the RSSAdmin service responsibility to append the hashed value
>>> and perform the search?.
>>>
>>> For now I can use a try catch block in the jaggery layer and handle the
>>> duplicate user creation exception.
>>>
>>> AppFactory_Resource_DB has this full user name and perform
>>> isDataBaseuserExist operation. However this method always resurns false
>>> because we haven't passed the appended hashed value with the username.
>>>
>>> Shall we remove this isDataBaseUserExist method from the ResourceManger
>>> and use try catch approach to check the user existence?
>>>
>>> Regards,
>>> --
>>> *Anuruddha Premalal*
>>> Software Eng. | WSO2 Inc.
>>> Mobile : +94710461070
>>> Web site : www.regilandvalley.com
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Bhathiya Jayasekara*
>> *Software Engineer,*
>> *WSO2 inc., http://wso2.com *
>>
>> *Phone: +94715478185 <%2B94715478185>*
>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>> *
>> *Twitter: https://twitter.com/bhathiyax *
>> *Blog: http://movingaheadblog.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
>
>


-- 


*Asanka DissanayakeSoftware Engineer*
*WSO2 Inc. - lean . enterprise . middleware |  wso2.com *

*email: asan...@wso2.com ,   blog:
cyberwaadiya.blogspot.com
, asankastechtalks.wordpress.com
  mobile: +94 71 8373821*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] getPayloadJSON returning an empty object

2015-01-08 Thread Asanka Dissanayake
Hi Maz,
What is the JSON builder and formatter you are using? You can find them in
/repository/conf/axis2/axis2.xml under Formatters and Builders.

Thanks,
Asanka

On Thu, Jan 8, 2015 at 8:14 PM, Bhathiya Jayasekara 
wrote:

> Hi Maz,
>
> I quickly tried out your config and it worked fine for me. I'm copying my
> full config here for your reference.
>
> http://ws.apache.org/ns/synapse"; name="jsonTest"
> context="/json">
>
>   
>  
>   
>   
>  *var older = mc.getPayloadJSON(); var
> newer=older; mc.setPayloadJSON(newer);*
>  
>   
>
> 
>
>
> *Request:*
> curl -X POST -d "{\"origin\":\"202.37.75.130\"}" -H "Content-Type:
> application/json" http://10.113.56.222:8281/json
>
> *Response:*
> {"origin":"202.37.75.130"}
>
> Hope this helps.
>
> Thanks,
> Bhathiya
>
> On Fri, Jan 9, 2015 at 3:55 AM, Maz Lakadia  wrote:
>
>> I am doing some very simple script mediation as a test to see if I can
>> change the payload being returned by my server.
>>
>> My unmediated payload comes out as:
>>
>> {"origin":"202.37.75.130"}
>>
>> Then I try doing a very simple check to see whether get and set work for
>> payloads:
>>
>> 
>> var older = mc.getPayloadJSON();
>> var newer=older;
>> mc.setPayloadJSON(newer);
>> 
>>
>> My result from this is:
>>
>> {"jsonObject":""}
>>
>> I have done testing that shows that setPayloadJSON() works, which means
>> that my getPayloadJSON must be returning an empty object.
>>
>> Looking at the log file shows this:
>>
>> ERROR {org.apache.synapse.mediators.bsf.ScriptMessageContext} -  JSON object 
>> is null. {org.apache.synapse.mediators.bsf.ScriptMessageContext}
>>
>> Is there anyone else having this error? Is this happening because the
>> Payload is actually a Java object rather than a JSON object?
>>
>>
>> Thanks,
>> Maz
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Bhathiya Jayasekara*
> *Software Engineer,*
> *WSO2 inc., http://wso2.com *
>
> *Phone: +94715478185 <%2B94715478185>*
> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
> *
> *Twitter: https://twitter.com/bhathiyax *
> *Blog: http://movingaheadblog.blogspot.com
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 


*Asanka DissanayakeSoftware Engineer*
*WSO2 Inc. - lean . enterprise . middleware |  wso2.com *

*email: asan...@wso2.com ,   blog:
cyberwaadiya.blogspot.com
, asankastechtalks.wordpress.com
  mobile: +94 71 8373821*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] getPayloadJSON returning an empty object

2015-01-08 Thread Bhathiya Jayasekara
Hi Maz,

I quickly tried out your config and it worked fine for me. I'm copying my
full config here for your reference.

http://ws.apache.org/ns/synapse"; name="jsonTest"
context="/json">
   
  
 
  
  
 *var older = mc.getPayloadJSON(); var
newer=older; mc.setPayloadJSON(newer);*
 
  
   



*Request:*
curl -X POST -d "{\"origin\":\"202.37.75.130\"}" -H "Content-Type:
application/json" http://10.113.56.222:8281/json

*Response:*
{"origin":"202.37.75.130"}

Hope this helps.

Thanks,
Bhathiya

On Fri, Jan 9, 2015 at 3:55 AM, Maz Lakadia  wrote:

> I am doing some very simple script mediation as a test to see if I can
> change the payload being returned by my server.
>
> My unmediated payload comes out as:
>
> {"origin":"202.37.75.130"}
>
> Then I try doing a very simple check to see whether get and set work for
> payloads:
>
> 
> var older = mc.getPayloadJSON();
> var newer=older;
> mc.setPayloadJSON(newer);
> 
>
> My result from this is:
>
> {"jsonObject":""}
>
> I have done testing that shows that setPayloadJSON() works, which means
> that my getPayloadJSON must be returning an empty object.
>
> Looking at the log file shows this:
>
> ERROR {org.apache.synapse.mediators.bsf.ScriptMessageContext} -  JSON object 
> is null. {org.apache.synapse.mediators.bsf.ScriptMessageContext}
>
> Is there anyone else having this error? Is this happening because the
> Payload is actually a Java object rather than a JSON object?
>
>
> Thanks,
> Maz
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Bhathiya Jayasekara*
*Software Engineer,*
*WSO2 inc., http://wso2.com *

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
*
*Twitter: https://twitter.com/bhathiyax *
*Blog: http://movingaheadblog.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Making AF_RESOURECE.RESOURCE_NMAE a unique value

2015-01-08 Thread Dimuthu Leelarathne
Hi Anuruddha,

Understood the problem. Database is a special case and should be handled at
the code level. Retrieve all databases for a tenant and check wether the
name exists. You have to check the uniqueness for a tenant, rather than
changing the uniqueness constraint. So I would introduce a new method
"isResourceExistForTenant" that would check whether the resource exist for
tenant. I would not change the uniqueness constraint of the database.

thanks,
dimuthu

On Thu, Jan 8, 2015 at 9:21 PM, Anuruddha Premalal 
wrote:

> Hi All,
>
> If the RESOURCE_TYPE is DATABASE, we cannot have the same name for
> different applicaions given that we are pointing to a single DB for a given
> environment. In all the other cases we can use (APPLICATION_ID,
> RESOURCE_TYPE, RESOURCE_NAME, ENVIRONMENT) as the unique.
>
> So in DATABSE resource type, it should be RESOURCE_NAME, ENVIRONMENT
>
> On Thu, Jan 8, 2015 at 8:18 PM, Dimuthu Leelarathne 
> wrote:
>
>> Hi all,
>>
>> I ran through the complete script. Adding to what Danushka said the
>> uniqueness should be (APPLICATION_ID, RESOURCE_TYPE, RESOURCE_NAME,
>> ENVIRONMENT)
>>
>> thanks,
>> dimuthu
>>
>> On Thu, Jan 8, 2015 at 5:36 PM, Danushka Fernando 
>> wrote:
>>
>>> Moved to dev@ since this is a dev matter.
>>>
>>> I think what unique should be is (APPLICATION_ID, RESOURCE_NAME,
>>> ENVIRONMENT). No point in making RESOURCE_NAME field alone unique.
>>> Because an user should be able to create a resource with same name in a
>>> different environement/stage or different application.
>>>
>>> Thanks & Regards
>>> Danushka Fernando
>>> Software Engineer
>>> WSO2 inc. http://wso2.com/
>>> Mobile : +94716332729
>>>
>>> On Thu, Jan 8, 2015 at 4:35 PM, Anuruddha Premalal 
>>> wrote:
>>>
 Hi,

 In creating a datadabse/datasource/databse_user/databse_template we
 update the AF_RESOURCE table(in afdb) with the following parameters.

 APPLICATION_ID
 RESOURCE_TYPE
 RESOURCE_NAME
 ENVIRONMENT
 DESCRIPTION

 Since duplication should not be allowed in any of the appfactory
 resources, shall we make the RESOURCE_NAME field unique?. This will require
 a data migration for cloud as well.


 Regards,
 --
 *Anuruddha Premalal*
 Software Eng. | WSO2 Inc.
 Mobile : +94710461070
 Web site : www.regilandvalley.com


>>>
>>
>>
>> --
>> Dimuthu Leelarathne
>> Architect & Product Lead of App Factory
>>
>> WSO2, Inc. (http://wso2.com)
>> email: dimut...@wso2.com
>> Mobile : 0773661935
>>
>> Lean . Enterprise . Middleware
>>
>
>
>
> --
> *Anuruddha Premalal*
> Software Eng. | WSO2 Inc.
> Mobile : +94710461070
> Web site : www.regilandvalley.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] getPayloadJSON returning an empty object

2015-01-08 Thread Maz Lakadia
I am doing some very simple script mediation as a test to see if I can change 
the payload being returned by my server.My unmediated payload comes out 
as:{"origin":"202.37.75.130"}
Then I try doing a very simple check to see whether get and set work for 
payloads:
var older = mc.getPayloadJSON(); 
var newer=older; 
mc.setPayloadJSON(newer);   
 
My result from this is:{"jsonObject":""}
I have done testing that shows that setPayloadJSON() works, which means that my 
getPayloadJSON must be returning an empty object.Looking at the log file shows 
this:ERROR {org.apache.synapse.mediators.bsf.ScriptMessageContext} -  JSON 
object is null. {org.apache.synapse.mediators.bsf.ScriptMessageContext}
Is there anyone else having this error? Is this happening because the Payload 
is actually a Java object rather than a JSON object?
Thanks,
Maz   ___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Bhathiya Jayasekara
HI Dhanushka,

On Fri, Jan 9, 2015 at 2:26 AM, Danushka Fernando 
wrote:

> Hi All
>
> @Bhathiya : This is about usability.
>

Do you mean in this case you check availability before user submit data? In
that case your point is valid.

Thanks,
Bhathiya


> We cannot let user do something and let it fail and then let know the user
> that you cannot do this. We need to inform that to user when he try to do
> it. That's what we are trying to achieve here.
>
> @Anuruddha :
> However there are few notes. In [1] what Dimuthu mentioned is to use af
> runtime database data for this.
>
> When we use that you need to have full name. One way is to use same logic
> used by SS in our code to generate the code in our side as well. Downside
> of this is if SS change this we need to change it in our code as well. Or
> else we can search using some pattern like this in db.
> "_%". However in the latter case the regular expression
> should be carefully selected.
>
> @Dimuthu :
> WDYT?
>
> [1] https://wso2.org/jira/browse/APPFAC-2723
>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Anurudhdha,
>>
>> In this use case, why are you trying to check the user existence? Are you
>> trying to do it before user creation? In that case, you don't have to check
>> it yourself because create user service will do it internally, and throw an
>> exception if the user exists. So your try-catch approach is fine.
>>
>> Thanks,
>> Bhathiya
>>
>> On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal 
>> wrote:
>>
>>> Hi,
>>>
>>> I'm working on APPFAC-2723 and there is a requirement to check whether
>>> a user is already created in storage server.
>>>
>>> In RssAdminService there is a method to check whether a database user
>>> exists.
>>>
>>> Issue with this method is, there has a hashed tenant domain value
>>> appended to the username once we create  a databaseuser, and it requires
>>> the full name (with the appended value) to check the user existence.
>>>
>>> Isn't it the RSSAdmin service responsibility to append the hashed value
>>> and perform the search?.
>>>
>>> For now I can use a try catch block in the jaggery layer and handle the
>>> duplicate user creation exception.
>>>
>>> AppFactory_Resource_DB has this full user name and perform
>>> isDataBaseuserExist operation. However this method always resurns false
>>> because we haven't passed the appended hashed value with the username.
>>>
>>> Shall we remove this isDataBaseUserExist method from the ResourceManger
>>> and use try catch approach to check the user existence?
>>>
>>> Regards,
>>> --
>>> *Anuruddha Premalal*
>>> Software Eng. | WSO2 Inc.
>>> Mobile : +94710461070
>>> Web site : www.regilandvalley.com
>>>
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Bhathiya Jayasekara*
>> *Software Engineer,*
>> *WSO2 inc., http://wso2.com *
>>
>> *Phone: +94715478185 <%2B94715478185>*
>> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
>> *
>> *Twitter: https://twitter.com/bhathiyax *
>> *Blog: http://movingaheadblog.blogspot.com
>> *
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>


-- 
*Bhathiya Jayasekara*
*Software Engineer,*
*WSO2 inc., http://wso2.com *

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
*
*Twitter: https://twitter.com/bhathiyax *
*Blog: http://movingaheadblog.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Danushka Fernando
Hi All

@Bhathiya : This is about usability. We cannot let user do something and
let it fail and then let know the user that you cannot do this. We need to
inform that to user when he try to do it. That's what we are trying to
achieve here.

@Anuruddha :
However there are few notes. In [1] what Dimuthu mentioned is to use af
runtime database data for this.

When we use that you need to have full name. One way is to use same logic
used by SS in our code to generate the code in our side as well. Downside
of this is if SS change this we need to change it in our code as well. Or
else we can search using some pattern like this in db.
"_%". However in the latter case the regular expression
should be carefully selected.

@Dimuthu :
WDYT?

[1] https://wso2.org/jira/browse/APPFAC-2723

Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729

On Thu, Jan 8, 2015 at 11:55 PM, Bhathiya Jayasekara 
wrote:

> Hi Anurudhdha,
>
> In this use case, why are you trying to check the user existence? Are you
> trying to do it before user creation? In that case, you don't have to check
> it yourself because create user service will do it internally, and throw an
> exception if the user exists. So your try-catch approach is fine.
>
> Thanks,
> Bhathiya
>
> On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal 
> wrote:
>
>> Hi,
>>
>> I'm working on APPFAC-2723 and there is a requirement to check whether a
>> user is already created in storage server.
>>
>> In RssAdminService there is a method to check whether a database user
>> exists.
>>
>> Issue with this method is, there has a hashed tenant domain value
>> appended to the username once we create  a databaseuser, and it requires
>> the full name (with the appended value) to check the user existence.
>>
>> Isn't it the RSSAdmin service responsibility to append the hashed value
>> and perform the search?.
>>
>> For now I can use a try catch block in the jaggery layer and handle the
>> duplicate user creation exception.
>>
>> AppFactory_Resource_DB has this full user name and perform
>> isDataBaseuserExist operation. However this method always resurns false
>> because we haven't passed the appended hashed value with the username.
>>
>> Shall we remove this isDataBaseUserExist method from the ResourceManger
>> and use try catch approach to check the user existence?
>>
>> Regards,
>> --
>> *Anuruddha Premalal*
>> Software Eng. | WSO2 Inc.
>> Mobile : +94710461070
>> Web site : www.regilandvalley.com
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Bhathiya Jayasekara*
> *Software Engineer,*
> *WSO2 inc., http://wso2.com *
>
> *Phone: +94715478185 <%2B94715478185>*
> *LinkedIn: http://www.linkedin.com/in/bhathiyaj
> *
> *Twitter: https://twitter.com/bhathiyax *
> *Blog: http://movingaheadblog.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


Re: [Dev] Apache CXF - JAX-WS and JAX-RS issue for same endpoint

2015-01-08 Thread Asok Perera
Hi,

Thanks Sagara !
I will check those CXF examples.

After bit of search, I could find another solution for this.
This specific implementation has apache server infront of these two
services, as there is a Proxypass functionality.
So I implemented these JAX WS and JAX RS services with 'different' endpoint
addresses, and added two RewriteRules to httpd.conf, such that if the
client makes a call to the given single endpoint (either GET or POST), the
RewriteRules check whether the call is GET or POST,
then routes it to relevant endpoint (JAX WS or JAX RS).

*RewriteEngine On*
*RewriteCond %{REQUEST_METHOD} ^(POST)$*
*RewriteRule ^/EnrollmentServer/Discovery.svc
http://localhost:9763/testsoap/test/send
 [P,L]*

*RewriteCond %{REQUEST_METHOD} ^(GET)$*
*RewriteRule ^/EnrollmentServer/Discovery.svc
http://localhost:9763/testsoap/test/send2
 [P,L]*

This worked as expected,
But I will check what you have suggested as well.

Thanks again, and any comment on this will be really helpful.

BR


*Asok Aravinda Perera*
Software Engineer
WSO2, Inc.;http://wso2.com/

lean.enterprise.middleware

Mobile: +94722241032

On Thu, Jan 8, 2015 at 9:38 PM, Sagara Gunathunga  wrote:

>
>
> On Thu, Jan 8, 2015 at 8:51 PM, Asok Perera  wrote:
>
>> Hi,
>>
>> I need to implement JAX WS and JAX RS services to the same endpoint in
>> CXF.
>> Here, JAX WS will be used for a POST call, while JAX RS is for a GET.
>>
>> In the POST call there is a SOAP message as the body and GET call will be
>> a normal REST call.
>>
>> My example cxf-servlet.xml looks like,
>>
>> * > *id="DiscoveryService"*
>> *implementor="com.ex.soap.impl.DiscoveryServiceGetImpl"*
>> *address="test/send"/>*
>>
>> **
>> **
>> **
>> **
>> **
>> *> class="com.ex.soap.impl.DiscoveryServiceGetImpl"/> *
>>
>> This doesn't work for POST, but only works for GET method.
>>
>> Does anyone know how to achieve this ?
>>
>
> You have two alternatives here.
>
> 1.) Just write a JAX-RS service and treat SOAP message as POX content,
> this is much simple.
>
> 2.) Implement RESTful JAX-WS service using JAX-WS Provider API[1].  CXF
> already has a sample for this.
>
>
> [1] - http://docs.oracle.com/javaee/5/api/javax/xml/ws/Provider.html
> [2]-
> http://cxf.apache.org/docs/rest-with-jax-ws-provider-and-dispatch.html
>
> Thanks !
>
>
>>
>> Note : When the endpoint addresses are different for JAX WS and JAX RS,
>> the implementation works fine for both GET and POST. The issue occurs only
>> when the endpoint addresses are the same.
>>
>> BR
>>
>> *Asok Aravinda Perera*
>> Software Engineer
>> WSO2, Inc.;http://wso2.com/
>> 
>> lean.enterprise.middleware
>>
>> Mobile: +94722241032
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Sagara Gunathunga
>
> Senior Technical Lead; WSO2, Inc.;  http://wso2.com
> V.P Apache Web Services;http://ws.apache.org/
> Linkedin; http://www.linkedin.com/in/ssagara
> Blog ;  http://ssagara.blogspot.com
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [AF][SS] RSSAdminService method 'isDatabaseUserExist' requires the full database username with

2015-01-08 Thread Bhathiya Jayasekara
Hi Anurudhdha,

In this use case, why are you trying to check the user existence? Are you
trying to do it before user creation? In that case, you don't have to check
it yourself because create user service will do it internally, and throw an
exception if the user exists. So your try-catch approach is fine.

Thanks,
Bhathiya

On Tue, Jan 6, 2015 at 7:19 PM, Anuruddha Premalal 
wrote:

> Hi,
>
> I'm working on APPFAC-2723 and there is a requirement to check whether a
> user is already created in storage server.
>
> In RssAdminService there is a method to check whether a database user
> exists.
>
> Issue with this method is, there has a hashed tenant domain value appended
> to the username once we create  a databaseuser, and it requires the full
> name (with the appended value) to check the user existence.
>
> Isn't it the RSSAdmin service responsibility to append the hashed value
> and perform the search?.
>
> For now I can use a try catch block in the jaggery layer and handle the
> duplicate user creation exception.
>
> AppFactory_Resource_DB has this full user name and perform
> isDataBaseuserExist operation. However this method always resurns false
> because we haven't passed the appended hashed value with the username.
>
> Shall we remove this isDataBaseUserExist method from the ResourceManger
> and use try catch approach to check the user existence?
>
> Regards,
> --
> *Anuruddha Premalal*
> Software Eng. | WSO2 Inc.
> Mobile : +94710461070
> Web site : www.regilandvalley.com
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Bhathiya Jayasekara*
*Software Engineer,*
*WSO2 inc., http://wso2.com *

*Phone: +94715478185*
*LinkedIn: http://www.linkedin.com/in/bhathiyaj
*
*Twitter: https://twitter.com/bhathiyax *
*Blog: http://movingaheadblog.blogspot.com
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Apache CXF - JAX-WS and JAX-RS issue for same endpoint

2015-01-08 Thread Sagara Gunathunga
On Thu, Jan 8, 2015 at 8:51 PM, Asok Perera  wrote:

> Hi,
>
> I need to implement JAX WS and JAX RS services to the same endpoint in CXF.
> Here, JAX WS will be used for a POST call, while JAX RS is for a GET.
>
> In the POST call there is a SOAP message as the body and GET call will be
> a normal REST call.
>
> My example cxf-servlet.xml looks like,
>
> *  *id="DiscoveryService"*
> *implementor="com.ex.soap.impl.DiscoveryServiceGetImpl"*
> *address="test/send"/>*
>
> **
> **
> **
> **
> **
> * class="com.ex.soap.impl.DiscoveryServiceGetImpl"/> *
>
> This doesn't work for POST, but only works for GET method.
>
> Does anyone know how to achieve this ?
>

You have two alternatives here.

1.) Just write a JAX-RS service and treat SOAP message as POX content, this
is much simple.

2.) Implement RESTful JAX-WS service using JAX-WS Provider API[1].  CXF
already has a sample for this.


[1] - http://docs.oracle.com/javaee/5/api/javax/xml/ws/Provider.html
[2]-  http://cxf.apache.org/docs/rest-with-jax-ws-provider-and-dispatch.html

Thanks !


>
> Note : When the endpoint addresses are different for JAX WS and JAX RS,
> the implementation works fine for both GET and POST. The issue occurs only
> when the endpoint addresses are the same.
>
> BR
>
> *Asok Aravinda Perera*
> Software Engineer
> WSO2, Inc.;http://wso2.com/
> 
> lean.enterprise.middleware
>
> Mobile: +94722241032
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sagara Gunathunga

Senior Technical Lead; WSO2, Inc.;  http://wso2.com
V.P Apache Web Services;http://ws.apache.org/
Linkedin; http://www.linkedin.com/in/ssagara
Blog ;  http://ssagara.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Making AF_RESOURECE.RESOURCE_NMAE a unique value

2015-01-08 Thread Anuruddha Premalal
Hi All,

If the RESOURCE_TYPE is DATABASE, we cannot have the same name for
different applicaions given that we are pointing to a single DB for a given
environment. In all the other cases we can use (APPLICATION_ID,
RESOURCE_TYPE, RESOURCE_NAME, ENVIRONMENT) as the unique.

So in DATABSE resource type, it should be RESOURCE_NAME, ENVIRONMENT

On Thu, Jan 8, 2015 at 8:18 PM, Dimuthu Leelarathne 
wrote:

> Hi all,
>
> I ran through the complete script. Adding to what Danushka said the
> uniqueness should be (APPLICATION_ID, RESOURCE_TYPE, RESOURCE_NAME,
> ENVIRONMENT)
>
> thanks,
> dimuthu
>
> On Thu, Jan 8, 2015 at 5:36 PM, Danushka Fernando 
> wrote:
>
>> Moved to dev@ since this is a dev matter.
>>
>> I think what unique should be is (APPLICATION_ID, RESOURCE_NAME,
>> ENVIRONMENT). No point in making RESOURCE_NAME field alone unique.
>> Because an user should be able to create a resource with same name in a
>> different environement/stage or different application.
>>
>> Thanks & Regards
>> Danushka Fernando
>> Software Engineer
>> WSO2 inc. http://wso2.com/
>> Mobile : +94716332729
>>
>> On Thu, Jan 8, 2015 at 4:35 PM, Anuruddha Premalal 
>> wrote:
>>
>>> Hi,
>>>
>>> In creating a datadabse/datasource/databse_user/databse_template we
>>> update the AF_RESOURCE table(in afdb) with the following parameters.
>>>
>>> APPLICATION_ID
>>> RESOURCE_TYPE
>>> RESOURCE_NAME
>>> ENVIRONMENT
>>> DESCRIPTION
>>>
>>> Since duplication should not be allowed in any of the appfactory
>>> resources, shall we make the RESOURCE_NAME field unique?. This will require
>>> a data migration for cloud as well.
>>>
>>>
>>> Regards,
>>> --
>>> *Anuruddha Premalal*
>>> Software Eng. | WSO2 Inc.
>>> Mobile : +94710461070
>>> Web site : www.regilandvalley.com
>>>
>>>
>>
>
>
> --
> Dimuthu Leelarathne
> Architect & Product Lead of App Factory
>
> WSO2, Inc. (http://wso2.com)
> email: dimut...@wso2.com
> Mobile : 0773661935
>
> Lean . Enterprise . Middleware
>



-- 
*Anuruddha Premalal*
Software Eng. | WSO2 Inc.
Mobile : +94710461070
Web site : www.regilandvalley.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Apache CXF - JAX-WS and JAX-RS issue for same endpoint

2015-01-08 Thread Prabath Abeysekera
Hi Asok,

Try posting this query in CXF mailing lists too and see if they'd be able
to help you out.

Cheers,
Prabath

On Thu, Jan 8, 2015 at 8:51 PM, Asok Perera  wrote:

> Hi,
>
> I need to implement JAX WS and JAX RS services to the same endpoint in CXF.
> Here, JAX WS will be used for a POST call, while JAX RS is for a GET.
>
> In the POST call there is a SOAP message as the body and GET call will be
> a normal REST call.
>
> My example cxf-servlet.xml looks like,
>
> *  *id="DiscoveryService"*
> *implementor="com.ex.soap.impl.DiscoveryServiceGetImpl"*
> *address="test/send"/>*
>
> **
> **
> **
> **
> **
> * class="com.ex.soap.impl.DiscoveryServiceGetImpl"/> *
>
> This doesn't work for POST, but only works for GET method.
>
> Does anyone know how to achieve this ?
>
> Note : When the endpoint addresses are different for JAX WS and JAX RS,
> the implementation works fine for both GET and POST. The issue occurs only
> when the endpoint addresses are the same.
>
> BR
>
> *Asok Aravinda Perera*
> Software Engineer
> WSO2, Inc.;http://wso2.com/
> 
> lean.enterprise.middleware
>
> Mobile: +94722241032
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Prabath Abeysekara
Associate Technical Lead, Data TG.
WSO2 Inc.
Email: praba...@wso2.com
Mobile: +94774171471
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Apache CXF - JAX-WS and JAX-RS issue for same endpoint

2015-01-08 Thread Asok Perera
Hi,

I need to implement JAX WS and JAX RS services to the same endpoint in CXF.
Here, JAX WS will be used for a POST call, while JAX RS is for a GET.

In the POST call there is a SOAP message as the body and GET call will be a
normal REST call.

My example cxf-servlet.xml looks like,

* *

**
**
**
**
**
* *

This doesn't work for POST, but only works for GET method.

Does anyone know how to achieve this ?

Note : When the endpoint addresses are different for JAX WS and JAX RS, the
implementation works fine for both GET and POST. The issue occurs only when
the endpoint addresses are the same.

BR

*Asok Aravinda Perera*
Software Engineer
WSO2, Inc.;http://wso2.com/

lean.enterprise.middleware

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


[Dev] Build Failure due to missing package in axiom 1.2.11.wso2v5

2015-01-08 Thread Pamod Sylvester
Hi All,

When building our product we're seeing the following issue,

Cannot complete the install because one or more required items could not be
found.
 Software being installed: WSO2 Carbon - Feature - Andes 4.3.0.SNAPSHOT
(org.wso2.carbon.andes.feature.group 4.3.0.SNAPSHOT)
* Missing requirement: axiom 1.2.11.wso2v5 (axiom 1.2.11.wso2v5) requires
'package org.w3c.dom 0.0.0' but it could not be found*
* Cannot satisfy dependency:*
*  From: axis2 1.6.1.wso2v11 (axis2 1.6.1.wso2v11)*
*  To: package javax.mail.internet 1.4.0*
* Cannot satisfy dependency:*
*  From: org.wso2.carbon.andes 4.3.0.SNAPSHOT (org.wso2.carbon.andes
4.3.0.SNAPSHOT)*
*  To: package org.apache.axis2.clustering [1.6.1.wso2v11,1.7.0)*
* Cannot satisfy dependency:*
*  From: WSO2 Carbon - Feature - Andes 4.3.0.SNAPSHOT
(org.wso2.carbon.andes.feature.group 4.3.0.SNAPSHOT)*
*  To: org.wso2.carbon.andes.server.feature.group [4.3.0.SNAPSHOT]*
* Cannot satisfy dependency:*
*  From: WSO2 Carbon - Feature - Andes - Server 4.3.0.SNAPSHOT
(org.wso2.carbon.andes.server.feature.group 4.3.0.SNAPSHOT)*
*  To: org.wso2.carbon.andes [4.3.0.SNAPSHOT]*

Also found some what slimier issues being pointed out in [1], but a proper
solution was not discussed. Please do advice. Also I've attached the full
log trace.

[1] http://www.eclipse.org/forums/index.php/t/373379/

Thanks,
Pamod

-- 
*Pamod Sylvester *
 *Senior Software Engineer *
Integration Technologies Team, WSO2 Inc.; http://wso2.com
email: pa...@wso2.com cell: +94 77 7779495
!SESSION 2015-01-08 17:44:54.517 ---
eclipse.buildId=unknown
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -application org.eclipse.equinox.p2.director -metadataRepository file:/home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/p2-repo -artifactRepository file:/home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/p2-repo -profileProperties org.eclipse.update.install.features=true -installIU org.wso2.carbon.logging.mgt.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.databridge.datapublisher.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.system.statistics.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.soaptracer.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.security.mgt.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.message.flows.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.tryit.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.registry.core.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.registry.ui.menu.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.registry.resource.properties.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.wsdl.tools.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.event.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.um.ws.service.server.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.andes.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.tenant.deployment.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.tenant.common.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.identity.authenticator.saml2.sso.server.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.tenant.usage.agent.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.tenant.throttling.agent.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.identity.authenticator.saml2.sso.ui.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.user.mgt.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.cassandra.datareader.feature.group/4.3.0.SNAPSHOT,org.wso2.mb.styles.feature.group/3.0.0.SNAPSHOT, -bundlepool /home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/wso2carbon-core-4.3.0-SNAPSHOT/repository/components -shared /home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/wso2carbon-core-4.3.0-SNAPSHOT/repository/components/p2 -destination /home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/wso2carbon-core-4.3.0-SNAPSHOT/repository/components/default -profile default -roaming
Command-line arguments:  -application org.eclipse.equinox.p2.director -metadataRepository file:/home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/p2-repo -artifactRepository file:/home/pamod/Desktop/dev/dev_playground/Release_Test_3.0.0/product-mb/modules/p2-profile/target/p2-repo -profileProperties org.eclipse.update.install.features=true -installIU org.wso2.carbon.logging.mgt.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.databridge.datapublisher.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.system.statistics.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.soaptracer.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.security.mgt.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.message.flows.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.tryit.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.registry.core.feature.group/4.3.0.SNAPSHOT,org.wso2.carbon.registry.ui.menu.feature.group/4.3.0.SNAPSHOT,org.wso2.ca

[Dev] bundles.info issue with carbon feature installation in Windows

2015-01-08 Thread Dulanja Liyanage
Hi All,

When a feature is installed while in Windows and then renamed the pack or
moved the pack to another platform (e.g. Linux), I have experienced issues
with class loading (sometimes CNF exceptions) of the new components that
got installed from that feature.

It seems in Windows the jar path in bundles.info contains a path with
shorthand folder names:

e.g.
org.wso2.carbon.identity.application.authenticator.facebook.v2,4.2.0,../../../../../
*WSO2IS~1.0*
/repository/components/plugins/org.wso2.carbon.identity.application.authenticator.facebook.v2_4.2.0.jar,4,true

*wso2is-5.0.0 is taken as WSO2IS~1.0*

So, when the pack is renamed or moved to another platform that particular
jar couldn't be retrieved from that path.

I have opened a JIRA for this [1].

[1] https://wso2.org/jira/browse/CARBON-15132

Thanks
Dulanja
-- 
Dulanja Liyanage
WSO2 Inc.
M: +94776764717
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Making AF_RESOURECE.RESOURCE_NMAE a unique value

2015-01-08 Thread Dimuthu Leelarathne
Hi all,

I ran through the complete script. Adding to what Danushka said the
uniqueness should be (APPLICATION_ID, RESOURCE_TYPE, RESOURCE_NAME,
ENVIRONMENT)

thanks,
dimuthu

On Thu, Jan 8, 2015 at 5:36 PM, Danushka Fernando 
wrote:

> Moved to dev@ since this is a dev matter.
>
> I think what unique should be is (APPLICATION_ID, RESOURCE_NAME,
> ENVIRONMENT). No point in making RESOURCE_NAME field alone unique.
> Because an user should be able to create a resource with same name in a
> different environement/stage or different application.
>
> Thanks & Regards
> Danushka Fernando
> Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729
>
> On Thu, Jan 8, 2015 at 4:35 PM, Anuruddha Premalal 
> wrote:
>
>> Hi,
>>
>> In creating a datadabse/datasource/databse_user/databse_template we
>> update the AF_RESOURCE table(in afdb) with the following parameters.
>>
>> APPLICATION_ID
>> RESOURCE_TYPE
>> RESOURCE_NAME
>> ENVIRONMENT
>> DESCRIPTION
>>
>> Since duplication should not be allowed in any of the appfactory
>> resources, shall we make the RESOURCE_NAME field unique?. This will require
>> a data migration for cloud as well.
>>
>>
>> Regards,
>> --
>> *Anuruddha Premalal*
>> Software Eng. | WSO2 Inc.
>> Mobile : +94710461070
>> Web site : www.regilandvalley.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


Re: [Dev] Scatter Plots of PCA

2015-01-08 Thread Srinath Perera
And very good job paying attention to detail and double checking Upul!

On Thu, Jan 8, 2015 at 7:04 PM, Srinath Perera  wrote:

> pls send this mails to mailing list .. dev@
>
> write to Spark list and ask why.
>
> --Srinath
>
> On Wed, Jan 7, 2015 at 3:09 PM, Upul Bandara  wrote:
>
>> Hi Srinath,
>>
>> Attached, please find the scatter plots of PCA
>> (using Spark API and Julia) for the irish dataset.
>>
>> Thanks,
>> Upul
>>
>> --
>> Upul Bandara,
>> Mob: +94 715 468 345.
>>
>
>
>
> --
> 
> Blog: http://srinathsview.blogspot.com twitter:@srinath_perera
> Site: http://people.apache.org/~hemapani/
> Photos: http://www.flickr.com/photos/hemapani/
> Phone: 0772360902
>



-- 

Blog: http://srinathsview.blogspot.com twitter:@srinath_perera
Site: http://people.apache.org/~hemapani/
Photos: http://www.flickr.com/photos/hemapani/
Phone: 0772360902
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] WSO2 Android Projects

2015-01-08 Thread Kartik Khare
Hi all,
I have been going through the code of *wso2 emm agent *and would like to
know if the any functionality needs to be added to the app or any other
android project or module which you are working upon in which i can
contribute.

My github profile is:
https://github.com/KKcorps

and linkedIn profile is:
in.linkedin.com/pub/kartik-khare/7a/68b/751/

Thanks & Regards,
Kartik Khare
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Scatter Plots of PCA

2015-01-08 Thread Srinath Perera
pls send this mails to mailing list .. dev@

write to Spark list and ask why.

--Srinath

On Wed, Jan 7, 2015 at 3:09 PM, Upul Bandara  wrote:

> Hi Srinath,
>
> Attached, please find the scatter plots of PCA
> (using Spark API and Julia) for the irish dataset.
>
> Thanks,
> Upul
>
> --
> Upul Bandara,
> Mob: +94 715 468 345.
>



-- 

Blog: http://srinathsview.blogspot.com twitter:@srinath_perera
Site: http://people.apache.org/~hemapani/
Photos: http://www.flickr.com/photos/hemapani/
Phone: 0772360902
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Making AF_RESOURECE.RESOURCE_NMAE a unique value

2015-01-08 Thread Danushka Fernando
Moved to dev@ since this is a dev matter.

I think what unique should be is (APPLICATION_ID, RESOURCE_NAME, ENVIRONMENT).
No point in making RESOURCE_NAME field alone unique. Because an user should
be able to create a resource with same name in a different
environement/stage or different application.

Thanks & Regards
Danushka Fernando
Software Engineer
WSO2 inc. http://wso2.com/
Mobile : +94716332729

On Thu, Jan 8, 2015 at 4:35 PM, Anuruddha Premalal 
wrote:

> Hi,
>
> In creating a datadabse/datasource/databse_user/databse_template we update
> the AF_RESOURCE table(in afdb) with the following parameters.
>
> APPLICATION_ID
> RESOURCE_TYPE
> RESOURCE_NAME
> ENVIRONMENT
> DESCRIPTION
>
> Since duplication should not be allowed in any of the appfactory
> resources, shall we make the RESOURCE_NAME field unique?. This will require
> a data migration for cloud as well.
>
>
> Regards,
> --
> *Anuruddha Premalal*
> Software Eng. | WSO2 Inc.
> Mobile : +94710461070
> Web site : www.regilandvalley.com
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Payload mediation of JSON message using Script Mediator

2015-01-08 Thread Buddhima Wijeweera
Hi Maz,

There's a problem with the JS script. It should be like follows:

 var older = mc.getPayloadJSON(); var
newer={"IP_Address":older['origin']}; mc.setPayloadJSON(newer);


I tried the following API (with ESB 4.8.1) to make the situation quite
similar to yours :


  
 

   


 
 

   

var older = mc.getPayloadJSON();var
newer={"IP_Address":older['origin']};mc.setPayloadJSON(newer);

 
  
   


Following image shows the request and the response:


​



For your reference I would like to point out following link:
http://www.w3schools.com/js/js_json.asp

Thank You!



On Thu, Jan 8, 2015 at 12:47 PM, Malaka Silva  wrote:

> Hi Maz,
>
> Since you need to generate payload dynamically you can use script mediator
> for that purpose.
>
> On Thu, Jan 8, 2015 at 12:23 AM, Maz Lakadia  wrote:
>
>> I will be mapping resources that are in a particular format into another
>> format. This means I will have a lot of template mappings that I could load
>> into script mediator and let it use the appropriate one for the task. I am
>> unsure of how I could do that will payload factory mediator. Do you have
>> any clues?
>>
>> --
>> Date: Wed, 7 Jan 2015 09:07:13 +0530
>> Subject: Re: [Dev] Payload mediation of JSON message using Script Mediator
>> From: va...@wso2.com
>> To: awanth...@wso2.com
>> CC: mlaka...@hotmail.com; dev@wso2.org
>>
>>
>> What is the real motivation you to use script mediator instead of payload
>> factory?
>>
>> You can easly construct jaon payload with payload factory
>>
>> On Wednesday, January 7, 2015, Awanthika Senarath 
>> wrote:
>>
>> Hi Maz,
>>
>> Can you follow the format at [1] and see whether it works? This explains
>> the sample 351 in ESB.
>>
>> [1]
>> https://docs.wso2.com/display/ESB480/Sample+351%3A+Inline+script+mediation+with+JavaScript
>> 
>>
>> On Wed, Jan 7, 2015 at 4:03 AM, Maz Lakadia  wrote:
>>
>> Hi, I'm using script mediator to mediate the response payload from my
>> server. The unmediated response is:
>>
>> {"origin":"202.37.75.130"}
>>
>> I then add in a mediator via source code, that should change "origin" to
>> "IP_Address":
>>
>> 
>> > old_payload = mc.getPayloadJSON();
>> payload["IP_Address"] = old_payload["origin"];
>> mc.setPayloadJSON(payload);
>> ]]>
>> 
>> 
>> > expression="get-property('CORS_ORIGIN')" scope="transport"/>
>> > value="Assertion,X-Jwt-Assertion,X-User-Name,X-User-Domain"
>> scope="transport"/>
>> 
>> 
>> 
>> 
>>
>> However, my response remains unchanged (same as the unmediated response).
>> I do not know how I can fix this. Is there an error I am making?
>>
>> Thanks,
>> Maz
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>>
>>
>> --
>> Awanthika Senarath
>> Software Engineer, WSO2 Inc.
>> Mobile: +94717681791
>>
>>
>>
>>
>> --
>> Sent from Gmail Mobile
>>
>> ___
>> 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/
> 
>
> 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
>
>


-- 
Buddhima Wijeweera
Software Engineer; WSO2 Inc.; http://wso2.com ,

Mobile: +94 71 427 9966
Email: buddh...@wso2.com
Blog:   https://buddhimawijeweera.wordpress.com
GitHub Profile: https://github.com/Buddhima
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [EMM] Errors occur on Server Shutdown when building the Product

2015-01-08 Thread Dilan Udara Ariyaratne
Hi Kishanthan,

I checked on a separate manual server shutdown and it seems to be fine.
No errors appear as in this case.

Regards,
Dilan.


*Dilan U. Ariyaratne*
Software Engineer
WSO2 Inc. 
Mobile: +94775149066
lean . enterprise . middleware

On Thu, Jan 8, 2015 at 2:26 PM, Dilan Udara Ariyaratne 
wrote:

> Hi Kishanthan,
>
> I am doing a dummy device registration at server-side to check whether the
> registration functionality
> works fine with an ORACLE connection.
>
> I will check whether a normal server shutdown also brings out these
> exceptions, to isolate the issue from automation framework.
>
> Thanks for the feedback.
>
>
>
> *Dilan U. Ariyaratne*
> Software Engineer
> WSO2 Inc. 
> Mobile: +94775149066
> lean . enterprise . middleware
>
> On Thu, Jan 8, 2015 at 1:43 PM, Kishanthan Thangarajah <
> kishant...@wso2.com> wrote:
>
>> The root cause here is  : "java.lang.SecurityException: Illegal access
>> attempt by  tenant[-1] to sessions owned by tenant[-1234]"
>>
>> This is because the CarbonContext is is not populated with the tenant
>> information on showdown path which leads to this. There can be multiple
>> reasons. Can you isolate this issue from automation framework, by manually
>> starting and stopping the EMM server? Also what are you doing within the
>> test case here?
>>
>>
>>
>> On Tue, Jan 6, 2015 at 2:17 PM, Dilan Udara Ariyaratne 
>> wrote:
>>
>>> Hi Folks,
>>>
>>> I have been working on writing a test case for the device registration
>>> use-case of EMM with Oracle Support.
>>> When I built the product with the test, every thing ran well with a
>>> build success message except
>>> the server shutdown.
>>>
>>> Following is the stack trace of it...
>>>
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> [2015-01-06 14:03:25,696] ERROR
>>> {org.apache.axis2.deployment.DeploymentEngine} -  Error occurred while
>>> cleaning up deployer
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> org.apache.axis2.deployment.DeploymentException: Error occurred during
>>> cleaning up webapps
>>> 
>>> 
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at java.lang.Thread.run(Thread.java:662)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> Caused by: org.wso2.carbon.CarbonException: Cannot lazy unload webapp
>>> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/store-admin]
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:379)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:354)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.lazyUnload(TomcatGenericWebappsDeployer.java:379)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.cleanup(AbstractWebappDeployer.java:259)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> ... 44 more
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> Caused by: org.apache.catalina.LifecycleException: Failed to stop component
>>> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/store-admin]]
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:365)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> ... 47 more
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> Caused by: org.apache.catalina.LifecycleException: Failed to stop component
>>> [org.wso2.carbon.webapp.mgt.CarbonTomcatSessionManager[/store-admin]]
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
>>> INFO
>>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> at
>>> org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java

Re: [Dev] [EMM] Errors occur on Server Shutdown when building the Product

2015-01-08 Thread Dilan Udara Ariyaratne
Hi Kishanthan,

I am doing a dummy device registration at server-side to check whether the
registration functionality
works fine with an ORACLE connection.

I will check whether a normal server shutdown also brings out these
exceptions, to isolate the issue from automation framework.

Thanks for the feedback.



*Dilan U. Ariyaratne*
Software Engineer
WSO2 Inc. 
Mobile: +94775149066
lean . enterprise . middleware

On Thu, Jan 8, 2015 at 1:43 PM, Kishanthan Thangarajah 
wrote:

> The root cause here is  : "java.lang.SecurityException: Illegal access
> attempt by  tenant[-1] to sessions owned by tenant[-1234]"
>
> This is because the CarbonContext is is not populated with the tenant
> information on showdown path which leads to this. There can be multiple
> reasons. Can you isolate this issue from automation framework, by manually
> starting and stopping the EMM server? Also what are you doing within the
> test case here?
>
>
>
> On Tue, Jan 6, 2015 at 2:17 PM, Dilan Udara Ariyaratne 
> wrote:
>
>> Hi Folks,
>>
>> I have been working on writing a test case for the device registration
>> use-case of EMM with Oracle Support.
>> When I built the product with the test, every thing ran well with a build
>> success message except
>> the server shutdown.
>>
>> Following is the stack trace of it...
>>
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> [2015-01-06 14:03:25,696] ERROR
>> {org.apache.axis2.deployment.DeploymentEngine} -  Error occurred while
>> cleaning up deployer
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> org.apache.axis2.deployment.DeploymentException: Error occurred during
>> cleaning up webapps
>> 
>> 
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at java.lang.Thread.run(Thread.java:662)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> Caused by: org.wso2.carbon.CarbonException: Cannot lazy unload webapp
>> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/store-admin]
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:379)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:354)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.lazyUnload(TomcatGenericWebappsDeployer.java:379)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.cleanup(AbstractWebappDeployer.java:259)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> ... 44 more
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> Caused by: org.apache.catalina.LifecycleException: Failed to stop component
>> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/store-admin]]
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:365)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> ... 47 more
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> Caused by: org.apache.catalina.LifecycleException: Failed to stop component
>> [org.wso2.carbon.webapp.mgt.CarbonTomcatSessionManager[/store-admin]]
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at
>> org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5474)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> ... 48 more
>> INFO
>> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> Caused by: java.lang.SecurityException: Illegal access attempt by
>> tenant[-1] to sessions owned by tenant[-1234]
>> INFO
>> [org.

Re: [Dev] [EMM] Errors occur on Server Shutdown when building the Product

2015-01-08 Thread Kishanthan Thangarajah
The root cause here is  : "java.lang.SecurityException: Illegal access
attempt by  tenant[-1] to sessions owned by tenant[-1234]"

This is because the CarbonContext is is not populated with the tenant
information on showdown path which leads to this. There can be multiple
reasons. Can you isolate this issue from automation framework, by manually
starting and stopping the EMM server? Also what are you doing within the
test case here?



On Tue, Jan 6, 2015 at 2:17 PM, Dilan Udara Ariyaratne 
wrote:

> Hi Folks,
>
> I have been working on writing a test case for the device registration
> use-case of EMM with Oracle Support.
> When I built the product with the test, every thing ran well with a build
> success message except
> the server shutdown.
>
> Following is the stack trace of it...
>
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> [2015-01-06 14:03:25,696] ERROR
> {org.apache.axis2.deployment.DeploymentEngine} -  Error occurred while
> cleaning up deployer
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> org.apache.axis2.deployment.DeploymentException: Error occurred during
> cleaning up webapps
> 
> 
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at java.lang.Thread.run(Thread.java:662)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> Caused by: org.wso2.carbon.CarbonException: Cannot lazy unload webapp
> StandardEngine[Catalina].StandardHost[localhost].StandardContext[/store-admin]
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:379)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:354)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.lazyUnload(TomcatGenericWebappsDeployer.java:379)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.cleanup(AbstractWebappDeployer.java:259)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> ... 44 more
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> Caused by: org.apache.catalina.LifecycleException: Failed to stop component
> [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/store-admin]]
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.WebApplication.lazyUnload(WebApplication.java:365)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> ... 47 more
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> Caused by: org.apache.catalina.LifecycleException: Failed to stop component
> [org.wso2.carbon.webapp.mgt.CarbonTomcatSessionManager[/store-admin]]
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:236)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5474)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> ... 48 more
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> Caused by: java.lang.SecurityException: Illegal access attempt by
> tenant[-1] to sessions owned by tenant[-1234]
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.CarbonTomcatSessionManager.checkAccess(CarbonTomcatSessionManager.java:126)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.wso2.carbon.webapp.mgt.CarbonTomcatSessionManager.findSessions(CarbonTomcatSessionManager.java:78)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> at
> org.apache.catalina.session.StandardManager.stopInternal(StandardManager.java:525)
> INFO
> [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReade