Re: [Dev] Issue in processing certain integer values in data mapper

2016-06-10 Thread Viraj Rajaguru
Hi Sohani,

+1 for suggestion. This will solve the same issue we are solving
with synapse.commons.json.json.output.autoPrimitive
and synapse.commons.json.json.output.disableAutoPrimitive.regex in
synapse.properties file while XML to JSON conversion in ESB. With
Datamapper we will have more flexibility since we can set the 'Type' per
attribute.

Thanks,
Viraj.

On Fri, Jun 10, 2016 at 4:59 PM, Sohani Weerasinghe  wrote:

> Hi All,
>
> Since there is already a feature to edit the properties of a particular
> tree node, we can use that to change the data type
>
> Thanks,
> Sohani
>
> Sohani Weerasinghe
> Senior Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
> On Fri, Jun 10, 2016 at 11:26 AM, Sohani Weerasinghe 
> wrote:
>
>> Hi All,
>>
>> If we consider a payload which has values such as telephone numbers,
>> userID, house no etc, when generating the JSON schema they are treated as
>> "numbers".
>>
>> When user tries to map the payload, final generated outcome displays as a
>> double value.
>>
>> eg: If we pass an object as below, the output comes as 1.12655655E8 which
>> is wrong.
>>
>> 
>>   0112655655
>>   01
>>
>>
>> AFAIU, before generating the mapping config user should be provided with
>> an option to change the data type of that particular field into String. As
>> a solution I think we should provide a property so that user can change the
>> type. WDYT?
>>
>> Thanks,
>> Sohani
>>
>> Sohani Weerasinghe
>> Senior Software Engineer
>> WSO2, Inc: http://wso2.com
>>
>> Mobile  : +94 716439774
>> Blog :http://christinetechtips.blogspot.com/
>> Twitter  : https://twitter.com/sohanichristine
>>
>
>


-- 
Viraj Rajaguru
Associate Technical Lead
WSO2 Inc. : http://wso2.com

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


Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Kavith Lokuhewage
Hi,

On an additional note, this is a major drawback that we have with several
components in DevStudio. While trying to improve artfact.xml and pom.xml
handling components, we recently came across [1], which is based on the
concept of non extractive parsing[2]. Unfortunately this is licensed with
GPL2 hence we cannot distribute it Apache license. I could not find a
similar library with a compatible license.
So either we can implement a framework with a similar algorithm or we need
to go for complex regex based text replacing - if we cannot find any
alternative.

Thanks,

[1] http://vtd-xml.sourceforge.net/
[2] http://www.xml.com/pub/a/2004/05/19/parsing.html

*Kavith Lokuhewage*
Senior Software Engineer
WSO2 Inc. - http://wso2.com
lean . enterprise . middleware
Mobile - +94779145123
Linkedin   Twitter


On Sat, Jun 11, 2016 at 10:57 AM, Viraj Rajaguru  wrote:

> Hi Rajeevan,
>
> I think we have two issues.
>
> 1. The way attributes are ordered in generated source is not readable. Eg:
> Property name should come before the Property expression.
>
> This is a valid requirement and we will try to fix in a future release.
> (not in the next immediate release). We will need to find a correct XML
> processing library as Nuwan & Susinda mentioned.
>
> 2. Changes done in source view such as formatting, commenting, ordering of
> elements/attributes etc. will be overridden by switching between graphical
> view and source view.
>
> This is a more critical issue which tends users to move from Graphical
> editor to default XML editor. Currently we are regenerating the whole
> source according to what we have in graphical view. This will lead to
> override users's changes such as formatting, commenting. What we should do
> is to modify the existing source in source view according to the changes we
> have done is graphical view rather regenerating the whole source so that we
> will not loose anything we've done in the source view.
>
> Thanks for pointing these issues and we will fix these in future releases.
>
> Thanks,
> Viraj.
>
> On Sat, Jun 11, 2016 at 9:08 AM, Vimalanathan Rajeevan  > wrote:
>
>> Thanks Nuwan and Susinda for your prompt responses.
>>
>> I would say it is a nice to have thing rather not a blocker for Developer
>> Studio. Here the issue is user can not keep desired attribute order when
>> using Graphical Editor(when switching between Design and Source view it is
>> getting overwritten). IMO, even though attribute order does not matter in
>> XML programming it is important for better readability as I explained
>> above. I have seen some users are using Eclipse default XML editor for
>> programming because of this kind of issues with Graphical Editor. But I
>> understand the difficulty of fixing this issue with available XML
>> processing libraries. So if possible we can give a try to fix this[1]. WDYT?
>>
>> [1] https://wso2.org/jira/browse/DEVTOOLESB-374
>>
>> Thanks,
>> Rajeevan
>>
>> On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera  wrote:
>>
>>> Hi Rajeevan
>>>
>>> I have google a bit on this issue in general. It seems like normal DOM
>>> does not care about the attribute order. Also I believe xml schemas would
>>> also not care about the order[1]. We have to test this whether we have any
>>> support in axiom level. As this requirement is valid in terms of end user,
>>> please create a JIRA to track this. Kavith is looking at some other xml
>>> processing library, may be he can hive some input.
>>>
>>> [1] - https://www.w3.org/TR/REC-xml/#sec-starttags
>>>
>>> On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
>>> rajeev...@wso2.com> wrote:
>>>
 Hi,

 I will explain the issue with the help of Property Mediator. When we
 are adding a property with an expression to a sequence in Graphical Editor,
 the source view for that mediator is as follows,

 >>>   name="TestProperty" xmlns:m0="http://services.samples;
 xmlns:m1=" http://services.samples/xsd "/>

 Here 'expression' is positioned before 'name' of the mediator. IMHO,
 'name' should be positioned before 'expression'(for better readability) and
 we should try to keep the order as below(from ESB Doc),

 >>> "literal" | expression="xpath") 
 [scope=default|transport|axis2|axis2-client]
 [pattern="regex" [group="integer"]]>
 ?
 

 So I tried to change it from source view but when I switching between
 graphical and source views my changes are removed and ordered by
 alphabetically. It is giving difficulties when we are using Graphical
 Editor and trying to keep some conventions.
 It should be a known issue. Will we be able to fix this?

 Appreciate your thoughts on this.

 --
 Vimalanathan Rajeevan
 Software Engineer,
 WSO2, Inc. *http://wso2.com* 

Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Viraj Rajaguru
Hi Rajeevan,

I think we have two issues.

1. The way attributes are ordered in generated source is not readable. Eg:
Property name should come before the Property expression.

This is a valid requirement and we will try to fix in a future release.
(not in the next immediate release). We will need to find a correct XML
processing library as Nuwan & Susinda mentioned.

2. Changes done in source view such as formatting, commenting, ordering of
elements/attributes etc. will be overridden by switching between graphical
view and source view.

This is a more critical issue which tends users to move from Graphical
editor to default XML editor. Currently we are regenerating the whole
source according to what we have in graphical view. This will lead to
override users's changes such as formatting, commenting. What we should do
is to modify the existing source in source view according to the changes we
have done is graphical view rather regenerating the whole source so that we
will not loose anything we've done in the source view.

Thanks for pointing these issues and we will fix these in future releases.

Thanks,
Viraj.

On Sat, Jun 11, 2016 at 9:08 AM, Vimalanathan Rajeevan 
wrote:

> Thanks Nuwan and Susinda for your prompt responses.
>
> I would say it is a nice to have thing rather not a blocker for Developer
> Studio. Here the issue is user can not keep desired attribute order when
> using Graphical Editor(when switching between Design and Source view it is
> getting overwritten). IMO, even though attribute order does not matter in
> XML programming it is important for better readability as I explained
> above. I have seen some users are using Eclipse default XML editor for
> programming because of this kind of issues with Graphical Editor. But I
> understand the difficulty of fixing this issue with available XML
> processing libraries. So if possible we can give a try to fix this[1]. WDYT?
>
> [1] https://wso2.org/jira/browse/DEVTOOLESB-374
>
> Thanks,
> Rajeevan
>
> On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera  wrote:
>
>> Hi Rajeevan
>>
>> I have google a bit on this issue in general. It seems like normal DOM
>> does not care about the attribute order. Also I believe xml schemas would
>> also not care about the order[1]. We have to test this whether we have any
>> support in axiom level. As this requirement is valid in terms of end user,
>> please create a JIRA to track this. Kavith is looking at some other xml
>> processing library, may be he can hive some input.
>>
>> [1] - https://www.w3.org/TR/REC-xml/#sec-starttags
>>
>> On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
>> rajeev...@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> I will explain the issue with the help of Property Mediator. When we are
>>> adding a property with an expression to a sequence in Graphical Editor, the
>>> source view for that mediator is as follows,
>>>
>>> >>   name="TestProperty" xmlns:m0="http://services.samples;
>>> xmlns:m1=" http://services.samples/xsd "/>
>>>
>>> Here 'expression' is positioned before 'name' of the mediator. IMHO,
>>> 'name' should be positioned before 'expression'(for better readability) and
>>> we should try to keep the order as below(from ESB Doc),
>>>
>>> >> "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
>>> [pattern="regex" [group="integer"]]>
>>> ?
>>> 
>>>
>>> So I tried to change it from source view but when I switching between
>>> graphical and source views my changes are removed and ordered by
>>> alphabetically. It is giving difficulties when we are using Graphical
>>> Editor and trying to keep some conventions.
>>> It should be a known issue. Will we be able to fix this?
>>>
>>> Appreciate your thoughts on this.
>>>
>>> --
>>> Vimalanathan Rajeevan
>>> Software Engineer,
>>> WSO2, Inc. *http://wso2.com* 
>>> Lean.Enterprise.Middleware
>>>
>>> Mobile:
>>> *+94 773090875 <%2B94%20773090875>*
>>> LinkedIn:
>>> *https://www.linkedin.com/in/RajeevanVimalanathan
>>> *
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Susinda Perera*
>> Software Engineer
>> B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
>> Mobile:(+94)716049075
>> Blog: susinda.blogspot.com
>> WSO2 Inc. http://wso2.com/
>> Tel : 94 11 214 5345 Fax :94 11 2145300
>>
>>
>
>
> --
> Vimalanathan Rajeevan
> Software Engineer,
> WSO2, Inc. *http://wso2.com* 
> Lean.Enterprise.Middleware
>
> Mobile:
> *+94 773090875 <%2B94%20773090875>*
> LinkedIn:
> *https://www.linkedin.com/in/RajeevanVimalanathan
> *
>



-- 
Viraj Rajaguru
Associate Technical Lead
WSO2 Inc. : http://wso2.com

Mobile: +94 77 3683068
___
Dev mailing list
Dev@wso2.org

Re: [Dev] [IS 510] Keystore configs required in multiple locations

2016-06-10 Thread Udara Liyanage
Hi Malith,

I removed that file from a fresh pack and started the server and found web
app deployment error.

at java.lang.Thread.run(Thread.java:745)
[2016-06-11 10:11:08,811] ERROR
{org.wso2.carbon.tomcat.internal.CarbonTomcat} -  Webapp
StandardEngine[Catalina].StandardHost[localhost].StandardContext[/authenticationendpoint]
failed to deploy
[2016-06-11 10:11:08,812] ERROR
{org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer} -  Error while
deploying webapp:
StandardContext[authenticationendpoint.war].File[/home/udara/software/wso2/wso2is-5.1.0/repository/deployment/server/webapps/authenticationendpoint.war]
org.wso2.carbon.tomcat.CarbonTomcatException: Webapp failed to deploy
at
org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:302)
at
org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:198)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:314)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:212)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.java:179)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:144)
at
org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deployThisWebApp(AbstractWebappDeployer.java:224)
at
org.wso2.carbon.webapp.mgt.AbstractWebappDeployer.deploy(AbstractWebappDeployer.java:114)
at
org.wso2.carbon.webapp.deployer.WebappDeployer.deploy(WebappDeployer.java:42)
at
org.apache.axis2.deployment.repository.util.DeploymentFileData.deploy(DeploymentFileData.java:136)
at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:807)
at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:144)
at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:377)
at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:254)
at
org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:135)
at
org.wso2.carbon.core.CarbonAxisConfigurator.deployServices(CarbonAxisConfigurator.java:567)
at
org.wso2.carbon.core.internal.DeploymentServerStartupObserver.completingServerStartup(DeploymentServerStartupObserver.java:51)
at
org.wso2.carbon.core.internal.CarbonCoreServiceComponent.notifyBefore(CarbonCoreServiceComponent.java:238)
at
org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.completeInitialization(StartupFinalizerServiceComponent.java:185)
at
org.wso2.carbon.core.internal.StartupFinalizerServiceComponent.serviceChanged(StartupFinalizerServiceComponent.java:288)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(BundleContextImpl.java:861)
at
org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at
org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:819)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:771)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:130)
at
org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:214)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:433)
at
org.eclipse.osgi.framework.internal.core.BundleContextImpl.registerService(BundleContextImpl.java:451)
at
org.wso2.carbon.server.admin.internal.ServerAdminServiceComponent.activate(ServerAdminServiceComponent.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.eclipse.equinox.internal.ds.model.ServiceComponent.activate(ServiceComponent.java:260)
at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.activate(ServiceComponentProp.java:146)
at
org.eclipse.equinox.internal.ds.model.ServiceComponentProp.build(ServiceComponentProp.java:345)
at
org.eclipse.equinox.internal.ds.InstanceProcess.buildComponent(InstanceProcess.java:620)
at
org.eclipse.equinox.internal.ds.InstanceProcess.buildComponents(InstanceProcess.java:197)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:343)
at
org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at
org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:107)
at

Re: [Dev] Exception handling in Spark UDF

2016-06-10 Thread Sachith Withana
If you need to skip the rows that would be throwing the exception, as you
said, you'd have to do that in a where clause.
If there's a scenario where you need to transform the values and use in a
SELECT statement, use a subquery and filter out the unwanted rows.

ex:

SELECT date FROM ( SELECT dateConvertor(timestamp, "MM/dd/ HH:mm",
"HOUR") as date FROM eventStatData) Where date != "";

On Fri, Jun 10, 2016 at 2:25 PM, Dulitha Wijewantha 
wrote:

> The default value will work for scenarios where we are using the function
> on a where clause. There is also another scenario where you use it to
> transform the value in the select. In the below query - if we put a default
> value it will be returned by the result set rather than ignoring it.
>
> select sessionKey as sessionKey,  dateFormatter(timestamp, "MM/dd/
> HH:mm", "-MM-dd:HH") as dateDisplay, appKey as appKey, clientModel as
> role, dateConvertor(timestamp, "MM/dd/ HH:mm", "HOUR") as date  from
> eventStatData
>
> On Fri, Jun 10, 2016 at 12:10 AM, Gimantha Bandara 
> wrote:
>
>> You will have to catch the exception inside the method itself and log a
>> warning/error meesage and return a default value without throwing the
>> exception out from the method.
>>
>>
>> On Friday, June 10, 2016, Dulitha Wijewantha  wrote:
>>
>>> Below is an example usage -
>>>
>>> insert overwrite table TABLE_NAME select date, count(distinct
>>> sessionKey) as activity, appKey, role, first(y.dateDisplay) as dateDisplay
>>> from (select sessionKey as sessionKey,  dateFormatter(timestamp,
>>> "MM/dd/ HH:mm", "-MM-dd:HH") as dateDisplay, appKey as appKey,
>>> clientModel as role, dateConvertor(timestamp, "MM/dd/ HH:mm", "HOUR")
>>> as date  from eventStatData) as y group by y.date, y.appKey, y.role;
>>>
>>>
>>>
>>> On Thu, Jun 9, 2016 at 4:13 PM, Sachith Withana 
>>> wrote:
>>>
 Hi Dulitha,

 Can you provide the query that you are using?

 That would help us give you a better solution I guess.

 Regards,
 Sachith

 On Thu, Jun 9, 2016 at 2:34 PM, Dulitha Wijewantha 
 wrote:

> Hi guys,
> I have written a customer Spark UDF function that allows me to convert
> a date string to a given input format. If there is a ParseException due to
> input being invalid - the whole spark script will stop execution. Is there
> away to skip that particular iteration and move on to the next in the
> record? (this function is used in where clauses). Or is there a better
> recommendation for this? Like validation in the EventReceiver?
>
> public String dateFormatter(String input, String fromFormat, String
> toFormat) throws ParseException{
> SimpleDateFormat sdf = new SimpleDateFormat(fromFormat);
> Date date = sdf.parse(input);
> SimpleDateFormat newFormatter = new SimpleDateFormat(toFormat);
> return newFormatter.format(date);
> }
>
> Cheers~
>
> --
> Dulitha Wijewantha (Chan)
> Software Engineer - Mobile Development
> WSO2 Inc
> Lean.Enterprise.Middleware
>  * ~Email   duli...@wso2.com*
> *  ~Mobile +94712112165 <%2B94712112165>*
> *  ~Website   dulitha.me *
> *  ~Twitter @dulitharw *
>   *~Github @dulichan *
>   *~SO @chan *
>



 --
 Sachith Withana
 Software Engineer; WSO2 Inc.; http://wso2.com
 E-mail: sachith AT wso2.com
 M: +94715518127
 Linked-In: 
 https://lk.linkedin.com/in/sachithwithana

>>>
>>>
>>>
>>> --
>>> Dulitha Wijewantha (Chan)
>>> Software Engineer - Mobile Development
>>> WSO2 Inc
>>> Lean.Enterprise.Middleware
>>>  * ~Email   duli...@wso2.com*
>>> *  ~Mobile +94712112165 <%2B94712112165>*
>>> *  ~Website   dulitha.me *
>>> *  ~Twitter @dulitharw *
>>>   *~Github @dulichan *
>>>   *~SO @chan *
>>>
>>
>>
>> --
>> Gimantha Bandara
>> Software Engineer
>> WSO2. Inc : http://wso2.com
>> Mobile : +94714961919
>>
>>
>
>
> --
> Dulitha Wijewantha (Chan)
> Software Engineer - Mobile Development
> WSO2 Inc
> Lean.Enterprise.Middleware
>  * ~Email   duli...@wso2.com *
> *  ~Mobile +94712112165 <%2B94712112165>*
> *  ~Website   dulitha.me *
> *  ~Twitter @dulitharw *
>   *~Github @dulichan *
>   *~SO @chan *
>



-- 
Sachith Withana
Software Engineer; WSO2 Inc.; http://wso2.com
E-mail: sachith AT wso2.com
M: +94715518127
Linked-In: https://lk.linkedin.com/in/sachithwithana

Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Vimalanathan Rajeevan
Thanks Nuwan and Susinda for your prompt responses.

I would say it is a nice to have thing rather not a blocker for Developer
Studio. Here the issue is user can not keep desired attribute order when
using Graphical Editor(when switching between Design and Source view it is
getting overwritten). IMO, even though attribute order does not matter in
XML programming it is important for better readability as I explained
above. I have seen some users are using Eclipse default XML editor for
programming because of this kind of issues with Graphical Editor. But I
understand the difficulty of fixing this issue with available XML
processing libraries. So if possible we can give a try to fix this[1]. WDYT?

[1] https://wso2.org/jira/browse/DEVTOOLESB-374

Thanks,
Rajeevan

On Fri, Jun 10, 2016 at 1:00 AM, Susinda Perera  wrote:

> Hi Rajeevan
>
> I have google a bit on this issue in general. It seems like normal DOM
> does not care about the attribute order. Also I believe xml schemas would
> also not care about the order[1]. We have to test this whether we have any
> support in axiom level. As this requirement is valid in terms of end user,
> please create a JIRA to track this. Kavith is looking at some other xml
> processing library, may be he can hive some input.
>
> [1] - https://www.w3.org/TR/REC-xml/#sec-starttags
>
> On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan <
> rajeev...@wso2.com> wrote:
>
>> Hi,
>>
>> I will explain the issue with the help of Property Mediator. When we are
>> adding a property with an expression to a sequence in Graphical Editor, the
>> source view for that mediator is as follows,
>>
>> >   name="TestProperty" xmlns:m0="http://services.samples;
>> xmlns:m1=" http://services.samples/xsd "/>
>>
>> Here 'expression' is positioned before 'name' of the mediator. IMHO,
>> 'name' should be positioned before 'expression'(for better readability) and
>> we should try to keep the order as below(from ESB Doc),
>>
>> > "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
>> [pattern="regex" [group="integer"]]>
>> ?
>> 
>>
>> So I tried to change it from source view but when I switching between
>> graphical and source views my changes are removed and ordered by
>> alphabetically. It is giving difficulties when we are using Graphical
>> Editor and trying to keep some conventions.
>> It should be a known issue. Will we be able to fix this?
>>
>> Appreciate your thoughts on this.
>>
>> --
>> Vimalanathan Rajeevan
>> Software Engineer,
>> WSO2, Inc. *http://wso2.com* 
>> Lean.Enterprise.Middleware
>>
>> Mobile:
>> *+94 773090875 <%2B94%20773090875>*
>> LinkedIn:
>> *https://www.linkedin.com/in/RajeevanVimalanathan
>> *
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Susinda Perera*
> Software Engineer
> B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
> Mobile:(+94)716049075
> Blog: susinda.blogspot.com
> WSO2 Inc. http://wso2.com/
> Tel : 94 11 214 5345 Fax :94 11 2145300
>
>


-- 
Vimalanathan Rajeevan
Software Engineer,
WSO2, Inc. *http://wso2.com* 
Lean.Enterprise.Middleware

Mobile:
*+94 773090875*
LinkedIn:
*https://www.linkedin.com/in/RajeevanVimalanathan
*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB analytics dashboard

2016-06-10 Thread Jerad Rutnam
Hi Dulitha,

This was discussed previously in the review meeting and agreed to leave as
it is for the initial release. As there is a limitation in Dashboard Server
to have views based on conditions. But hopefully this will get fix in the
future.

Cheers!
Jerad


On Sat, Jun 11, 2016 at 5:02 AM, Dakshika Jayathilaka 
wrote:

> Looping Jeard..
>
> *Dakshika Jayathilaka*
> PMC Member & Committer of Apache Stratos
> Associate Technical Lead
> WSO2, Inc.
> lean.enterprise.middleware
> 0771100911
>
> On Sat, Jun 11, 2016 at 12:52 AM, Dulitha Wijewantha 
> wrote:
>
>> Hi Dakshitha,
>> When I go to view analytics of proxies the UI is not intuitive to let me
>> know that i have to select a proxy to view stats. Below is a screenshot -
>> Ideally on this - first one should be selected or an aggregated result
>> should be shown
>>
>> [image: Inline image 1]
>>
>> Cheers~
>>
>> --
>> Dulitha Wijewantha (Chan)
>> Software Engineer - Mobile Development
>> WSO2 Inc
>> Lean.Enterprise.Middleware
>>  * ~Email   duli...@wso2.com *
>> *  ~Mobile +94712112165 <%2B94712112165>*
>> *  ~Website   dulitha.me *
>> *  ~Twitter @dulitharw *
>>   *~Github @dulichan *
>>   *~SO @chan *
>>
>
>


-- 
*Jerad Rutnam*
*Software Engineer*

WSO2 Inc.
lean | enterprise | middleware
M : +94 77 959 1609 | E : je...@wso2.com | W : www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] ESB analytics dashboard

2016-06-10 Thread Dakshika Jayathilaka
Looping Jeard..

*Dakshika Jayathilaka*
PMC Member & Committer of Apache Stratos
Associate Technical Lead
WSO2, Inc.
lean.enterprise.middleware
0771100911

On Sat, Jun 11, 2016 at 12:52 AM, Dulitha Wijewantha 
wrote:

> Hi Dakshitha,
> When I go to view analytics of proxies the UI is not intuitive to let me
> know that i have to select a proxy to view stats. Below is a screenshot -
> Ideally on this - first one should be selected or an aggregated result
> should be shown
>
> [image: Inline image 1]
>
> Cheers~
>
> --
> Dulitha Wijewantha (Chan)
> Software Engineer - Mobile Development
> WSO2 Inc
> Lean.Enterprise.Middleware
>  * ~Email   duli...@wso2.com *
> *  ~Mobile +94712112165 <%2B94712112165>*
> *  ~Website   dulitha.me *
> *  ~Twitter @dulitharw *
>   *~Github @dulichan *
>   *~SO @chan *
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [App Cloud] Reproduce the intermittent Malformed JSON Exception when calling tier api

2016-06-10 Thread Kasun De Silva
​Did you try create version from rest api? Can we do a load test to the
rest api and see?
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Exception handling in Spark UDF

2016-06-10 Thread Dulitha Wijewantha
The default value will work for scenarios where we are using the function
on a where clause. There is also another scenario where you use it to
transform the value in the select. In the below query - if we put a default
value it will be returned by the result set rather than ignoring it.

select sessionKey as sessionKey,  dateFormatter(timestamp, "MM/dd/
HH:mm", "-MM-dd:HH") as dateDisplay, appKey as appKey, clientModel as
role, dateConvertor(timestamp, "MM/dd/ HH:mm", "HOUR") as date  from
eventStatData

On Fri, Jun 10, 2016 at 12:10 AM, Gimantha Bandara 
wrote:

> You will have to catch the exception inside the method itself and log a
> warning/error meesage and return a default value without throwing the
> exception out from the method.
>
>
> On Friday, June 10, 2016, Dulitha Wijewantha  wrote:
>
>> Below is an example usage -
>>
>> insert overwrite table TABLE_NAME select date, count(distinct sessionKey)
>> as activity, appKey, role, first(y.dateDisplay) as dateDisplay from (select
>> sessionKey as sessionKey,  dateFormatter(timestamp, "MM/dd/ HH:mm",
>> "-MM-dd:HH") as dateDisplay, appKey as appKey, clientModel as role,
>> dateConvertor(timestamp, "MM/dd/ HH:mm", "HOUR") as date  from
>> eventStatData) as y group by y.date, y.appKey, y.role;
>>
>>
>>
>> On Thu, Jun 9, 2016 at 4:13 PM, Sachith Withana  wrote:
>>
>>> Hi Dulitha,
>>>
>>> Can you provide the query that you are using?
>>>
>>> That would help us give you a better solution I guess.
>>>
>>> Regards,
>>> Sachith
>>>
>>> On Thu, Jun 9, 2016 at 2:34 PM, Dulitha Wijewantha 
>>> wrote:
>>>
 Hi guys,
 I have written a customer Spark UDF function that allows me to convert
 a date string to a given input format. If there is a ParseException due to
 input being invalid - the whole spark script will stop execution. Is there
 away to skip that particular iteration and move on to the next in the
 record? (this function is used in where clauses). Or is there a better
 recommendation for this? Like validation in the EventReceiver?

 public String dateFormatter(String input, String fromFormat, String
 toFormat) throws ParseException{
 SimpleDateFormat sdf = new SimpleDateFormat(fromFormat);
 Date date = sdf.parse(input);
 SimpleDateFormat newFormatter = new SimpleDateFormat(toFormat);
 return newFormatter.format(date);
 }

 Cheers~

 --
 Dulitha Wijewantha (Chan)
 Software Engineer - Mobile Development
 WSO2 Inc
 Lean.Enterprise.Middleware
  * ~Email   duli...@wso2.com*
 *  ~Mobile +94712112165 <%2B94712112165>*
 *  ~Website   dulitha.me *
 *  ~Twitter @dulitharw *
   *~Github @dulichan *
   *~SO @chan *

>>>
>>>
>>>
>>> --
>>> Sachith Withana
>>> Software Engineer; WSO2 Inc.; http://wso2.com
>>> E-mail: sachith AT wso2.com
>>> M: +94715518127
>>> Linked-In: 
>>> https://lk.linkedin.com/in/sachithwithana
>>>
>>
>>
>>
>> --
>> Dulitha Wijewantha (Chan)
>> Software Engineer - Mobile Development
>> WSO2 Inc
>> Lean.Enterprise.Middleware
>>  * ~Email   duli...@wso2.com*
>> *  ~Mobile +94712112165 <%2B94712112165>*
>> *  ~Website   dulitha.me *
>> *  ~Twitter @dulitharw *
>>   *~Github @dulichan *
>>   *~SO @chan *
>>
>
>
> --
> Gimantha Bandara
> Software Engineer
> WSO2. Inc : http://wso2.com
> Mobile : +94714961919
>
>


-- 
Dulitha Wijewantha (Chan)
Software Engineer - Mobile Development
WSO2 Inc
Lean.Enterprise.Middleware
 * ~Email   duli...@wso2.com *
*  ~Mobile +94712112165*
*  ~Website   dulitha.me *
*  ~Twitter @dulitharw *
  *~Github @dulichan *
  *~SO @chan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] ESB analytics dashboard

2016-06-10 Thread Dulitha Wijewantha
Hi Dakshitha,
When I go to view analytics of proxies the UI is not intuitive to let me
know that i have to select a proxy to view stats. Below is a screenshot -
Ideally on this - first one should be selected or an aggregated result
should be shown

[image: Inline image 1]

Cheers~

-- 
Dulitha Wijewantha (Chan)
Software Engineer - Mobile Development
WSO2 Inc
Lean.Enterprise.Middleware
 * ~Email   duli...@wso2.com *
*  ~Mobile +94712112165*
*  ~Website   dulitha.me *
*  ~Twitter @dulitharw *
  *~Github @dulichan *
  *~SO @chan *
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] RESTful Fine Grained Authorization-as-a-Service (AZaaS)

2016-06-10 Thread Manuranga Perera
Hi Manujith,

Please have a look at WSO2 REST API guideline [1]. This will help you to
improve the URL nameing.

[1] http://wso2.com/whitepapers/wso2-rest-apis-design-guidelines/

On Thu, Jun 9, 2016 at 3:49 PM, Manujith Pallewatte 
wrote:

> Hi Pushpalanka,
>
> Was confused in the PR procedure, and figured that I forgot to initialize
> the github repo as you have mentioned in a previous message.
> So the new location of the codebase is at [1]
> Over the weekend, I'll fix any remaining issues and send the PR
> For now I have used the wso2-codestyle given by Omindu and reformatted the
> code
> and added Findbug as well.
>
> Thank You
> Manujith
>
> [1]
> https://github.com/ManZzup/identity-framework/tree/master/components/entitlement/org.wso2.carbon.identity.entitlement.endpoint
>
> On Wed, Jun 8, 2016 at 11:35 AM, Pushpalanka Jayawardhana 
> wrote:
>
>>
>>
>> On Tue, Jun 7, 2016 at 11:01 AM, Manujith Pallewatte <
>> manujith...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> Code is almost all refracted (apart from the part where authenticators
>>> are hard coded) and it' is available at [1]
>>> I have attached a readme so everyone can help with testing it. But
>>> there's still an issue remaining to debug with the *entitled-attribs 
>>> *service
>>> call, that came up in preliminary testing by Omindu.
>>>
>>> Thank You Omindu, I will use the formatting configs and format the code
>>> asap. For now i added a gitignore as in the sample you sent, but I left 
>>> *target
>>> *directory intact so that i can share the war file through the repo.
>>>
>>> Also for the PR, to which repo should I send the PR for? Or shall I wait
>>> for further testing of the code so that we can minimize any bugs?
>>>
>> If code refactoring, formatting, cleanup are done, you have run Findbug
>> plugin(This is a plugin that can integrate to IDE. If you already haven't
>> try it.) and fixed any issues reported against code and functionality is
>> working, we are OK to review the code. You can further test the code and
>> fix the bugs while integrating any review comments we put on the PR.
>>
>> "Please share the code progress via Github, once you are satisfied with
>> refactoring.
>> Please fork [1] to your private repo, and at location [2], you may have a
>> new component named 'org.wso2.carbon.identity.entitlement.endpoint' where
>> the implementation can reside.
>>
>> [1] - https://github.com/wso2/carbon-identity-framework
>> [2] -
>> https://github.com/wso2/carbon-identity-framework/tree/master/components/entitlement
>> "
>>
>>>
>>> [1] https://github.com/ManZzup/identity-entitlement-endpoint
>>>
>>> Thank You,
>>> Best Regards
>>> Manujith
>>>
>>> On Tue, Jun 7, 2016 at 10:30 AM, Omindu Rathnaweera 
>>> wrote:
>>>
 Adding a .gitignore to the repo will be the easiest way to keep the
 unwanted files away from the repo. See [1].

 [1] -
 https://github.com/wso2/carbon-identity-framework/blob/master/.gitignore

 Regards,
 Omindu

 On Tue, Jun 7, 2016 at 10:26 AM, Pushpalanka Jayawardhana <
 la...@wso2.com> wrote:

> Hi Manujith,
>
> The IDE specific files(.iml) or code can be removed from the
> repository.
> Once the code refactoring is done and code is cleaned please feel free
> to send the PR. Then we can easily comment on the code.
>
> Thanks,
> Pushpalanka
>
>
> On Tue, Jun 7, 2016 at 10:12 AM, Omindu Rathnaweera 
> wrote:
>
>> Hi Manujith,
>>
>> Better if you can clean up the unnecessary code and do some code
>> refactoring. We can do another round of testing once you fix the issues I
>> have mention. You can use the attached Idea Code Formatting Template [1].
>>
>> To apply the template, follow the steps below.
>>
>> 1. In IDEA settings, goto Editor -> Code Style.
>> 2. Click 'Manage' then 'Save As...' an existing scheme with the name
>> 'wso2-codestyle' and Close the IDE.
>> 3. Goto ~/.IntelliJIdea16/config/codestyles directory and replace the
>> 'wso2-codestyle.xml' file with the attached one.
>>
>> [1] -
>> https://drive.google.com/file/d/0BzRDbfbIaYjCSzhGRUR1aGdlTXM/view?usp=sharing
>>
>> Regards,
>> Omindu.
>>
>>
>> On Mon, Jun 6, 2016 at 8:29 AM, Manujith Pallewatte <
>> manujith...@gmail.com> wrote:
>>
>>> Hi all,
>>>
>>> After a bit of refactoring I added the code to [1]. Please feel free
>>> to check the source and give your ideas to improve, specially on the
>>> service related code. All the service related code is available at [2]
>>>
>>> Also Omindu tested the initial war file and reported several issues
>>> with it, hoping to debug those within the week
>>>
>>>
>>> [1] https://github.com/ManZzup/identity-entitlement-endpoint
>>> [2]
>>> 

Re: [Dev] GSOC 2016 - Project 21 : MongoDB Userstore Development

2016-06-10 Thread Asantha Thilina
Hi Tharindu,

sorry for the delay i have updated my blog today and i'm keep posting all
the progress in their[1] up to now and i am look forward for your feedbacks
and comments

[1]http://asanthamax.blogspot.com/

Thanks,
Asantha

On Thu, Jun 9, 2016 at 7:37 AM, Tharindu Edirisinghe 
wrote:

> Hi Asantha,
>
> Great ! There has been a delay in my replies but it's really good to see
> your progress with the project with a minimum level of supervision.
>
> I will arrange a review next week with the Identity Server team for the
> work completed so far and then we can provide the Mid Review feedback for
> the project.
>
> Keep on communicating the progress and the issues you face via emails and
> also update your blog with the findings.
>
> Thank you,
> TharinduE
>
> On Thu, Jun 9, 2016 at 4:44 PM, Asantha Thilina 
> wrote:
>
>> Hi Tharindu,
>>
>> i rearranged the UM_USER_ATTRIBUTE collection now when ever user update
>> his profile, claim values will save in the collection the way we discussed
>> in hangout i updated my repo[1] with latest modification
>>
>> [1] https://github.com/asanthamax/mongodbuserstore
>>
>> Thanks,
>> Asantha
>>
>> On Wed, Jun 8, 2016 at 8:03 AM, Asantha Thilina > > wrote:
>>
>>> Hi Tharindu,
>>>
>>> sorry i forget to attach my github repository here is the repository
>>> link i have update the repository with my latest errors fixed
>>> https://github.com/asanthamax/mongodbuserstore
>>>
>>> Thanks,
>>> Asantha
>>>
>>> On Wed, Jun 8, 2016 at 8:00 AM, Asantha Thilina <
>>> asanthathil...@gmail.com> wrote:
>>>
 Hi Tharindu,

 I have fixed the claims issue now it can update and add claims to user
 but still the db structure is same as in relational structure i have
 currently mapping it to a way we discussed ,most of the issues being fixed
 now following tasks can do in now MongoDBUserStoreManager
 can add users.
 can add roles.
 can assign roles to users.
 can assign users to roles.
 can edit user claim values in update profile.
 I creating the documentation of my MongoDBUserStoreManager as well
 sooner i will publish the document and also test scripts as well
 And also following are the issues now i facing in
 registered users in my user store domain can't login to the IS it's
 giving error as MongoDBUserStoreManager can't cast to
 AbstractUserStoreManager since i done MongoDBUserStoreManager by
 implementing the UserStoreManager is there any special changes to do in my
 code to authenticate user ? i debugged and see my doAuthenticate method not
 get triggered during runtime
 expect some advice from you

 Thanks,
 Asantha

 On Mon, Jun 6, 2016 at 1:18 AM, Asantha Thilina <
 asanthathil...@gmail.com> wrote:

> Hi Tharindu,
>
> ok sure i will modify the readme content as appropriately,at the
> moment i didn't add that feature, set to all default i will modify that to
> add a port number also,
>
> Thanks,
> Asantha
>
> On Mon, Jun 6, 2016 at 12:04 AM, Tharindu Edirisinghe <
> tharin...@wso2.com> wrote:
>
>> Hi Asantha,
>>
>> We might not need implementing the HybridRoleManager... I'll provide
>> you the exact details after trying out the functionality you have
>> implemented up to now.
>>
>> Can you please write a basic document with the steps for creating the
>> mongodb database and adding a userstore in IS pointing to the created
>> mongodb database and include in the ReadMe of github repo.
>>
>> Also if mongodb server is running in a different port other than the
>> default port, can we still connect to that ? I didn't see a place to 
>> define
>> the port in the configuration.. should it be added as a connection 
>> string ?
>> (didn't go through the code to find what is going wrong)
>>
>> Thanks,
>> TharinduE
>>
>> On Sun, Jun 5, 2016 at 11:55 PM, Asantha Thilina <
>> asanthathil...@gmail.com> wrote:
>>
>>> Hi Tharindu,
>>>
>>> As we discussed on hangout i doing the changes in UM_USER_ATTRIBUTE
>>> collection and also changing the hybrid role to master datasource but 
>>> when
>>> i try to add user to hybrid role i facing a small issue i can't grab the
>>> datasource ,in HybridRoleManager class it need to give 
>>> java.sql.DataSource
>>> but in my current user store manager class i have never used a sql
>>> datasource(since it nosql) so i think i need to grab the master 
>>> datasource
>>> of IS which is h2 database datasource, is there a way to get the primary
>>> datasource?
>>>
>>> Thanks,
>>> Asantha
>>>
>>> On Sat, Jun 4, 2016 at 1:59 PM, Tharindu Edirisinghe <
>>> tharin...@wso2.com> wrote:
>>>
 The call details are as following.

 1. Demonstrated how to use 

Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Ayoma Wijethunga
+1 for not using "{{{".

We will further check on adding such patterns ("{{{ * }}}") in planned
Jenkins based automated security scans (static code analysis).

On Fri, Jun 10, 2016 at 8:47 PM, SajithAR Ariyarathna 
wrote:

> +1 for abandoning "{{{"
>
> toClent("fromBackend.protocols", protocols);
>
> We can implement this in the next milestone.
>
> On Fri, Jun 10, 2016 at 8:12 PM, Manuranga Perera  wrote:
>
>> These are mistakes we have already made in our old systems, let's not
>> repeat them
>>
>> 1) Please DO NOT use "{{{", it introduces SECURITY VULNERABILITIES,
>> Sajith,Rasika we need to introduce a new function. Don't even tell people
>> about "{{{"
>> in backend JS, Hemika should be able to do the following
>>
>> toClent("fromBackend.protocols", protocols);
>>
>> and in frontend, he should be able to just
>> console.log(fromBackend.protocols) and see the json
>> Given the cost of this kind of vulnerabilities, I don't think we should
>> even do this as a temp solution. We should safe stringify before sending,
>> view source of gmail and search "var GLOBALS" and you see how safe json
>> stringify works. ALL non-alpha-numeric has to be encoded with \x. Not just
>> " but things like < , which are normally considered safe in json, has to be
>> encoded [1].
>>
>> 2) We shouldn't manually iterating to convert to JSON. This just adds
>> unnecessary boilerplate work dev has to do. If we implement (1) we don't
>> need this for now. So we can discuss this later. But also see [2]
>>
>> [1] see "JavaScript Encoding" in
>> https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#Output_Encoding_Rules_Summary
>> [2]
>> http://mail.openjdk.java.net/pipermail/nashorn-dev/2013-September/002013.html
>>
>> On Fri, Jun 10, 2016 at 4:46 AM, Hemika Kodikara  wrote:
>>
>>> Also please note that I used JSON.stringify method in server side js.
>>>
>>> Hemika Kodikara
>>> Software Engineer
>>> WSO2 Inc.
>>> lean . enterprise . middleware
>>> http://wso2.com
>>>
>>> Mobile : +9477762
>>>
>>> On Fri, Jun 10, 2016 at 2:13 PM, Hemika Kodikara 
>>> wrote:
>>>
 Thanks Rasika for the solution.

 In the client side JS, have the following code :

 
 var protocols = *{{{protocols}}}*;
 $.each(protocols, function(index, value) {

 $('#queue-subscription-protocols').append($('

Re: [Dev] [UUF] Programmatically add/remove/modify items on menu.

2016-06-10 Thread SajithAR Ariyarathna
As for now UUF only support for pre- configured menus. We are hoping to add
menu disabling & modifying capability (these operation can be done in the
server-side JS) in future releases.

Thanks.

On Fri, Jun 10, 2016 at 4:49 PM, Hemika Kodikara  wrote:

> Hi All,
>
> Is it possible to programmatically add/remove/modify items to the menu ?
>
> In MB we are making changes to have pluggable protocols. So the UI should
> reflect when a protocol is added/removed.
>
> Thoughts ?
>
> Regards,
> Hemika
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>



-- 
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread SajithAR Ariyarathna
+1 for abandoning "{{{"

toClent("fromBackend.protocols", protocols);

We can implement this in the next milestone.

On Fri, Jun 10, 2016 at 8:12 PM, Manuranga Perera  wrote:

> These are mistakes we have already made in our old systems, let's not
> repeat them
>
> 1) Please DO NOT use "{{{", it introduces SECURITY VULNERABILITIES,
> Sajith,Rasika we need to introduce a new function. Don't even tell people
> about "{{{"
> in backend JS, Hemika should be able to do the following
>
> toClent("fromBackend.protocols", protocols);
>
> and in frontend, he should be able to just
> console.log(fromBackend.protocols) and see the json
> Given the cost of this kind of vulnerabilities, I don't think we should
> even do this as a temp solution. We should safe stringify before sending,
> view source of gmail and search "var GLOBALS" and you see how safe json
> stringify works. ALL non-alpha-numeric has to be encoded with \x. Not just
> " but things like < , which are normally considered safe in json, has to be
> encoded [1].
>
> 2) We shouldn't manually iterating to convert to JSON. This just adds
> unnecessary boilerplate work dev has to do. If we implement (1) we don't
> need this for now. So we can discuss this later. But also see [2]
>
> [1] see "JavaScript Encoding" in
> https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#Output_Encoding_Rules_Summary
> [2]
> http://mail.openjdk.java.net/pipermail/nashorn-dev/2013-September/002013.html
>
> On Fri, Jun 10, 2016 at 4:46 AM, Hemika Kodikara  wrote:
>
>> Also please note that I used JSON.stringify method in server side js.
>>
>> Hemika Kodikara
>> Software Engineer
>> WSO2 Inc.
>> lean . enterprise . middleware
>> http://wso2.com
>>
>> Mobile : +9477762
>>
>> On Fri, Jun 10, 2016 at 2:13 PM, Hemika Kodikara  wrote:
>>
>>> Thanks Rasika for the solution.
>>>
>>> In the client side JS, have the following code :
>>>
>>> 
>>> var protocols = *{{{protocols}}}*;
>>> $.each(protocols, function(index, value) {
>>>
>>> $('#queue-subscription-protocols').append($('

Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Manuranga Perera
These are mistakes we have already made in our old systems, let's not
repeat them

1) Please DO NOT use "{{{", it introduces SECURITY VULNERABILITIES,
Sajith,Rasika we need to introduce a new function. Don't even tell people
about "{{{"
in backend JS, Hemika should be able to do the following

toClent("fromBackend.protocols", protocols);

and in frontend, he should be able to just
console.log(fromBackend.protocols) and see the json
Given the cost of this kind of vulnerabilities, I don't think we should
even do this as a temp solution. We should safe stringify before sending,
view source of gmail and search "var GLOBALS" and you see how safe json
stringify works. ALL non-alpha-numeric has to be encoded with \x. Not just
" but things like < , which are normally considered safe in json, has to be
encoded [1].

2) We shouldn't manually iterating to convert to JSON. This just adds
unnecessary boilerplate work dev has to do. If we implement (1) we don't
need this for now. So we can discuss this later. But also see [2]

[1] see "JavaScript Encoding" in
https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet#Output_Encoding_Rules_Summary
[2]
http://mail.openjdk.java.net/pipermail/nashorn-dev/2013-September/002013.html

On Fri, Jun 10, 2016 at 4:46 AM, Hemika Kodikara  wrote:

> Also please note that I used JSON.stringify method in server side js.
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>
> On Fri, Jun 10, 2016 at 2:13 PM, Hemika Kodikara  wrote:
>
>> Thanks Rasika for the solution.
>>
>> In the client side JS, have the following code :
>>
>> 
>> var protocols = *{{{protocols}}}*;
>> $.each(protocols, function(index, value) {
>>
>> $('#queue-subscription-protocols').append($('

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread KasunG Gajasinghe
+Dulanja, +Ayoma

On Fri, Jun 10, 2016 at 6:36 PM, Geeth Munasinghe  wrote:

>
>
> On Fri, Jun 10, 2016 at 6:10 PM, KasunG Gajasinghe 
> wrote:
>
>> Hi Geeth,
>>
>> On Fri, Jun 10, 2016 at 5:09 PM, Geeth Munasinghe  wrote:
>>
>>> Hi Kasun,
>>>
>>>
>>> On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe 
>>> wrote:
>>>
 Hi Bhathiya,

 On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara  wrote:

> Hi Kalpa,
>
> I tried to do a smoke test. But I can't login to any jaggery app, due
> to the same error. So I think we have 2 options here.
>
> 1) Modify default jks to accept * (wildcard) hostname.
> 2) Introduce some config or system variable to disable hostname
> verification,  read it from everywhere we use http client in our platform
> and disable/enable it.
>
>
 Both these options introduce security vulnerabilities, so I don't think
 we should do either.

 Your jaggery apps are calling AuthenticationAdmin service endpoint
 which is in the same JVM. So, it is an in-jvm call. You should be using the
 local transport for that. For that, you can get the server url through the 
 *ServerURL
 *attribute in the carbon.xml. Then, append the service name at the
 end. Now, you have the endpoint you need to call.

>>>
>>> In EMM, we have implemented CXF restful web services for all our admin
>>> services and device communications. And also EMM has jaggery application
>>> for doing all admin functionalities. So in our case we are not able to use
>>> the local transport because it is only for axis2 services. All of those EMM
>>> rest apis are protected by oauth and using HTTPS transport. Will there be
>>> any concern for someone who is using the OOB EMM to as Bathiya had ? (FYI :
>>> EMM is still in kernel version 4.4.3, so we do not have this now). If a
>>> someone has to create a create keystore in order to use the OOB pack, they
>>> would be a problem.
>>>
>>>
>>
>> For the default pack, can you use localhost as the hostname instead since
>> local transport is not available for services other than axis2-based
>> services? I agree, the default pack should work with the self-signed
>> certificate.
>>
>
> That would be problematic because even devices are connecting to the
> server, they use ip to do so.
>

This is a client-side error where the client-side validates the server's
common name. The clients can very well use IP addresses if the client does
not need to validate the server.


> AFAIK some machines may not have  "localhost" pointed to 127.0.0.1 in DNS
> settings.
>

As I've seen all major distributions have this mapping. But, using
localhost is a suggestion. There might be other alternatives.


> This will cause errors. And AFAIU this fix will cause us to create a
> keystore when do a cluster of the product. Because default keystore's CN is
> localhost, therefore it cannot be used in a cluster. (In a way, that is
> ok).  As a suggestion, can we have flag to off the host name verification
> in OOB pack.
>

Adding security people to get feedback on this. We need to see possible
vulnerabilities it could introduce and come to a compromise.


>
>
>>
>>
>>>
 Further, I have tested after changing the ServerURL from local to https
 transport to see how it works. Then, I noticed the same issue when logging
 into the mgt console as well. But it is fine since if a customer need to
 use https transport, then they need to have their own keystore.

 In summary, you will need to fix your jaggery apps. I don't see this as
 a problem for this release.

 Thanks,
 KasunG


> I think option 1 is the most feasible . WDYT?
>
> Thanks,
> Bhathiya
>
> On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara <
> bhath...@wso2.com> wrote:
>
>> Hi Kalpa,
>>
>> Thanks. I'll try to fix that.
>>
>> Regards,
>> Bhathiya
>>
>> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
>> wrote:
>>
>>> Hi Bhathiya,
>>>
>>> We are using a newer version of httpclient orbit
>>> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
>>> host name. You will be able to get it fixed from your test module.
>>>
>>> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara <
>>> bhath...@wso2.com> wrote:
>>>
 Hi Kalpa,

 I'm getting this error while running tests with new kernel. Any
 idea why?

 [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost
 to url[https://10.100.0.189:9943//services/AuthenticationAdmin]
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
 -
 javax.net.ssl.SSLException: hostname in certificate didn't match:
 <10.100.0.189> != 
 

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Geeth Munasinghe
On Fri, Jun 10, 2016 at 6:10 PM, KasunG Gajasinghe  wrote:

> Hi Geeth,
>
> On Fri, Jun 10, 2016 at 5:09 PM, Geeth Munasinghe  wrote:
>
>> Hi Kasun,
>>
>>
>> On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe 
>> wrote:
>>
>>> Hi Bhathiya,
>>>
>>> On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Kalpa,

 I tried to do a smoke test. But I can't login to any jaggery app, due
 to the same error. So I think we have 2 options here.

 1) Modify default jks to accept * (wildcard) hostname.
 2) Introduce some config or system variable to disable hostname
 verification,  read it from everywhere we use http client in our platform
 and disable/enable it.


>>> Both these options introduce security vulnerabilities, so I don't think
>>> we should do either.
>>>
>>> Your jaggery apps are calling AuthenticationAdmin service endpoint which
>>> is in the same JVM. So, it is an in-jvm call. You should be using the local
>>> transport for that. For that, you can get the server url through the 
>>> *ServerURL
>>> *attribute in the carbon.xml. Then, append the service name at the end.
>>> Now, you have the endpoint you need to call.
>>>
>>
>> In EMM, we have implemented CXF restful web services for all our admin
>> services and device communications. And also EMM has jaggery application
>> for doing all admin functionalities. So in our case we are not able to use
>> the local transport because it is only for axis2 services. All of those EMM
>> rest apis are protected by oauth and using HTTPS transport. Will there be
>> any concern for someone who is using the OOB EMM to as Bathiya had ? (FYI :
>> EMM is still in kernel version 4.4.3, so we do not have this now). If a
>> someone has to create a create keystore in order to use the OOB pack, they
>> would be a problem.
>>
>>
>
> For the default pack, can you use localhost as the hostname instead since
> local transport is not available for services other than axis2-based
> services? I agree, the default pack should work with the self-signed
> certificate.
>

That would be problematic because even devices are connecting to the
server, they use ip to do so. AFAIK some machines may not have  "localhost"
pointed to 127.0.0.1 in DNS settings. This will cause errors. And AFAIU
this fix will cause us to create a keystore when do a cluster of the
product. Because default keystore's CN is localhost, therefore it cannot be
used in a cluster. (In a way, that is ok).  As a suggestion, can we have
flag to off the host name verification in OOB pack.


>
>
>>
>>> Further, I have tested after changing the ServerURL from local to https
>>> transport to see how it works. Then, I noticed the same issue when logging
>>> into the mgt console as well. But it is fine since if a customer need to
>>> use https transport, then they need to have their own keystore.
>>>
>>> In summary, you will need to fix your jaggery apps. I don't see this as
>>> a problem for this release.
>>>
>>> Thanks,
>>> KasunG
>>>
>>>
 I think option 1 is the most feasible . WDYT?

 Thanks,
 Bhathiya

 On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara  wrote:

> Hi Kalpa,
>
> Thanks. I'll try to fix that.
>
> Regards,
> Bhathiya
>
> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
> wrote:
>
>> Hi Bhathiya,
>>
>> We are using a newer version of httpclient orbit
>> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
>> host name. You will be able to get it fixed from your test module.
>>
>> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara <
>> bhath...@wso2.com> wrote:
>>
>>> Hi Kalpa,
>>>
>>> I'm getting this error while running tests with new kernel. Any idea
>>> why?
>>>
>>> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost
>>> to url[https://10.100.0.189:9943//services/AuthenticationAdmin]
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> javax.net.ssl.SSLException: hostname in certificate didn't match:
>>> <10.100.0.189> != 
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
>>> -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
>>> -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
>>> -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
>>> INFO
>>>  

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread KasunG Gajasinghe
Hi Geeth,

On Fri, Jun 10, 2016 at 5:09 PM, Geeth Munasinghe  wrote:

> Hi Kasun,
>
>
> On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe 
> wrote:
>
>> Hi Bhathiya,
>>
>> On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Kalpa,
>>>
>>> I tried to do a smoke test. But I can't login to any jaggery app, due to
>>> the same error. So I think we have 2 options here.
>>>
>>> 1) Modify default jks to accept * (wildcard) hostname.
>>> 2) Introduce some config or system variable to disable hostname
>>> verification,  read it from everywhere we use http client in our platform
>>> and disable/enable it.
>>>
>>>
>> Both these options introduce security vulnerabilities, so I don't think
>> we should do either.
>>
>> Your jaggery apps are calling AuthenticationAdmin service endpoint which
>> is in the same JVM. So, it is an in-jvm call. You should be using the local
>> transport for that. For that, you can get the server url through the 
>> *ServerURL
>> *attribute in the carbon.xml. Then, append the service name at the end.
>> Now, you have the endpoint you need to call.
>>
>
> In EMM, we have implemented CXF restful web services for all our admin
> services and device communications. And also EMM has jaggery application
> for doing all admin functionalities. So in our case we are not able to use
> the local transport because it is only for axis2 services. All of those EMM
> rest apis are protected by oauth and using HTTPS transport. Will there be
> any concern for someone who is using the OOB EMM to as Bathiya had ? (FYI :
> EMM is still in kernel version 4.4.3, so we do not have this now). If a
> someone has to create a create keystore in order to use the OOB pack, they
> would be a problem.
>
>

For the default pack, can you use localhost as the hostname instead since
local transport is not available for services other than axis2-based
services? I agree, the default pack should work with the self-signed
certificate.


>
>> Further, I have tested after changing the ServerURL from local to https
>> transport to see how it works. Then, I noticed the same issue when logging
>> into the mgt console as well. But it is fine since if a customer need to
>> use https transport, then they need to have their own keystore.
>>
>> In summary, you will need to fix your jaggery apps. I don't see this as a
>> problem for this release.
>>
>> Thanks,
>> KasunG
>>
>>
>>> I think option 1 is the most feasible . WDYT?
>>>
>>> Thanks,
>>> Bhathiya
>>>
>>> On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Kalpa,

 Thanks. I'll try to fix that.

 Regards,
 Bhathiya

 On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
 wrote:

> Hi Bhathiya,
>
> We are using a newer version of httpclient orbit
> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
> host name. You will be able to get it fixed from your test module.
>
> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara <
> bhath...@wso2.com> wrote:
>
>> Hi Kalpa,
>>
>> I'm getting this error while running tests with new kernel. Any idea
>> why?
>>
>> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to
>> url[https://10.100.0.189:9943//services/AuthenticationAdmin]
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> javax.net.ssl.SSLException: hostname in certificate didn't match:
>> <10.100.0.189> != 
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
>> INFO
>>  

Re: [Dev] [GREG] Invalid value error for REG_CREATED_TIME column in REG_RESOURCE with mysql 5.7

2016-06-10 Thread Sewmini Jayaweera
Hi Uvindra,

I used pre configured IS to configure IS as key manager. But due to [1] I
could not start api manager using -Dsetup. Therefore I sourced tables
manually by following [2]. According to [2] we need to source
/dbscripts/apimgt/mysql.sql and
/dbscripts/identity/mysql.sql. in order to create tables in AM DB.

As you told I get above errors for the db script I source after the first
script. When using IS preconfigured pack should I source both?

[1]. https://wso2.org/jira/browse/CARBON-15913
[2].
https://docs.wso2.com/display/CLUSTER44x/Configuring+the+Identity+Server+5.1.0+as+a+Key+Manager+with+API+Manager+1.10.0

Sewmini Jayaweera
*Software Engineer - QA Team*
Mobile: +94 (0) 773 381 250
sewm...@wso2.com

On Fri, Jun 10, 2016 at 5:02 PM, Uvindra Dias Jayasinha 
wrote:

> So this has nothing to do with the TIMESTAMP issue, this is because you
> have already run the script once before and now its failing because primary
> keys are being duplicated
>
> On 10 June 2016 at 16:56, Sewmini Jayaweera  wrote:
>
>> Hi Uvindra,
>>
>> As per my observation in some mysql servers the script attached in my
>> previous mail works but for me I had to add 'DEFAULT CURRENT_TIMESTAMP'
>> option for REG_LAST_UPDATED_TIME and REG_CREATED_TIME columns of
>> 'REG_RESOURCE_HISTORY' tables in addition to   'REG_RESOURCE' table.
>>
>>  I could fix mysql.sql script inside IS yet when I change TIMESTAMP
>> columns by given DEFAULT CURRENT_TIMESTAMP' option for mysql.sql script in
>> /dbscripts/apimgt/mysql.sql I got below error at the time I
>> sourced it.
>>
>>
>> source /Users/sewmini/Desktop/wso2am-1.10.0/dbscripts/apimgt/mysql.sql;
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1062 (23000): Duplicate entry 'WSO2 Identity Server' for key
>> 'PRIMARY'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.01 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1061 (42000): Duplicate key name 'IDX_AT_CK_AU'
>>
>> ERROR 1061 (42000): Duplicate key name 'IDX_TC'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1061 (42000): Duplicate key name 'APPLICATION_NAME_CONSTRAINT'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.01 sec)
>>
>> Query OK, 1 row affected (0.00 sec
>>
>> Query OK, 1 row affected (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 0 rows affected, 1 warning (0.00 sec)
>>
>> Query OK, 

Re: [Dev] [APIM 2.0]What is the order of matching Conditional groups in Advance Resource Throttling?

2016-06-10 Thread Ushani Balasooriya
Thanks for the clarification Harsha

On Fri, Jun 10, 2016 at 4:24 PM, Harsha Kumara  wrote:

> Hi Ushani,
>
> On Fri, Jun 10, 2016 at 2:28 PM, Ushani Balasooriya 
> wrote:
>
>> Hi Harsha,
>>
>> Additionally please explain how it should behave if the request matches
>> one conditional group and default conditional group as well.
>>
> There is no possibility of request being applying to conditional group and
> a default policy. If one request match two conditional groups, one with
> lowest request count will be throttle out first.
>
>>
>> Scenario 2 :
>> E.g.,
>>
>> E.g.
>> Conditional group 1 : JWT claim condition and Query Param Condition
>>
>> Conditional group 2 : Header condition
>>
>> A request matches both condition group1 and default request count is also
>> configured.
>>
>> Thanks,
>>
>> On Fri, Jun 10, 2016 at 2:17 PM, Ushani Balasooriya 
>> wrote:
>>
>>> Hi Harsha,
>>>
>>> In API Manager 2.0, Advance throttling configuration, if there are
>>> multiple conditional groups defined and if a request matches multiple
>>> conditional groups how it should work?
>>>
>>> Is there a priority that should be matched or should it match the lowest
>>> request count?
>>>
>>> Scenario :1
>>
>>> E.g.
>>> Conditional group 1 : JWT claim condition and Query Param Condition
>>>
>>> Conditional group 2 :Header condition
>>>
>>> A request matches both condition groups.
>>>
>> With the current design, policy which have lowest request count will be
> applied if request match that particular conditional group. However we are
> discussing the behavior of this further. Will update if we have done any
> changes.
>
>>
>>>
>>> Thanks,
>>> --
>>> *Ushani Balasooriya*
>>> Senior Software Engineer - QA;
>>> WSO2 Inc; http://www.wso2.com/.
>>>
>>>
>>
>>
>> --
>> *Ushani Balasooriya*
>> Senior Software Engineer - QA;
>> WSO2 Inc; http://www.wso2.com/.
>> Mobile; +94772636796
>>
>>
>
>
> --
> Harsha Kumara
> Software Engineer, WSO2 Inc.
> Mobile: +94775505618
> Blog:harshcreationz.blogspot.com
>



-- 
*Ushani Balasooriya*
Senior Software Engineer - QA;
WSO2 Inc; http://www.wso2.com/.
Mobile; +94772636796
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Kalpa Welivitigoda
Hi all,

Thanks for testing kernel 4.4.6 RC2. We have to call off the vote as we
needed to fix [1]. The fix is already in place, we will call a vote for RC3
soon.

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

On Fri, Jun 10, 2016 at 5:01 PM, KasunG Gajasinghe  wrote:

>
>
> On Fri, Jun 10, 2016 at 4:42 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Kasun,
>>
>> On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe 
>> wrote:
>>
>>> Hi Bhathiya,
>>>
>>> On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Kalpa,

 I tried to do a smoke test. But I can't login to any jaggery app, due
 to the same error. So I think we have 2 options here.

 1) Modify default jks to accept * (wildcard) hostname.
 2) Introduce some config or system variable to disable hostname
 verification,  read it from everywhere we use http client in our platform
 and disable/enable it.


>>> Both these options introduce security vulnerabilities, so I don't think
>>> we should do either.
>>>
>>
>> That's correct, but since no one is supposed to use default keystore or
>> disable hostname verification in production, this won't be a problem at
>> all.
>>
>>
>>>
>>> Your jaggery apps are calling AuthenticationAdmin service endpoint which
>>> is in the same JVM.
>>>
>>
>> This is not the case always. In a distributed setup, auth call is not in
>> jvm.
>>
>
> Yes, if you are setting up a cluster, then you need to use proper
> keystores.
>
>
>> So we can't read it from carbon.xml.
>>
>
> I checked how APIM generates the AuthenticationAdmin endpoint. In
> api-manager.xml, for the AuthManager's ServerURL, you have the https
> endpoint of the local server as the default setting. Can you change this to
> use local transport instead? This may be applicable to all the ServerURLs
> configurations in there.
>
> This will work when invoking axis2 back-ends, but not for other rest apis
> like cxf. Does APIM has such a usecase?
>
> One other option is modifying all our default configs to have local
>> transport. But that will introduce a new configuration complexity to the
>> product. However we will try if we can do that in all places.
>>
>
> There is no configuration complexity since the relevant bits are already
> there.
>
>
>>
>> Meanwhile please consider my above suggestions again.
>>
>> Thanks,
>> Bhathiya
>>
>>
>>> So, it is an in-jvm call. You should be using the local transport for
>>> that. For that, you can get the server url through the *ServerURL *attribute
>>> in the carbon.xml. Then, append the service name at the end. Now, you have
>>> the endpoint you need to call.
>>>
>>> Further, I have tested after changing the ServerURL from local to https
>>> transport to see how it works. Then, I noticed the same issue when logging
>>> into the mgt console as well. But it is fine since if a customer need to
>>> use https transport, then they need to have their own keystore.
>>>
>>> In summary, you will need to fix your jaggery apps. I don't see this as
>>> a problem for this release.
>>>
>>> Thanks,
>>> KasunG
>>>
>>>
 I think option 1 is the most feasible . WDYT?

 Thanks,
 Bhathiya

 On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara  wrote:

> Hi Kalpa,
>
> Thanks. I'll try to fix that.
>
> Regards,
> Bhathiya
>
> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
> wrote:
>
>> Hi Bhathiya,
>>
>> We are using a newer version of httpclient orbit
>> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
>> host name. You will be able to get it fixed from your test module.
>>
>> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara <
>> bhath...@wso2.com> wrote:
>>
>>> Hi Kalpa,
>>>
>>> I'm getting this error while running tests with new kernel. Any idea
>>> why?
>>>
>>> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost
>>> to url[https://10.100.0.189:9943//services/AuthenticationAdmin]
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> javax.net.ssl.SSLException: hostname in certificate didn't match:
>>> <10.100.0.189> != 
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
>>> -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
>>> -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] 
>>> -  at
>>> 

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Geeth Munasinghe
Hi Kasun,


On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe  wrote:

> Hi Bhathiya,
>
> On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Kalpa,
>>
>> I tried to do a smoke test. But I can't login to any jaggery app, due to
>> the same error. So I think we have 2 options here.
>>
>> 1) Modify default jks to accept * (wildcard) hostname.
>> 2) Introduce some config or system variable to disable hostname
>> verification,  read it from everywhere we use http client in our platform
>> and disable/enable it.
>>
>>
> Both these options introduce security vulnerabilities, so I don't think we
> should do either.
>
> Your jaggery apps are calling AuthenticationAdmin service endpoint which
> is in the same JVM. So, it is an in-jvm call. You should be using the local
> transport for that. For that, you can get the server url through the 
> *ServerURL
> *attribute in the carbon.xml. Then, append the service name at the end.
> Now, you have the endpoint you need to call.
>

In EMM, we have implemented CXF restful web services for all our admin
services and device communications. And also EMM has jaggery application
for doing all admin functionalities. So in our case we are not able to use
the local transport because it is only for axis2 services. All of those EMM
rest apis are protected by oauth and using HTTPS transport. Will there be
any concern for someone who is using the OOB EMM to as Bathiya had ? (FYI :
EMM is still in kernel version 4.4.3, so we do not have this now). If a
someone has to create a create keystore in order to use the OOB pack, they
would be a problem.


>
> Further, I have tested after changing the ServerURL from local to https
> transport to see how it works. Then, I noticed the same issue when logging
> into the mgt console as well. But it is fine since if a customer need to
> use https transport, then they need to have their own keystore.
>
> In summary, you will need to fix your jaggery apps. I don't see this as a
> problem for this release.
>
> Thanks,
> KasunG
>
>
>> I think option 1 is the most feasible . WDYT?
>>
>> Thanks,
>> Bhathiya
>>
>> On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Kalpa,
>>>
>>> Thanks. I'll try to fix that.
>>>
>>> Regards,
>>> Bhathiya
>>>
>>> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
>>> wrote:
>>>
 Hi Bhathiya,

 We are using a newer version of httpclient orbit
 (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
 host name. You will be able to get it fixed from your test module.

 On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara  wrote:

> Hi Kalpa,
>
> I'm getting this error while running tests with new kernel. Any idea
> why?
>
> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to
> url[https://10.100.0.189:9943//services/AuthenticationAdmin]
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> javax.net.ssl.SSLException: hostname in certificate didn't match:
> <10.100.0.189> != 
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at

Re: [Dev] [GREG] Invalid value error for REG_CREATED_TIME column in REG_RESOURCE with mysql 5.7

2016-06-10 Thread Uvindra Dias Jayasinha
So this has nothing to do with the TIMESTAMP issue, this is because you
have already run the script once before and now its failing because primary
keys are being duplicated

On 10 June 2016 at 16:56, Sewmini Jayaweera  wrote:

> Hi Uvindra,
>
> As per my observation in some mysql servers the script attached in my
> previous mail works but for me I had to add 'DEFAULT CURRENT_TIMESTAMP'
> option for REG_LAST_UPDATED_TIME and REG_CREATED_TIME columns of
> 'REG_RESOURCE_HISTORY' tables in addition to   'REG_RESOURCE' table.
>
>  I could fix mysql.sql script inside IS yet when I change TIMESTAMP
> columns by given DEFAULT CURRENT_TIMESTAMP' option for mysql.sql script in
> /dbscripts/apimgt/mysql.sql I got below error at the time I
> sourced it.
>
>
> source /Users/sewmini/Desktop/wso2am-1.10.0/dbscripts/apimgt/mysql.sql;
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1062 (23000): Duplicate entry 'WSO2 Identity Server' for key
> 'PRIMARY'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.01 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1061 (42000): Duplicate key name 'IDX_AT_CK_AU'
>
> ERROR 1061 (42000): Duplicate key name 'IDX_TC'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1061 (42000): Duplicate key name 'APPLICATION_NAME_CONSTRAINT'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.01 sec)
>
> Query OK, 1 row affected (0.00 sec
>
> Query OK, 1 row affected (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected, 1 warning (0.00 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> Query OK, 0 rows affected (0.01 sec)
>
> 

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread KasunG Gajasinghe
On Fri, Jun 10, 2016 at 4:42 PM, Bhathiya Jayasekara 
wrote:

> Hi Kasun,
>
> On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe 
> wrote:
>
>> Hi Bhathiya,
>>
>> On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Kalpa,
>>>
>>> I tried to do a smoke test. But I can't login to any jaggery app, due to
>>> the same error. So I think we have 2 options here.
>>>
>>> 1) Modify default jks to accept * (wildcard) hostname.
>>> 2) Introduce some config or system variable to disable hostname
>>> verification,  read it from everywhere we use http client in our platform
>>> and disable/enable it.
>>>
>>>
>> Both these options introduce security vulnerabilities, so I don't think
>> we should do either.
>>
>
> That's correct, but since no one is supposed to use default keystore or
> disable hostname verification in production, this won't be a problem at
> all.
>
>
>>
>> Your jaggery apps are calling AuthenticationAdmin service endpoint which
>> is in the same JVM.
>>
>
> This is not the case always. In a distributed setup, auth call is not in
> jvm.
>

Yes, if you are setting up a cluster, then you need to use proper
keystores.


> So we can't read it from carbon.xml.
>

I checked how APIM generates the AuthenticationAdmin endpoint. In
api-manager.xml, for the AuthManager's ServerURL, you have the https
endpoint of the local server as the default setting. Can you change this to
use local transport instead? This may be applicable to all the ServerURLs
configurations in there.

This will work when invoking axis2 back-ends, but not for other rest apis
like cxf. Does APIM has such a usecase?

One other option is modifying all our default configs to have local
> transport. But that will introduce a new configuration complexity to the
> product. However we will try if we can do that in all places.
>

There is no configuration complexity since the relevant bits are already
there.


>
> Meanwhile please consider my above suggestions again.
>
> Thanks,
> Bhathiya
>
>
>> So, it is an in-jvm call. You should be using the local transport for
>> that. For that, you can get the server url through the *ServerURL *attribute
>> in the carbon.xml. Then, append the service name at the end. Now, you have
>> the endpoint you need to call.
>>
>> Further, I have tested after changing the ServerURL from local to https
>> transport to see how it works. Then, I noticed the same issue when logging
>> into the mgt console as well. But it is fine since if a customer need to
>> use https transport, then they need to have their own keystore.
>>
>> In summary, you will need to fix your jaggery apps. I don't see this as a
>> problem for this release.
>>
>> Thanks,
>> KasunG
>>
>>
>>> I think option 1 is the most feasible . WDYT?
>>>
>>> Thanks,
>>> Bhathiya
>>>
>>> On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Kalpa,

 Thanks. I'll try to fix that.

 Regards,
 Bhathiya

 On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
 wrote:

> Hi Bhathiya,
>
> We are using a newer version of httpclient orbit
> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
> host name. You will be able to get it fixed from your test module.
>
> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara <
> bhath...@wso2.com> wrote:
>
>> Hi Kalpa,
>>
>> I'm getting this error while running tests with new kernel. Any idea
>> why?
>>
>> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to
>> url[https://10.100.0.189:9943//services/AuthenticationAdmin]
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> javax.net.ssl.SSLException: hostname in certificate didn't match:
>> <10.100.0.189> != 
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] - 
>>  at
>> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)

Re: [Dev] Issue in processing certain integer values in data mapper

2016-06-10 Thread Sohani Weerasinghe
Hi All,

Since there is already a feature to edit the properties of a particular
tree node, we can use that to change the data type

Thanks,
Sohani

Sohani Weerasinghe
Senior Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine

On Fri, Jun 10, 2016 at 11:26 AM, Sohani Weerasinghe 
wrote:

> Hi All,
>
> If we consider a payload which has values such as telephone numbers,
> userID, house no etc, when generating the JSON schema they are treated as
> "numbers".
>
> When user tries to map the payload, final generated outcome displays as a
> double value.
>
> eg: If we pass an object as below, the output comes as 1.12655655E8 which
> is wrong.
>
> 
>   0112655655
>   01
>
>
> AFAIU, before generating the mapping config user should be provided with
> an option to change the data type of that particular field into String. As
> a solution I think we should provide a property so that user can change the
> type. WDYT?
>
> Thanks,
> Sohani
>
> Sohani Weerasinghe
> Senior Software Engineer
> WSO2, Inc: http://wso2.com
>
> Mobile  : +94 716439774
> Blog :http://christinetechtips.blogspot.com/
> Twitter  : https://twitter.com/sohanichristine
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GREG] Invalid value error for REG_CREATED_TIME column in REG_RESOURCE with mysql 5.7

2016-06-10 Thread Sewmini Jayaweera
Hi Uvindra,

As per my observation in some mysql servers the script attached in my
previous mail works but for me I had to add 'DEFAULT CURRENT_TIMESTAMP'
option for REG_LAST_UPDATED_TIME and REG_CREATED_TIME columns of
'REG_RESOURCE_HISTORY' tables in addition to   'REG_RESOURCE' table.

 I could fix mysql.sql script inside IS yet when I change TIMESTAMP columns
by given DEFAULT CURRENT_TIMESTAMP' option for mysql.sql script in
/dbscripts/apimgt/mysql.sql I got below error at the time I
sourced it.


source /Users/sewmini/Desktop/wso2am-1.10.0/dbscripts/apimgt/mysql.sql;

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1062 (23000): Duplicate entry 'WSO2 Identity Server' for key 'PRIMARY'

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.01 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1061 (42000): Duplicate key name 'IDX_AT_CK_AU'

ERROR 1061 (42000): Duplicate key name 'IDX_TC'

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1061 (42000): Duplicate key name 'APPLICATION_NAME_CONSTRAINT'

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

ERROR 1022 (23000): Can't write; duplicate key in table '#sql-72cd_8'

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.01 sec)

Query OK, 1 row affected (0.00 sec

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected, 1 warning (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 0 rows affected (0.00 sec)

Records: 0  Duplicates: 0  Warnings: 0
I have also attached the script I used.

Regards,
Sewmini


Sewmini Jayaweera
*Software Engineer - QA Team*
Mobile: +94 (0) 773 381 250
sewm...@wso2.com

On Fri, Jun 10, 2016 at 11:47 AM, Uvindra Dias Jayasinha 
wrote:

> Ok I just 

[Dev] [UUF] Programmatically add/remove/modify items on menu.

2016-06-10 Thread Hemika Kodikara
Hi All,

Is it possible to programmatically add/remove/modify items to the menu ?

In MB we are making changes to have pluggable protocols. So the UI should
reflect when a protocol is added/removed.

Thoughts ?

Regards,
Hemika

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

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


Re: [Dev] [CEP] Dynamic key and values support in CEP output adapter

2016-06-10 Thread Mohanadarshan Vivekanandalingam
On Fri, Jun 10, 2016 at 3:13 PM, Rajjaz Mohammed  wrote:

> Hi,
>
> I'm planning to follow the same approach followed in CEP kafka input event
> adapter to get optional configuration properties.
>
> @Mohanadharshan
> WDYT?
>

If that is the requirement then +1..

Thanks,
Mohan


>
> [1]
> https://docs.wso2.com/display/CEP300/Input+Kafka+Event+Adapter#InputKafkaEventAdapter-ConfiguringinputKafkaeventadapter
> 
>
>
>
> On Fri, Jun 10, 2016 at 1:39 PM, Rajjaz Mohammed  wrote:
>
>> Hi,
>>
>> Currently, FileWriter will Save the events in given file but As we
>> discussed I need to add events to different files based on some unique keys
>> from the single stream. So we need to keep unique value and the file name
>> belongs to the unique key. How this possible in CEP output adapter?
>>
>> On Fri, Jun 10, 2016 at 12:14 PM, Mohanadarshan Vivekanandalingam <
>> mo...@wso2.com> wrote:
>>
>>> HI Rajjaz,
>>>
>>> I am not clear about your requirement.. Can you explain your requirement
>>> please ?
>>>
>>> Thanks,
>>> Mohan
>>>
>>>
>>> On Fri, Jun 10, 2016 at 11:21 AM, Rajjaz Mohammed 
>>> wrote:
>>>
 Hi All,

 I'm developing File event publisher as an analytics extension. I have
 the requirement to get the key and  values dynamically. How can achieve
 this in CEP? any idea?

 eg:
 uniqueID1--> filePath1
 uniqueID2--> filePath2
 uniqueID3--> filePath3
 uniqueID4--> filePath4


 --
 Thank you
 Best Regards

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

>>>
>>>
>>>
>>> --
>>> *V. Mohanadarshan*
>>> *Associate Tech Lead,*
>>> *Data Technologies Team,*
>>> *WSO2, Inc. http://wso2.com  *
>>> *lean.enterprise.middleware.*
>>>
>>> email: mo...@wso2.com
>>> phone:(+94) 771117673
>>>
>>
>>
>>
>> --
>> Thank you
>> Best Regards
>>
>> *Rajjaz HM*
>> Associate Software Engineer
>> Platform Extension Team
>> WSO2 Inc. 
>> lean | enterprise | middleware
>> Mobile | +94752833834|+94777226874
>> Email   | raj...@wso2.com
>> LinkedIn  | Blogger
>>  | WSO2 Profile
>> 
>>
>
>
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> Platform Extension Team
> WSO2 Inc. 
> lean | enterprise | middleware
> Mobile | +94752833834|+94777226874
> Email   | raj...@wso2.com
> LinkedIn  | Blogger
>  | WSO2 Profile
> 
>



-- 
*V. Mohanadarshan*
*Associate Tech Lead,*
*Data Technologies Team,*
*WSO2, Inc. http://wso2.com  *
*lean.enterprise.middleware.*

email: mo...@wso2.com
phone:(+94) 771117673
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Bhathiya Jayasekara
Hi Kasun,

On Fri, Jun 10, 2016 at 4:10 PM, KasunG Gajasinghe  wrote:

> Hi Bhathiya,
>
> On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Kalpa,
>>
>> I tried to do a smoke test. But I can't login to any jaggery app, due to
>> the same error. So I think we have 2 options here.
>>
>> 1) Modify default jks to accept * (wildcard) hostname.
>> 2) Introduce some config or system variable to disable hostname
>> verification,  read it from everywhere we use http client in our platform
>> and disable/enable it.
>>
>>
> Both these options introduce security vulnerabilities, so I don't think we
> should do either.
>

That's correct, but since no one is supposed to use default keystore or
disable hostname verification in production, this won't be a problem at
all.


>
> Your jaggery apps are calling AuthenticationAdmin service endpoint which
> is in the same JVM.
>

This is not the case always. In a distributed setup, auth call is not in
jvm. So we can't read it from carbon.xml.
One other option is modifying all our default configs to have local
transport. But that will introduce a new configuration complexity to the
product. However we will try if we can do that in all places.

Meanwhile please consider my above suggestions again.

Thanks,
Bhathiya


> So, it is an in-jvm call. You should be using the local transport for
> that. For that, you can get the server url through the *ServerURL *attribute
> in the carbon.xml. Then, append the service name at the end. Now, you have
> the endpoint you need to call.
>
> Further, I have tested after changing the ServerURL from local to https
> transport to see how it works. Then, I noticed the same issue when logging
> into the mgt console as well. But it is fine since if a customer need to
> use https transport, then they need to have their own keystore.
>
> In summary, you will need to fix your jaggery apps. I don't see this as a
> problem for this release.
>
> Thanks,
> KasunG
>
>
>> I think option 1 is the most feasible . WDYT?
>>
>> Thanks,
>> Bhathiya
>>
>> On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Kalpa,
>>>
>>> Thanks. I'll try to fix that.
>>>
>>> Regards,
>>> Bhathiya
>>>
>>> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
>>> wrote:
>>>
 Hi Bhathiya,

 We are using a newer version of httpclient orbit
 (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
 host name. You will be able to get it fixed from your test module.

 On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara  wrote:

> Hi Kalpa,
>
> I'm getting this error while running tests with new kernel. Any idea
> why?
>
> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to
> url[https://10.100.0.189:9943//services/AuthenticationAdmin]
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> javax.net.ssl.SSLException: hostname in certificate didn't match:
> <10.100.0.189> != 
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
> at
> 

Re: [Dev] [APIM 2.0]What is the order of matching Conditional groups in Advance Resource Throttling?

2016-06-10 Thread Harsha Kumara
Hi Ushani,

On Fri, Jun 10, 2016 at 2:28 PM, Ushani Balasooriya  wrote:

> Hi Harsha,
>
> Additionally please explain how it should behave if the request matches
> one conditional group and default conditional group as well.
>
There is no possibility of request being applying to conditional group and
a default policy. If one request match two conditional groups, one with
lowest request count will be throttle out first.

>
> Scenario 2 :
> E.g.,
>
> E.g.
> Conditional group 1 : JWT claim condition and Query Param Condition
>
> Conditional group 2 : Header condition
>
> A request matches both condition group1 and default request count is also
> configured.
>
> Thanks,
>
> On Fri, Jun 10, 2016 at 2:17 PM, Ushani Balasooriya 
> wrote:
>
>> Hi Harsha,
>>
>> In API Manager 2.0, Advance throttling configuration, if there are
>> multiple conditional groups defined and if a request matches multiple
>> conditional groups how it should work?
>>
>> Is there a priority that should be matched or should it match the lowest
>> request count?
>>
>> Scenario :1
>
>> E.g.
>> Conditional group 1 : JWT claim condition and Query Param Condition
>>
>> Conditional group 2 :Header condition
>>
>> A request matches both condition groups.
>>
> With the current design, policy which have lowest request count will be
applied if request match that particular conditional group. However we are
discussing the behavior of this further. Will update if we have done any
changes.

>
>>
>> Thanks,
>> --
>> *Ushani Balasooriya*
>> Senior Software Engineer - QA;
>> WSO2 Inc; http://www.wso2.com/.
>>
>>
>
>
> --
> *Ushani Balasooriya*
> Senior Software Engineer - QA;
> WSO2 Inc; http://www.wso2.com/.
> Mobile; +94772636796
>
>


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


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread KasunG Gajasinghe
Hi Bhathiya,

On Fri, Jun 10, 2016 at 3:19 PM, Bhathiya Jayasekara 
wrote:

> Hi Kalpa,
>
> I tried to do a smoke test. But I can't login to any jaggery app, due to
> the same error. So I think we have 2 options here.
>
> 1) Modify default jks to accept * (wildcard) hostname.
> 2) Introduce some config or system variable to disable hostname
> verification,  read it from everywhere we use http client in our platform
> and disable/enable it.
>
>
Both these options introduce security vulnerabilities, so I don't think we
should do either.

Your jaggery apps are calling AuthenticationAdmin service endpoint which is
in the same JVM. So, it is an in-jvm call. You should be using the local
transport for that. For that, you can get the server url through the *ServerURL
*attribute in the carbon.xml. Then, append the service name at the end.
Now, you have the endpoint you need to call.

Further, I have tested after changing the ServerURL from local to https
transport to see how it works. Then, I noticed the same issue when logging
into the mgt console as well. But it is fine since if a customer need to
use https transport, then they need to have their own keystore.

In summary, you will need to fix your jaggery apps. I don't see this as a
problem for this release.

Thanks,
KasunG


> I think option 1 is the most feasible . WDYT?
>
> Thanks,
> Bhathiya
>
> On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Kalpa,
>>
>> Thanks. I'll try to fix that.
>>
>> Regards,
>> Bhathiya
>>
>> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
>> wrote:
>>
>>> Hi Bhathiya,
>>>
>>> We are using a newer version of httpclient orbit
>>> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
>>> host name. You will be able to get it fixed from your test module.
>>>
>>> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara 
>>> wrote:
>>>
 Hi Kalpa,

 I'm getting this error while running tests with new kernel. Any idea
 why?

 [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to
 url[https://10.100.0.189:9943//services/AuthenticationAdmin]
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
 javax.net.ssl.SSLException: hostname in certificate didn't match:
 <10.100.0.189> != 
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:659)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
 INFO
  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  
 at
 

[Dev] [DEV] [SMS Transport] Problem with Exception Handling

2016-06-10 Thread Biruntha Gnaneswaran
Hi Devs,

I want to send SMS using axis2 SMS Transport [1] . I try with below code.
It works fine in normal case. Here sentInfo() is used to send SMS. But if
there is an exception in sentInfo() method, I couldn’t catch that exception
from my code. Because sendSMS() method in SMPPImplManager class didn’t
throw any exception.

Is there any way to solve this problem?

*try *{smsMessage = *new *SMSMessage(sender,phoneNo,message,*2*);
  manager.sentInfo(smsMessage);*log*.info(*"Successfully completed
sending SMS"*);} *catch *(Exception e){handleException(*"Error
while sending SMS: " *+ e.getMessage(), e, messageContext);}

[1]
https://github.com/wso2/wso2-axis2-transports/tree/master/modules/sms/src/main/java/org/apache/axis2/transport/sms

Thankyou,

Biruntha

Associate Software Engineer
WSO2
Email : birun...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Bhathiya Jayasekara
Hi Kalpa,

I tried to do a smoke test. But I can't login to any jaggery app, due to
the same error. So I think we have 2 options here.

1) Modify default jks to accept * (wildcard) hostname.
2) Introduce some config or system variable to disable hostname
verification,  read it from everywhere we use http client in our platform
and disable/enable it.

I think option 1 is the most feasible . WDYT?

Thanks,
Bhathiya

On Fri, Jun 10, 2016 at 2:37 PM, Bhathiya Jayasekara 
wrote:

> Hi Kalpa,
>
> Thanks. I'll try to fix that.
>
> Regards,
> Bhathiya
>
> On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda 
> wrote:
>
>> Hi Bhathiya,
>>
>> We are using a newer version of httpclient orbit
>> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
>> host name. You will be able to get it fixed from your test module.
>>
>> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara 
>> wrote:
>>
>>> Hi Kalpa,
>>>
>>> I'm getting this error while running tests with new kernel. Any idea why?
>>>
>>> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to
>>> url[https://10.100.0.189:9943//services/AuthenticationAdmin]
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>>> javax.net.ssl.SSLException: hostname in certificate didn't match:
>>> <10.100.0.189> != 
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:659)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
>>> INFO
>>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>>> org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
>>> INFO
>>>  

Re: [Dev] [CEP] Dynamic key and values support in CEP output adapter

2016-06-10 Thread Rajjaz Mohammed
Hi,

I'm planning to follow the same approach followed in CEP kafka input event
adapter to get optional configuration properties.

@Mohanadharshan
WDYT?

[1]
https://docs.wso2.com/display/CEP300/Input+Kafka+Event+Adapter#InputKafkaEventAdapter-ConfiguringinputKafkaeventadapter




On Fri, Jun 10, 2016 at 1:39 PM, Rajjaz Mohammed  wrote:

> Hi,
>
> Currently, FileWriter will Save the events in given file but As we
> discussed I need to add events to different files based on some unique keys
> from the single stream. So we need to keep unique value and the file name
> belongs to the unique key. How this possible in CEP output adapter?
>
> On Fri, Jun 10, 2016 at 12:14 PM, Mohanadarshan Vivekanandalingam <
> mo...@wso2.com> wrote:
>
>> HI Rajjaz,
>>
>> I am not clear about your requirement.. Can you explain your requirement
>> please ?
>>
>> Thanks,
>> Mohan
>>
>>
>> On Fri, Jun 10, 2016 at 11:21 AM, Rajjaz Mohammed 
>> wrote:
>>
>>> Hi All,
>>>
>>> I'm developing File event publisher as an analytics extension. I have
>>> the requirement to get the key and  values dynamically. How can achieve
>>> this in CEP? any idea?
>>>
>>> eg:
>>> uniqueID1--> filePath1
>>> uniqueID2--> filePath2
>>> uniqueID3--> filePath3
>>> uniqueID4--> filePath4
>>>
>>>
>>> --
>>> Thank you
>>> Best Regards
>>>
>>> *Rajjaz HM*
>>> Associate Software Engineer
>>> Platform Extension Team
>>> WSO2 Inc. 
>>> lean | enterprise | middleware
>>> Mobile | +94752833834|+94777226874
>>> Email   | raj...@wso2.com
>>> LinkedIn  | Blogger
>>>  | WSO2 Profile
>>> 
>>>
>>
>>
>>
>> --
>> *V. Mohanadarshan*
>> *Associate Tech Lead,*
>> *Data Technologies Team,*
>> *WSO2, Inc. http://wso2.com  *
>> *lean.enterprise.middleware.*
>>
>> email: mo...@wso2.com
>> phone:(+94) 771117673
>>
>
>
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> Platform Extension Team
> WSO2 Inc. 
> lean | enterprise | middleware
> Mobile | +94752833834|+94777226874
> Email   | raj...@wso2.com
> LinkedIn  | Blogger
>  | WSO2 Profile
> 
>



-- 
Thank you
Best Regards

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

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


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Bhathiya Jayasekara
Hi Kalpa,

Thanks. I'll try to fix that.

Regards,
Bhathiya

On Fri, Jun 10, 2016 at 2:31 PM, Kalpa Welivitigoda  wrote:

> Hi Bhathiya,
>
> We are using a newer version of httpclient orbit
> (commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
> host name. You will be able to get it fixed from your test module.
>
> On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara 
> wrote:
>
>> Hi Kalpa,
>>
>> I'm getting this error while running tests with new kernel. Any idea why?
>>
>> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to url[
>> https://10.100.0.189:9943//services/AuthenticationAdmin]
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
>> javax.net.ssl.SSLException: hostname in certificate didn't match:
>> <10.100.0.189> != 
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:659)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_login(APIStoreHostObject.java:638)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>> INFO
>>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
>> 

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Kalpa Welivitigoda
Hi Bhathiya,

We are using a newer version of httpclient orbit
(commons-httpclient-3.1.0.wso2v3.jar) in kernel 4.4.6 and it verify the
host name. You will be able to get it fixed from your test module.

On Fri, Jun 10, 2016 at 1:02 PM, Bhathiya Jayasekara 
wrote:

> Hi Kalpa,
>
> I'm getting this error while running tests with new kernel. Any idea why?
>
> [2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to url[
> https://10.100.0.189:9943//services/AuthenticationAdmin]
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -
> javax.net.ssl.SSLException: hostname in certificate didn't match:
> <10.100.0.189> != 
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:659)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_login(APIStoreHostObject.java:638)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> INFO
>  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader] -  at
> java.lang.reflect.Method.invoke(Method.java:498)
> INFO
>  

Re: [Dev] [APIM 2.0]What is the order of matching Conditional groups in Advance Resource Throttling?

2016-06-10 Thread Ushani Balasooriya
Hi Harsha,

Additionally please explain how it should behave if the request matches one
conditional group and default conditional group as well.

Scenario 2 :
E.g.,

E.g.
Conditional group 1 : JWT claim condition and Query Param Condition

Conditional group 2 : Header condition

A request matches both condition group1 and default request count is also
configured.

Thanks,

On Fri, Jun 10, 2016 at 2:17 PM, Ushani Balasooriya  wrote:

> Hi Harsha,
>
> In API Manager 2.0, Advance throttling configuration, if there are
> multiple conditional groups defined and if a request matches multiple
> conditional groups how it should work?
>
> Is there a priority that should be matched or should it match the lowest
> request count?
>
> Scenario :1

> E.g.
> Conditional group 1 : JWT claim condition and Query Param Condition
>
> Conditional group 2 :Header condition
>
> A request matches both condition groups.
>
>
> Thanks,
> --
> *Ushani Balasooriya*
> Senior Software Engineer - QA;
> WSO2 Inc; http://www.wso2.com/.
>
>


-- 
*Ushani Balasooriya*
Senior Software Engineer - QA;
WSO2 Inc; http://www.wso2.com/.
Mobile; +94772636796
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Hemika Kodikara
Also please note that I used JSON.stringify method in server side js.

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

Mobile : +9477762

On Fri, Jun 10, 2016 at 2:13 PM, Hemika Kodikara  wrote:

> Thanks Rasika for the solution.
>
> In the client side JS, have the following code :
>
> 
> var protocols = *{{{protocols}}}*;
> $.each(protocols, function(index, value) {
>
> $('#queue-subscription-protocols').append($('

[Dev] [APIM 2.0]What is the order of matching Conditional groups in Advance Resource Throttling?

2016-06-10 Thread Ushani Balasooriya
Hi Harsha,

In API Manager 2.0, Advance throttling configuration, if there are multiple
conditional groups defined and if a request matches multiple conditional
groups how it should work?

Is there a priority that should be matched or should it match the lowest
request count?

E.g.
Conditional group 1 : JWT claim condition and Query Param Condition

Conditional group 2 :Header condition

A request matches both condition groups.


Thanks,
-- 
*Ushani Balasooriya*
Senior Software Engineer - QA;
WSO2 Inc; http://www.wso2.com/.
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Hemika Kodikara
Thanks Rasika for the solution.

In the client side JS, have the following code :


var protocols = *{{{protocols}}}*;
$.each(protocols, function(index, value) {

$('#queue-subscription-protocols').append($('

Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Hemika Kodikara
Hi Milinda,

It is not a string array, its actually java objects that is there.

Hi Sajith,

I modified the nashorn script as following :

var onRequest = function (context) {
var protocols = callOSGiService("org.wso2.andes.kernel.Andes",
"getSupportedProtocols", []);
var protocolStrings = [];
for each (var item in protocols) {
protocolStrings.push(item.toString());
}

// var protocolsJson = JSON.stringify(protocolStrings);
return {"protocols" : protocolStrings};
};

I am assigning the "protocols" json value to a javascript variable in the
client-side as following :

var protocols =* {{protocols}}*;
$.each(protocols, function(index, value) {

('#queue-subscription-protocols').append($('').text(value).attr('value',
index));
});


But I am getting the following errors when rendered the page(client side
js) :

var protocols = [object Array];<-- Syntax error

When I use JSON.stringify in server side js, I get the following output :

var protocols =
[AMQP-0-10,MQTT-default,AMQP-0-91,AMQP-8-0,AMQP-0-9];
  <-- Unexpected token &

Any Idea ?

Regards,
Hemika


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

Mobile : +9477762

On Fri, Jun 10, 2016 at 12:51 PM, Milinda Perera  wrote:

> Hi Hemika,
>
> If AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9 are strings,
> following should work
>
> JSON.parse("[\"AMQP-0-10\", \"MQTT-default\", \"AMQP-0-91\", \"AMQP-8-0\",
> \"AMQP-0-9\"]")
>
> Accroding to [1] within array " A *value* can be a *string* in double
> quotes, or a *number*, or true or false or null, or an *object* or an
> *array*. These structures can be nested."
>
> [1] http://www.json.org/
>
> Thanks,
> Mili
>
> On Fri, Jun 10, 2016 at 12:33 PM, Hemika Kodikara  wrote:
>
>> Hi All,
>>
>> I am invoking the callOSGiService method in nashorn to get a list of
>> protocols thats in andes of MB.
>>
>> I am getting the following output after invoking the callOSGiService :
>> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>>
>> But need to convert it into a javascript array(Probably a String array).
>> Need to bind it to a dropdown(select element).
>>
>> I tried JSON.parse, but getting the following errors :
>>
>> jjs> JSON.parse("[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0,
>> AMQP-0-9]");
>> :1 SyntaxError: Invalid JSON: :1:1 Expected json literal but
>> found ident
>> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>>  ^
>>
>> jjs> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
>> ECMAScript Exception: SyntaxError: :1:28 Expected an operand but
>> found default
>> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
>> ^
>>
>> My OSGi method returns a Set.
>>
>> How can I achieve this ?
>>
>> Regards,
>> Hemika
>>
>> Hemika Kodikara
>> Software Engineer
>> WSO2 Inc.
>> lean . enterprise . middleware
>> http://wso2.com
>>
>> Mobile : +9477762
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Milinda Perera
> Software Engineer;
> WSO2 Inc. http://wso2.com ,
> Mobile: (+94) 714 115 032
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [CEP] Dynamic key and values support in CEP output adapter

2016-06-10 Thread Rajjaz Mohammed
Hi,

Currently, FileWriter will Save the events in given file but As we
discussed I need to add events to different files based on some unique keys
from the single stream. So we need to keep unique value and the file name
belongs to the unique key. How this possible in CEP output adapter?

On Fri, Jun 10, 2016 at 12:14 PM, Mohanadarshan Vivekanandalingam <
mo...@wso2.com> wrote:

> HI Rajjaz,
>
> I am not clear about your requirement.. Can you explain your requirement
> please ?
>
> Thanks,
> Mohan
>
>
> On Fri, Jun 10, 2016 at 11:21 AM, Rajjaz Mohammed  wrote:
>
>> Hi All,
>>
>> I'm developing File event publisher as an analytics extension. I have the
>> requirement to get the key and  values dynamically. How can achieve this in
>> CEP? any idea?
>>
>> eg:
>> uniqueID1--> filePath1
>> uniqueID2--> filePath2
>> uniqueID3--> filePath3
>> uniqueID4--> filePath4
>>
>>
>> --
>> Thank you
>> Best Regards
>>
>> *Rajjaz HM*
>> Associate Software Engineer
>> Platform Extension Team
>> WSO2 Inc. 
>> lean | enterprise | middleware
>> Mobile | +94752833834|+94777226874
>> Email   | raj...@wso2.com
>> LinkedIn  | Blogger
>>  | WSO2 Profile
>> 
>>
>
>
>
> --
> *V. Mohanadarshan*
> *Associate Tech Lead,*
> *Data Technologies Team,*
> *WSO2, Inc. http://wso2.com  *
> *lean.enterprise.middleware.*
>
> email: mo...@wso2.com
> phone:(+94) 771117673
>



-- 
Thank you
Best Regards

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

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


Re: [Dev] [CEP] Dynamic key and values support in CEP output adapter

2016-06-10 Thread Yashothara Shanmugarajah
Hi,

In CEP output adapter, we give values for predefined parameters. But we
cant add dynamic parameters and values for that parameters. Is there any
way to add dynamic parameters when we configure output adapter? Through
that we can give parameter name and values.

@Rajjaz Please clarify whether it is your requirement.

Best Regards,
Yashothara.S

Software Engineer
WSO2


On Fri, Jun 10, 2016 at 12:14 PM, Mohanadarshan Vivekanandalingam <
mo...@wso2.com> wrote:

> HI Rajjaz,
>
> I am not clear about your requirement.. Can you explain your requirement
> please ?
>
> Thanks,
> Mohan
>
>
> On Fri, Jun 10, 2016 at 11:21 AM, Rajjaz Mohammed  wrote:
>
>> Hi All,
>>
>> I'm developing File event publisher as an analytics extension. I have the
>> requirement to get the key and  values dynamically. How can achieve this in
>> CEP? any idea?
>>
>> eg:
>> uniqueID1--> filePath1
>> uniqueID2--> filePath2
>> uniqueID3--> filePath3
>> uniqueID4--> filePath4
>>
>>
>> --
>> Thank you
>> Best Regards
>>
>> *Rajjaz HM*
>> Associate Software Engineer
>> Platform Extension Team
>> WSO2 Inc. 
>> lean | enterprise | middleware
>> Mobile | +94752833834|+94777226874
>> Email   | raj...@wso2.com
>> LinkedIn  | Blogger
>>  | WSO2 Profile
>> 
>>
>
>
>
> --
> *V. Mohanadarshan*
> *Associate Tech Lead,*
> *Data Technologies Team,*
> *WSO2, Inc. http://wso2.com  *
> *lean.enterprise.middleware.*
>
> email: mo...@wso2.com
> phone:(+94) 771117673
>
> ___
> 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] Checking isDebugEnabled() for formatted debug logs

2016-06-10 Thread Isuru Perera
Okay. But I still believe we should have guard conditions especially for
debug messages. It doesn't matter how the underlying implementation handles
the log message. As a practice, we should use guard conditions. SLF4J API
already provides a way to check the log level. So, we should use that. It
also doesn't matter whether we use formatted messages or not.

On Fri, Jun 10, 2016 at 1:08 PM, Abimaran Kugathasan 
wrote:

> Hi Isuru,
>
> On Thu, Jun 9, 2016 at 4:54 PM, Isuru Perera  wrote:
>
>>
>>
>> On Thu, Jun 9, 2016 at 4:28 PM, Abimaran Kugathasan 
>> wrote:
>>
>>> I think, it's depends on the framework and their versions.
>>>
>>> latest versions of slf4j or log4j 2 don't require guard statements.
>>>
>> Have they mentioned about this somewhere?
>>
> If you check slf4j Log4jLoggerAdapter class debug method [1],  you can
> see, the method itself check for whether logger is enabled for that level
>
>
> public void debug(String format, Object arg1, Object arg2) {
> if (logger.isDebugEnabled()) {
> FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
> logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable());
> }
> }
>
> [1] :
> http://www.slf4j.org/api/org/slf4j/impl/Log4jLoggerAdapter.html#debug(java.lang.String,
> java.lang.Object...)
>
>
>
>> They use a parameterized log statement so that an event can be logged
>>> unconditionally, but message formatting only occurs if the event is
>>> enabled. Message construction is performed as needed by the logger, rather
>>> than pre-emptively by the application.
>>>
>> That's right, but if we have a guard condition, there won't be a string
>> object created in the runtime. This is what I said earlier and we need to
>> avoid unnecessary strings.
>>
>>>
>>> On Thu, Jun 9, 2016 at 3:13 PM, Isuru Perera  wrote:
>>>
 I think it's better to use isDebugEnabled for any debug log, even if it
 is using parameters for a formatted string. If the debug is not enabled, we
 don't even want to create the String object.

 No need to assign to a final variable. Checking the condition just
 before logging should be enough.

 On Thu, Jun 9, 2016 at 3:06 PM, Afkham Azeez  wrote:

> No need to do isDebugEnabled ideally for formatted logs.
>
> On Thu, Jun 9, 2016 at 3:01 PM, Jayanga Kaushalya 
> wrote:
>
>> Hi,
>>
>> Do we need to check whether the isDebugEnabled() for formatted debug
>> logs without any string concatenations? For example below code:
>>
>> if (log.isDebugEnabled) {
>>log.debug("Test log with var: {} and var: {}", var1, var2);
>> }
>>
>> If we have to check it is, what is the best way to check it? Assign
>> it to a final variable in the class header or check it every time where
>> their is a debug log like above code?
>>
>> Thanks!
>>
>> *Jayanga Kaushalya*
>> Software Engineer
>> Mobile: +94777860160
>> WSO2 Inc. | http://wso2.com
>> lean.enterprise.middleware
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * *
> *email: **az...@wso2.com* 
> * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
> *http://blog.afkham.org* 
> *twitter: **http://twitter.com/afkham_azeez*
> 
> *linked-in: **http://lk.linkedin.com/in/afkhamazeez
> *
>
> *Lean . Enterprise . Middleware*
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


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

 about.me/chrishantha
 Contact: +IsuruPereraWSO2
 

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


>>>
>>>
>>> --
>>> Thanks
>>> Abimaran Kugathasan
>>> Senior Software Engineer
>>>
>>> Email : abima...@wso2.com
>>> Mobile : +94 773922820
>>>
>>> 
>>> 
>>>   
>>> 
>>>
>>>
>>
>>
>> --
>> Isuru Perera
>> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> about.me/chrishantha
>> Contact: +IsuruPereraWSO2 
>>
>
>
>
> --
> Thanks
> Abimaran Kugathasan
> Senior Software Engineer
>
> Email : 

Re: [Dev] Checking isDebugEnabled() for formatted debug logs

2016-06-10 Thread Abimaran Kugathasan
Hi Isuru,

On Thu, Jun 9, 2016 at 4:54 PM, Isuru Perera  wrote:

>
>
> On Thu, Jun 9, 2016 at 4:28 PM, Abimaran Kugathasan 
> wrote:
>
>> I think, it's depends on the framework and their versions.
>>
>> latest versions of slf4j or log4j 2 don't require guard statements.
>>
> Have they mentioned about this somewhere?
>
If you check slf4j Log4jLoggerAdapter class debug method [1],  you can see,
the method itself check for whether logger is enabled for that level


public void debug(String format, Object arg1, Object arg2) {
if (logger.isDebugEnabled()) {
FormattingTuple ft = MessageFormatter.format(format, arg1, arg2);
logger.log(FQCN, Level.DEBUG, ft.getMessage(), ft.getThrowable());
}
}

[1] :
http://www.slf4j.org/api/org/slf4j/impl/Log4jLoggerAdapter.html#debug(java.lang.String,
java.lang.Object...)



> They use a parameterized log statement so that an event can be logged
>> unconditionally, but message formatting only occurs if the event is
>> enabled. Message construction is performed as needed by the logger, rather
>> than pre-emptively by the application.
>>
> That's right, but if we have a guard condition, there won't be a string
> object created in the runtime. This is what I said earlier and we need to
> avoid unnecessary strings.
>
>>
>> On Thu, Jun 9, 2016 at 3:13 PM, Isuru Perera  wrote:
>>
>>> I think it's better to use isDebugEnabled for any debug log, even if it
>>> is using parameters for a formatted string. If the debug is not enabled, we
>>> don't even want to create the String object.
>>>
>>> No need to assign to a final variable. Checking the condition just
>>> before logging should be enough.
>>>
>>> On Thu, Jun 9, 2016 at 3:06 PM, Afkham Azeez  wrote:
>>>
 No need to do isDebugEnabled ideally for formatted logs.

 On Thu, Jun 9, 2016 at 3:01 PM, Jayanga Kaushalya 
 wrote:

> Hi,
>
> Do we need to check whether the isDebugEnabled() for formatted debug
> logs without any string concatenations? For example below code:
>
> if (log.isDebugEnabled) {
>log.debug("Test log with var: {} and var: {}", var1, var2);
> }
>
> If we have to check it is, what is the best way to check it? Assign it
> to a final variable in the class header or check it every time where their
> is a debug log like above code?
>
> Thanks!
>
> *Jayanga Kaushalya*
> Software Engineer
> Mobile: +94777860160
> WSO2 Inc. | http://wso2.com
> lean.enterprise.middleware
>



 --
 *Afkham Azeez*
 Director of Architecture; WSO2, Inc.; http://wso2.com
 Member; Apache Software Foundation; http://www.apache.org/
 * *
 *email: **az...@wso2.com* 
 * cell: +94 77 3320919 <%2B94%2077%203320919>blog: *
 *http://blog.afkham.org* 
 *twitter: **http://twitter.com/afkham_azeez*
 
 *linked-in: **http://lk.linkedin.com/in/afkhamazeez
 *

 *Lean . Enterprise . Middleware*

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


>>>
>>>
>>> --
>>> Isuru Perera
>>> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
>>> Lean . Enterprise . Middleware
>>>
>>> about.me/chrishantha
>>> Contact: +IsuruPereraWSO2
>>> 
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> Thanks
>> Abimaran Kugathasan
>> Senior Software Engineer
>>
>> Email : abima...@wso2.com
>> Mobile : +94 773922820
>>
>> 
>> 
>>   
>> 
>>
>>
>
>
> --
> Isuru Perera
> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
> Contact: +IsuruPereraWSO2 
>



-- 
Thanks
Abimaran Kugathasan
Senior Software Engineer

Email : abima...@wso2.com
Mobile : +94 773922820


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


Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Bhathiya Jayasekara
Hi Kalpa,

I'm getting this error while running tests with new kernel. Any idea why?

[2016-06-10 12:45:49,077]  INFO - HTTPSender Unable to sendViaPost to url[
https://10.100.0.189:9943//services/AuthenticationAdmin]
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
- javax.net.ssl.SSLException: hostname in certificate didn't match:
<10.100.0.189> != 
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:341)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:277)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:260)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:169)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:659)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.wso2.carbon.authenticator.stub.AuthenticationAdminStub.login(AuthenticationAdminStub.java:659)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
org.wso2.carbon.apimgt.hostobjects.APIStoreHostObject.jsFunction_login(APIStoreHostObject.java:638)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at java.lang.reflect.Method.invoke(Method.java:498)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:386)
INFO  [org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader]
-  at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
INFO  

Re: [Dev] Modifications to the DCR endpoint

2016-06-10 Thread Kaveesha Perera
Hi,

Removed the call to retrieveApplication method.

Relevant PR can be found in[1].

[1]https://github.com/wso2/carbon-apimgt/pull/2495

On Thu, Jun 9, 2016 at 2:08 PM, Amila De Silva  wrote:

> Hi,
>
> IMO DCR implementation should not depend on/use AMDefaultKeyManagerImpl
> because;
> 1. DCR offers a more basic functionality than AMDefaultKeyManagerImpl and
> it should be KeyManager using DCR not the other way around.
> 2. Using methods in apimgt bundles will create a dependancy on those
> components, so before using DCR, users would have to install apimgt
> features.
>
> So good if we can remove the call to retrieveApplication method.
>
> On Thu, Jun 9, 2016 at 10:16 AM, Kaveesha Perera 
> wrote:
>
>> Hi,
>>
>> I worked on a issue in APIM of DCR that was described in [1].While
>> working on it, observed that it has used APIM key manager interface based
>> implementations for DCR related operations.After discussed with the team,I
>> have  modified the DCR endpoint implementation to calll directly the
>> identity components based implementation,  than accessing it via KeyManager
>> implementation.
>>
>> The related PR can be found from here[2].
>>
>> If any feedback, let me know.
>>
>> [1] [Architecture] Behavior of OAuth 2.0 Dynamic Client Registration
>> [2] https://github.com/wso2/carbon-apimgt/pull/2495
>>
>>
>> Regards,
>> --
>> Kaveesha Perera
>> Intern - Software Engineering
>>
>> mobile: 0716130471
>>
>
>
>
> --
> *Amila De Silva*
>
> WSO2 Inc.
> mobile :(+94) 775119302
>
>


-- 
Kaveesha Perera
Intern - Software Engineering

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


Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Milinda Perera
Hi Hemika,

If AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9 are strings,
following should work

JSON.parse("[\"AMQP-0-10\", \"MQTT-default\", \"AMQP-0-91\", \"AMQP-8-0\",
\"AMQP-0-9\"]")

Accroding to [1] within array " A *value* can be a *string* in double
quotes, or a *number*, or true or false or null, or an *object* or an
*array*. These structures can be nested."

[1] http://www.json.org/

Thanks,
Mili

On Fri, Jun 10, 2016 at 12:33 PM, Hemika Kodikara  wrote:

> Hi All,
>
> I am invoking the callOSGiService method in nashorn to get a list of
> protocols thats in andes of MB.
>
> I am getting the following output after invoking the callOSGiService :
> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>
> But need to convert it into a javascript array(Probably a String array).
> Need to bind it to a dropdown(select element).
>
> I tried JSON.parse, but getting the following errors :
>
> jjs> JSON.parse("[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0,
> AMQP-0-9]");
> :1 SyntaxError: Invalid JSON: :1:1 Expected json literal but
> found ident
> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>  ^
>
> jjs> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
> ECMAScript Exception: SyntaxError: :1:28 Expected an operand but
> found default
> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
> ^
>
> My OSGi method returns a Set.
>
> How can I achieve this ?
>
> Regards,
> Hemika
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Milinda Perera
Software Engineer;
WSO2 Inc. http://wso2.com ,
Mobile: (+94) 714 115 032
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread SajithAR Ariyarathna
>
> My OSGi method returns a Set.
>
In Nashorn you can iterate though any Java Collection.

var osgiOutput = callOsgiService( ... );

var protocolNames = []; // this is a JS array

for (item in osgiOutput) {

// 'item' is a ProtocolType Java object.

// You can call Java methods on it. For example if there is a
ProtocolType.getName()
method, then you can call it as 'item.getName()' or simply 'item.name'
protocolNames.push(item.name);

}

Read more on Nashorn extension [1]

[1] https://wiki.openjdk.java.net/display/Nashorn/Nashorn+extensions

Thanks.

On Fri, Jun 10, 2016 at 12:33 PM, Hemika Kodikara  wrote:

> Hi All,
>
> I am invoking the callOSGiService method in nashorn to get a list of
> protocols thats in andes of MB.
>
> I am getting the following output after invoking the callOSGiService :
> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>
> But need to convert it into a javascript array(Probably a String array).
> Need to bind it to a dropdown(select element).
>
> I tried JSON.parse, but getting the following errors :
>
> jjs> JSON.parse("[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0,
> AMQP-0-9]");
> :1 SyntaxError: Invalid JSON: :1:1 Expected json literal but
> found ident
> [AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
>  ^
>
> jjs> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
> ECMAScript Exception: SyntaxError: :1:28 Expected an operand but
> found default
> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
> ^
>
> My OSGi method returns a Set.
>
> How can I achieve this ?
>
> Regards,
> Hemika
>
> Hemika Kodikara
> Software Engineer
> WSO2 Inc.
> lean . enterprise . middleware
> http://wso2.com
>
> Mobile : +9477762
>



-- 
Sajith Janaprasad Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [UUF] Convert an array to a javascript string array in nashorn.

2016-06-10 Thread Hemika Kodikara
Hi All,

I am invoking the callOSGiService method in nashorn to get a list of
protocols thats in andes of MB.

I am getting the following output after invoking the callOSGiService :
[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]

But need to convert it into a javascript array(Probably a String array).
Need to bind it to a dropdown(select element).

I tried JSON.parse, but getting the following errors :

jjs> JSON.parse("[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]");
:1 SyntaxError: Invalid JSON: :1:1 Expected json literal but
found ident
[AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]
 ^

jjs> JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
ECMAScript Exception: SyntaxError: :1:28 Expected an operand but
found default
JSON.parse([AMQP-0-10, MQTT-default, AMQP-0-91, AMQP-8-0, AMQP-0-9]);
^

My OSGi method returns a Set.

How can I achieve this ?

Regards,
Hemika

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

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


Re: [Dev] [CEP] Dynamic key and values support in CEP output adapter

2016-06-10 Thread Mohanadarshan Vivekanandalingam
HI Rajjaz,

I am not clear about your requirement.. Can you explain your requirement
please ?

Thanks,
Mohan


On Fri, Jun 10, 2016 at 11:21 AM, Rajjaz Mohammed  wrote:

> Hi All,
>
> I'm developing File event publisher as an analytics extension. I have the
> requirement to get the key and  values dynamically. How can achieve this in
> CEP? any idea?
>
> eg:
> uniqueID1--> filePath1
> uniqueID2--> filePath2
> uniqueID3--> filePath3
> uniqueID4--> filePath4
>
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> Platform Extension Team
> WSO2 Inc. 
> lean | enterprise | middleware
> Mobile | +94752833834|+94777226874
> Email   | raj...@wso2.com
> LinkedIn  | Blogger
>  | WSO2 Profile
> 
>



-- 
*V. Mohanadarshan*
*Associate Tech Lead,*
*Data Technologies Team,*
*WSO2, Inc. http://wso2.com  *
*lean.enterprise.middleware.*

email: mo...@wso2.com
phone:(+94) 771117673
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [CEP] Dynamic key and values support in CEP output adapter

2016-06-10 Thread Rajjaz Mohammed
Hi All,

In WSO2 ESB custom inbound we can add parameter and parameter value
dynamically[1]. Can we do the same operation like this[1] in CEP? if so we
can achieve the requirement from it.

[1]
[image: Inline image 1]


On Fri, Jun 10, 2016 at 11:21 AM, Rajjaz Mohammed  wrote:

> Hi All,
>
> I'm developing File event publisher as an analytics extension. I have the
> requirement to get the key and  values dynamically. How can achieve this in
> CEP? any idea?
>
> eg:
> uniqueID1--> filePath1
> uniqueID2--> filePath2
> uniqueID3--> filePath3
> uniqueID4--> filePath4
>
>
> --
> Thank you
> Best Regards
>
> *Rajjaz HM*
> Associate Software Engineer
> Platform Extension Team
> WSO2 Inc. 
> lean | enterprise | middleware
> Mobile | +94752833834|+94777226874
> Email   | raj...@wso2.com
> LinkedIn  | Blogger
>  | WSO2 Profile
> 
>



-- 
Thank you
Best Regards

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

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


Re: [Dev] [GREG] Invalid value error for REG_CREATED_TIME column in REG_RESOURCE with mysql 5.7

2016-06-10 Thread Uvindra Dias Jayasinha
Ok I just executed one of the problematic table creation statements that
Sewmini has encountered on my own MySQL 5.7.12 distribution,

CREATE TABLE IF NOT EXISTS REG_RESOURCE (
   REG_PATH_ID INTEGER NOT NULL,
   REG_NAMEVARCHAR(256),
   REG_VERSION INTEGER NOT NULL AUTO_INCREMENT,
   REG_MEDIA_TYPE  VARCHAR(500),
   REG_CREATOR VARCHAR(31) NOT NULL,
   REG_CREATED_TIMETIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
   REG_LAST_UPDATORVARCHAR(31),
   REG_LAST_UPDATED_TIMETIMESTAMP NOT NULL DEFAULT
CURRENT_TIMESTAMP,
   REG_DESCRIPTION VARCHAR(1000),
   REG_CONTENT_ID  INTEGER,
   REG_TENANT_ID INTEGER DEFAULT 0,
   REG_UUID VARCHAR(100) NOT NULL,
   CONSTRAINT PK_REG_RESOURCE PRIMARY KEY(REG_VERSION,
REG_TENANT_ID)
)ENGINE INNODB;


This gets created without an issue for me

Even a table like,

CREATE TABLE IF NOT EXISTS IDN_STS_STORE (
ID INTEGER AUTO_INCREMENT,
TOKEN_ID VARCHAR(255) NOT NULL,
TOKEN_CONTENT BLOB(1024) NOT NULL,
CREATE_DATE TIMESTAMP NOT NULL,
EXPIRE_DATE TIMESTAMP NOT NULL,
STATE INTEGER DEFAULT 0,
PRIMARY KEY (ID)
)ENGINE INNODB;

which simply uses NOT NULL for TIMESTAMP gets created without an issue for
me.


My mode is same as Sewmini's,

mysql> SELECT @@SESSION.sql_mode AS MODE;
+---+
|
MODE
|
+---+
|
ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
|
+---+


So not sure why this is only failing for Sewmini.


On 10 June 2016 at 11:23, Sewmini Jayaweera  wrote:

> Hi Uvindra,
>
> I still could not get the issue resolved even after adding 'DEFAULT
> CURRENT_TIMESTAMP'  in TIMESTAMP columns which had given 'DEFUALT 0'
>
> I have attached edited script (is510/dbscripts/mysql.sql) and the errors I
> got when sourcing the script. Could you please have a look at this.
>
> Below is the MySQL mode in my server.
>
>
> +---+
>
> | @@sql_mode
>   |
>
>
> +---+
>
> |
> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
> |
>
>
> +---+
>
> Regards,
>
> Sewmini
>
> Sewmini Jayaweera
> *Software Engineer - QA Team*
> Mobile: +94 (0) 773 381 250
> sewm...@wso2.com
>
> On Thu, Jun 9, 2016 at 10:56 PM, Uvindra Dias Jayasinha 
> wrote:
>
>> Note that the above feature(auto initialize time stamp columns) was
>> introduced in MYSQL 5.6.5[1], so this kind of change to the scripts will
>> not be compatible with older MySQL versions.
>>
>>
>> [1]
>> http://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html#idm139923373307456
>>
>> On 9 June 2016 at 22:50, Uvindra Dias Jayasinha  wrote:
>>
>>> Lets just try DEFAULT CURRENT_TIMESTAMP for all TIMESTAMP fields.
>>>
>>> Avoid using ON UPDATE CURRENT_TIMESTAMP, our code already explicitly
>>> updates time stamp fields where required so we do not want MySQL to do this
>>> for us.
>>>
>>> On 9 June 2016 at 22:43, Sewmini Jayaweera  wrote:
>>>
 [Adding Uvindra and Maduranga]

 Sewmini Jayaweera
 *Software Engineer - QA Team*
 Mobile: +94 (0) 773 381 250
 sewm...@wso2.com

 On Thu, Jun 9, 2016 at 12:16 PM, Sewmini Jayaweera 
 wrote:

> Hi All,
>
> I get "ERROR 1067 (42000): Invalid default value for
> 'REG_LAST_UPDATED_TIME' error when sourcing
> '/dbscripts/mysql.sql, even after removing 'DEFAULT 0'
>  Please find further information below.
>
> *1. Issue description*
>
> CREATE TABLE IF NOT EXISTS REG_RESOURCE(
> REG_PATH_ID INTEGER NOT NULL,
> REG_NAMEVARCHAR(256),
> REG_VERSION INTEGER NOT NULL AUTO_INCREMENT,
> REG_MEDIA_TYPE  VARCHAR(500),
> REG_CREATOR VARCHAR(31) NOT NULL,
>   

Re: [Dev] [VOTE] Release WSO2 Carbon Kernel 4.4.6 RC2

2016-06-10 Thread Viraj Senevirathne
Hi Kalpa,

We ran all the integration tests in product-esb with kernel 4.4.6 RC2 and
found no test failures.

Regards,

On Fri, Jun 10, 2016 at 9:38 AM, Rajith Roshan  wrote:

> Hi all,
>
> We were able to build the G-Reg pack and able to run all the integration
> tests without failures. We will send PRs for jasper report orbit bundle and
> carbon commons, once the kernel 4.4.6 is released.
>
> Thanks!
> Rajith
>
> On Thu, Jun 9, 2016 at 6:40 PM, Viraj Senevirathne 
> wrote:
>
>> Hi All,
>>
>> We were able to build the ESB pack after including velocity bundle to the
>> mediator feature. Now we are running integration tests with the pack. Will
>> update the thread with results.
>>
>> Regards,
>>
>> On Thu, Jun 9, 2016 at 10:39 AM, Rajith Roshan  wrote:
>>
>>> Hi all,
>>>
>>> Since jasper reports orbit bundle requires org.apache.velocity and
>>> org.apache.poi.* packages, we need to upgrade the import package versions
>>> for those packages in jasper orbit bundle. Subsequently carbon-commons
>>> release would be required  with updated jasper orbit bundle version. We
>>> will send the PRs with the relevant changes.
>>> Currently we are running integration tests for product-greg.
>>>
>>> Thanks!
>>> Rajith
>>>
>>> On Wed, Jun 8, 2016 at 12:20 PM, Kalpa Welivitigoda 
>>> wrote:
>>>
 [+Ayoma, Dulanja]


 On Wed, Jun 8, 2016 at 12:17 PM, Anupama Pathirage 
 wrote:

> Hi Kalpa,
>
> Thanks for the update.  Please update us with the solution for CSRF
> security issue. We get the same issue for  the DSS try it as well.
>
> [2016-06-08 11:55:28,396]  WARN {org.owasp.csrfguard.log.JavaLogger}
> -  potential cross-site request forgery (CSRF) attack thwarted
> (user:, ip:10.100.7.118, method:POST,
> uri:/carbon/admin/jsp/WSRequestXSSproxy_ajaxprocessor.jsp, error:required
> token is missing from the request)
>
> Private proxy protocol will be attempted as cross-domain browser
> restrictions might be enforced for this endpoint.
>
> http://tryit.carbon.wso2.org;>
>Error connecting to the Tryit ajax proxy
> 
>
> Regards,
>
> On Wed, Jun 8, 2016 at 8:45 AM, Kasun Bandara  wrote:
>
>> Hi All,
>>
>> We have done the fix for L1 reported in [1] yesterday.
>>
>> Thanks,
>> Kasun.
>>
>> [1] https://wso2.org/jira/browse/IDENTITY-4656
>>
>> On Wed, Jun 8, 2016 at 7:00 AM, Kalpa Welivitigoda 
>> wrote:
>>
>>> Hi Anupama,
>>>
>>> On Tue, Jun 7, 2016 at 8:45 PM, Anupama Pathirage 
>>> wrote:
>>>
 Hi Kalpa,

 Checked the suggested approaches and those two issues were resolved
 after applying both changes. We will further test the service with the
 Carbon RC2.

 On Tue, Jun 7, 2016 at 6:15 PM, Kalpa Welivitigoda  wrote:

> Hi Anupama,
>
> On Tue, Jun 7, 2016 at 5:50 PM, Anupama Pathirage <
> anup...@wso2.com> wrote:
>
>> Hi,
>>
>> We got the following issues when testing WSO2 DSS with the Kernel
>> RC2 Release.
>>
>> *1) *Any action on management console gives the following error.
>> It seems to be related with the tomcat upgrade and appreciate your 
>> input on
>> this.
>>
>> [2016-06-07 17:21:16,905] ERROR
>> {org.apache.coyote.AbstractProtocol$AbstractConnectionHandler} -  
>> Error
>> reading request, ignored
>> java.lang.NoSuchMethodError:
>> org.apache.coyote.Request.getBytesRead()I
>> at
>> org.apache.coyote.RequestInfo.updateCounters(RequestInfo.java:143)
>> at org.apache.coyote.Request.updateCounters(Request.java:533)
>> at
>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1140)
>> at
>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
>> at
>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1749)
>> at
>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1708)
>> at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>> at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> at
>> org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
>> at java.lang.Thread.run(Thread.java:745)
>>
>
> Yes, it is due to the tomcat upgrade in kernel, relevant fixes for
> carbon-deployment are already there in 4.6.2-SNAPSHOT. We have 

Re: [Dev] Developer Studio changes ordering of XML attributes

2016-06-10 Thread Susinda Perera
Hi Rajeevan

I have google a bit on this issue in general. It seems like normal DOM does
not care about the attribute order. Also I believe xml schemas would also
not care about the order[1]. We have to test this whether we have any
support in axiom level. As this requirement is valid in terms of end user,
please create a JIRA to track this. Kavith is looking at some other xml
processing library, may be he can hive some input.

[1] - https://www.w3.org/TR/REC-xml/#sec-starttags

On Fri, Jun 10, 2016 at 10:22 AM, Vimalanathan Rajeevan 
wrote:

> Hi,
>
> I will explain the issue with the help of Property Mediator. When we are
> adding a property with an expression to a sequence in Graphical Editor, the
> source view for that mediator is as follows,
>
>name="TestProperty" xmlns:m0="http://services.samples;
> xmlns:m1=" http://services.samples/xsd "/>
>
> Here 'expression' is positioned before 'name' of the mediator. IMHO,
> 'name' should be positioned before 'expression'(for better readability) and
> we should try to keep the order as below(from ESB Doc),
>
>  "literal" | expression="xpath") [scope=default|transport|axis2|axis2-client]
> [pattern="regex" [group="integer"]]>
> ?
> 
>
> So I tried to change it from source view but when I switching between
> graphical and source views my changes are removed and ordered by
> alphabetically. It is giving difficulties when we are using Graphical
> Editor and trying to keep some conventions.
> It should be a known issue. Will we be able to fix this?
>
> Appreciate your thoughts on this.
>
> --
> Vimalanathan Rajeevan
> Software Engineer,
> WSO2, Inc. *http://wso2.com* 
> Lean.Enterprise.Middleware
>
> Mobile:
> *+94 773090875 <%2B94%20773090875>*
> LinkedIn:
> *https://www.linkedin.com/in/RajeevanVimalanathan
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
*Susinda Perera*
Software Engineer
B.Sc.(Eng), M.Sc(Computer Science), AMIE(SL)
Mobile:(+94)716049075
Blog: susinda.blogspot.com
WSO2 Inc. http://wso2.com/
Tel : 94 11 214 5345 Fax :94 11 2145300
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Issue in processing certain integer values in data mapper

2016-06-10 Thread Sohani Weerasinghe
Hi All,

If we consider a payload which has values such as telephone numbers,
userID, house no etc, when generating the JSON schema they are treated as
"numbers".

When user tries to map the payload, final generated outcome displays as a
double value.

eg: If we pass an object as below, the output comes as 1.12655655E8 which
is wrong.


  0112655655
  01
   

AFAIU, before generating the mapping config user should be provided with an
option to change the data type of that particular field into String. As a
solution I think we should provide a property so that user can change the
type. WDYT?

Thanks,
Sohani

Sohani Weerasinghe
Senior Software Engineer
WSO2, Inc: http://wso2.com

Mobile  : +94 716439774
Blog :http://christinetechtips.blogspot.com/
Twitter  : https://twitter.com/sohanichristine
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev