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

2015-11-23 Thread Geeth Munasinghe
On Tue, Nov 24, 2015 at 12:12 AM, Chamara Ariyarathne 
wrote:

> Hi Milan. Thanks for the information. We will try this tomorrow. But our
> purpose is to replace this whole url with a configured host name.
>
> However Geeth, I think the EMM team having to introduce a new config to
> put the globally exposed server url deviates from the purpose of having
> HostName and MgtHostname properties in the carbon.xml..
>

Chamara,
I think I disagree with on that point. I dont think carbon hostname or mgt
host name cannot be used for globally exposing the server url.  AFAIK there
is no place to put the port number in carbon.xml. There is no point of
having just a host name without the port number. The carbon.xml host name
will be the server ip address or the host name of the server which the
product is running as clearly mentioned in the document [1].

As another reference, AFAIK in ESB, we use WSDLPrefix [2] in order to
change the address endpoint of generated wsdls to LB's address when ESB is
fronted by a LB.

So I think introducing a new config to put the LB host name and port is
valid.

[1] https://docs.wso2.com/display/Carbon440/Configuring+carbon.xml
[2] https://docs.wso2.com/display/ESB490/Setting+Up+Host+Names+and+Ports

Thanks
Geeth

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


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

2015-11-23 Thread Chamara Ariyarathne
Hi Milan. Thanks for the information. We will try this tomorrow. But our
purpose is to replace this whole url with a configured host name.

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

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

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



-- 
*Chamara Ariyarathne*
Associate Technical Lead - QA
WSO2 Inc; http://www.wso2.com/
Mobile; *+94772786766*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GREG][ES] Validating regex in RXT input values

2015-11-23 Thread Manuranga Perera
What will happen if I do a patten like "^.*$" . In this case even the empty
string matches. Will it still throw an error if I didn't send anything.?

On Mon, Nov 23, 2015 at 1:43 PM, Ayesha Dissanayaka  wrote:

> Hi all,
>
> As of now, governance API validates all the fields which has
> validate="" attribute in the field, and throws an exception
> whenever regex is not matched with input value. Hence, such fields get
> required by default even thought required="true" is not set to the field
> definition in RXT.
>
> ex:
> 
> Age
> 
>
> Should this be the default behavior or should we only check regex match
> for fields which are explicitly defined to be required.
>
>
> Thanks!
> -Ayesha
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>



-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [APIM] setting up cluster without using -Dprofile - with puppet scripts

2015-11-23 Thread Pubudu Priyashan
Hey Nuwan.

We've been experiencing some issues when trying to start the cluster nodes
with -Dprofile option in our cluster set up for APIM 1.10.0 Alpha pack. I
have logged a ticket [1] with exceptions attached. Please let us know if
any further details required on this matter.

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

Cheers,
Pubudu.

Pubudu D.P
Senior Software Engineer - QA Team | WSO2 inc.
Mobile : +94775464547

On Wed, Nov 11, 2015 at 2:52 PM, Suhan Dharmasuriya  wrote:

> Hi,
>
> When we try to deploy the cluster with APIM 1.10.x with profiles,
> following error [1] is observed in wso2carbon.log.
> Full log for gateway manager also attached.
>
> We have tried with default configurations as well as cluster
> configurations. In both cases the error occurs when trying with profiles.
>
> It would be great if you can guide us to overcome this issue.
>
> Following is the diff between a APIM 1.10.0-SNAPSHOT build pack
> wso2server.sh and our gateway node wso2server.sh file.
>
> $ diff 110wso2server.sh gwwso2server.sh
> 303a304
> > -Dprofile=gateway-manager \
>
> [1]
> TID: [-1] [] [2015-11-11 09:05:40,614] ERROR
> {org.apache.tomcat.util.digester.Digester} -  Begin event threw exception
> {org.apache.tomcat.util.digester.Digester}
> java.lang.ClassNotFoundException:
> org.wso2.carbon.webapp.mgt.loader.CarbonWebappLoader cannot be found by
> org.wso2.carbon.tomcat_4.4.2
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
> at
> org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
> at
> org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> at
> org.apache.tomcat.util.digester.ObjectCreateRule.begin(ObjectCreateRule.java:144)
> at
> org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1288)
> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
> at
> org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
> Source)
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
> Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
> at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
> at
> org.apache.catalina.startup.ContextConfig.processContextConfig(ContextConfig.java:649)
> at
> org.apache.catalina.startup.ContextConfig.contextConfig(ContextConfig.java:592)
> at org.apache.catalina.startup.ContextConfig.init(ContextConfig.java:850)
> at
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:397)
> at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
> at
> org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
> at
> org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
> at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:110)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:139)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
> at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> at java.lang.Thread.run(Thread.java:745)
> TID: [-1] [] [2015-11-11 09:05:40,616] ERROR
> {org.apache.catalina.startup.ContextConfig} -  Parse error in context.xml
> for / {org.apache.catalina.startup.ContextConfig}
> org.xml.sax.SAXParseException; systemId: file:/mnt/
> 192.168.57.131/gateway/wso2am-1.10.0-SNAPSHOT/repository/conf/tomcat/context.xml;
> lineNumber: 24; columnNumber: 86; Error at (24, 86) :
> org.wso2.carbon.webapp.mgt.loader.CarbonWebappLoader cannot be found by
> org.wso2.carbon.tomcat_4.4.2
> at
> org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2711)
> at
> org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2743)
> at
> org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1291)
> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
> at
> 

Re: [Dev] Log Analyzer progress status

2015-11-23 Thread Dakshika Jayathilaka
Hi Anuruddha,

Thank you for sharing related docs. Shall we set up a meeting to discuss
wireframes. IMO UX team can share some re-usable components as well as
platform level design guide for implementation.

Regards,

*Dakshika Jayathilaka*
PMC Member & Committer of Apache Stratos
Senior Software Engineer
WSO2, Inc.
lean.enterprise.middleware
0771100911

On Mon, Nov 23, 2015 at 11:54 AM, Anuruddha Premalal 
wrote:

> Hi Dakshitha,
>
> Find the initial wire-frames link in [1]. Component behavioral description
> can be found in [2].  As you have noticed in discussion "How the user can
> configure log publishing agent", we have slightly deviated from configuring
> distributed agent story, and focused on getting a MVP out. Your feedback
> and possible improvements are welcome, to both  wire-frames and markups.
>
> [1] https://drive.google.com/open?id=0B-pyIRJ1Le-jOTdJa3NUbjhfazg
> [2]
> https://docs.google.com/a/wso2.com/document/d/14fzkKtkUs8rH3eu6zkEFWrrlGGgrJE2uyNWjBbGptXk/edit?usp=sharing
>
> On Mon, Nov 23, 2015 at 11:46 AM, Dakshika Jayathilaka 
> wrote:
>
>> Hi Malith,
>>
>> Can you share initial wireframes + user stories for this. I have followed
>> some discussions on thread [1] [2], but couldn't find detailed stories.
>>
>> [1] Component level description of the log analyzer tool
>> [2]  [Architecture] [LogAnalyzer] How the user can configure log
>> publishing agent
>>
>> Regards,
>>
>> *Dakshika Jayathilaka*
>> PMC Member & Committer of Apache Stratos
>> Senior Software Engineer
>> WSO2, Inc.
>> lean.enterprise.middleware
>> 0771100911
>>
>> On Mon, Nov 23, 2015 at 11:34 AM, Malith Dhanushka 
>> wrote:
>>
>>> Hi All,
>>>
>>> We have progressed in following tasks so far,
>>>
>>> 1.) Built a pack with needed features and initiated a git-repo [1]
>>> 2.) Initial wire-frames to markup conversion, jaggery app.
>>> 3.) Log reader and publisher part of Log agent
>>> 4.) Search by file upload api
>>> 5.) Initial search UI
>>>
>>> Also we have initiated a discussion with UES team to get assistance in
>>> dashboard gadgets.
>>>
>>> [1] https://github.com/malithd/product-la
>>> 
>>>
>>> --
>>> Malith Dhanushka
>>> Senior Software Engineer - Data Technologies
>>> *WSO2, Inc. : wso2.com *
>>> *Mobile*  : +94 716 506 693
>>>
>>> ___
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>
>
> --
> *Anuruddha Premalal*
> Software Eng. | WSO2 Inc.
> Mobile : +94717213122
> Web site : www.anuruddha.org
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [GREG][ES] Validating regex in RXT input values

2015-11-23 Thread Ayesha Dissanayaka
Hi all,

As of now, governance API validates all the fields which has
validate="" attribute in the field, and throws an exception
whenever regex is not matched with input value. Hence, such fields get
required by default even thought required="true" is not set to the field
definition in RXT.

ex:

Age


Should this be the default behavior or should we only check regex match for
fields which are explicitly defined to be required.


Thanks!
-Ayesha

-- 
*Ayesha Dissanayaka*
Software Engineer,
WSO2, Inc : http://wso2.com

20, Palmgrove Avenue, Colombo 3
E-Mail: aye...@wso2.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GREG][ES] Validating regex in RXT input values

2015-11-23 Thread Ayesha Dissanayaka
Hi,

Correct behavior is observed when carbon.governance.version is updated to
4.6.1, earlier it was 4.6.0.

Thanks!
-Ayesha

On Mon, Nov 23, 2015 at 2:00 PM, Chandana Napagoda 
wrote:

> Hi Ayesha,
>
> No, it's not. Governance API doesn't validate the fields when a value is
> not present. You can check it in latest G-Reg pack. We(Chanaka and me)
> implemented this for G-Reg 5.1.0 release.
>
> Regards,
> Chandana
>
> On Mon, Nov 23, 2015 at 1:43 PM, Ayesha Dissanayaka 
> wrote:
>
>> Hi all,
>>
>> As of now, governance API validates all the fields which has
>> validate="" attribute in the field, and throws an exception
>> whenever regex is not matched with input value. Hence, such fields get
>> required by default even thought required="true" is not set to the field
>> definition in RXT.
>>
>> ex:
>> 
>> Age
>> 
>>
>> Should this be the default behavior or should we only check regex match
>> for fields which are explicitly defined to be required.
>>
>>
>> Thanks!
>> -Ayesha
>>
>> --
>> *Ayesha Dissanayaka*
>> Software Engineer,
>> WSO2, Inc : http://wso2.com
>> 
>> 20, Palmgrove Avenue, Colombo 3
>> E-Mail: aye...@wso2.com 
>>
>
>
>
> --
> *Chandana Napagoda*
> Senior Software Engineer
> WSO2 Inc. - http://wso2.org
>
> *Email  :  chand...@wso2.com **Mobile : +94718169299
> <%2B94718169299>*
>
> *Blog  :http://cnapagoda.blogspot.com *
>
>


-- 
*Ayesha Dissanayaka*
Software Engineer,
WSO2, Inc : http://wso2.com

20, Palmgrove Avenue, Colombo 3
E-Mail: aye...@wso2.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Is it okay to depend on auto commit when writing JDBC code?

2015-11-23 Thread Isuru Perera
Hi,

When we write JDBC code, is it okay if we depend on auto commit in the
connection we get from the DataSource?

The JDBC Reporter for Metrics [1] depends on auto commit "true" value set
in the DataSource configuration. The JDBC reporter doesn't have any complex
transactions and I thought it should be okay to depend on auto commit.

WDYT?

Thanks!

Best Regards,

[1]
https://github.com/wso2/carbon-metrics/blob/v1.1.1/components/org.wso2.carbon.metrics.jdbc.reporter/src/main/java/org/wso2/carbon/metrics/reporter/JDBCReporter.java#L233-L258

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

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


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

2015-11-23 Thread Nariman Abdullayev (TD)
Hello,

Could someone help me with this issue? I cannot understand why SOAP message is 
lost after an http exception

Thank in advance,

Nariman.

On 11/17/2015 09:05 AM, Nariman Abdullayev (TD) wrote:
Hi Madhuranga,

Thank you for the sample. There is actually full envelope body in your example. 
Using your sample I was able to understand what cause an empty envelope in 
onError sequence.

if you add just two additional parameters to the endpoint:


5000
fault
 

So that endpoint timeout becomes 5 seconds and after timeout an error must be 
thrown (otherwise error sequence is not called)

and point an endpoint to some url which is actually reply after more than 5 
seconds...
For example, I achieve timeout using this simple php script:

XXX';
ob_end_flush();
?>

In this case, when timeout occurs, I get empty envelope...

log file sample, with configured timeout:

[2015-11-16 22:15:10,982]  INFO - LogMediator To: 
/services/InOnlyProxy.InOnlyProxyHttpSoap12Endpoint, MessageID: 
urn:uuid:90c7f86d-d11a-4b13-a058-82c9900fefc4, Direction: request,
 retry_count = null, Envelope: http://schemas.xmlsoap.org/soap/envelope/>"http://schemas.xmlsoap.org/soap/envelope/;>
[2015-11-16 22:15:10,987]  WARN - TimeoutHandler Expiring message ID : 
urn:uuid:8358adc3-08e7-425b-ab62-3419a477439a; dropping message after timeout 
of : 5 seconds
[2015-11-16 22:15:25,978]  INFO - LogMediator To: 
/services/InOnlyProxy.InOnlyProxyHttpSoap12Endpoint, MessageID: 
urn:uuid:01b3c6df-ed0d-4ab5-82fd-5630fb24a115, Direction: request,
 retry_count = 1, Envelope: http://schemas.xmlsoap.org/soap/envelope/>"http://schemas.xmlsoap.org/soap/envelope/;>
[2015-11-16 22:15:25,980]  WARN - TimeoutHandler Expiring message ID : 
urn:uuid:caacc0ec-5750-4580-9eb6-27be7b593be2; dropping message after timeout 
of : 5 seconds
[2015-11-16 22:15:37,416]  WARN - SynapseCallbackReceiver Synapse received a 
response for the request with message Id : 
urn:uuid:8358adc3-08e7-425b-ab62-3419a477439a But a callback
 is not registered (anymore) to process this response
[2015-11-16 22:15:40,978]  INFO - LogMediator To: 
/services/InOnlyProxy.InOnlyProxyHttpSoap12Endpoint, MessageID: 
urn:uuid:9561bc27-15aa-4523-bf26-404761983f11, Direction: request,
 retry_count = 2.0, Envelope: http://schemas.xmlsoap.org/soap/envelope/>"http://schemas.xmlsoap.org/soap/envelope/;>
[2015-11-16 22:15:40,979]  WARN - TimeoutHandler Expiring message ID : 
urn:uuid:80fdc5ae-b31f-42c6-9be6-358c93d8bb4a; dropping message after timeout 
of : 5 seconds

If I deploy the same project to 4.8.1 the SOAP body is not lost. However, in 
4.9.0 SOAP body is not available.. So the question is why there is such a 
difference? is it done on purpose?

for the reference, my endpoint xml:
http://ws.apache.org/ns/synapse>"http://ws.apache.org/ns/synapse;>
  http://localhost/index.php;>
  
  5000
 fault


-1
1.0


-1





Thanks in advance,

Nariman.


On 11/15/2015 08:53 AM, Madhuranga Bandara wrote:
Hi Nariman,

I have tried this in a ESB 4.9.0 fresh pack. Given below is my ESB 
configuration. I could access the SOAP envelop from
"SimpleSQFault" onError sequence.


http://ws.apache.org/ns/synapse;>

15000














http://127.0.0.1:9000/services/SimpleStockQuoteService;>

-1
1.0


-1





http://org.apache.synapse/xsd; 
xmlns:ns3="http://org.apache.synapse/xsd"/>

http://org.apache.synapse/xsd;
xmlns:ns3="http://org.apache.synapse/xsd; 
xpath="get-property('retry_count')">

















http://www.w3.org/2003/05/soap-envelope"/>





































  

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

2015-11-23 Thread Lasitha Wattaladeniya
Hi Nuwan/Lakmali,

>From Identity side, the requirement was to change the roles/permissions
when renaming applications (SPs), which will access the UM_PERMISSION table
and change each permission path and it uses the same connection to update
the UM_PERMISSION table and Identity DB related tables. That must be the
cause of this.




On Mon, Nov 23, 2015 at 4:35 PM, Nuwan Dias  wrote:

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


-- 
Lasitha Wattaladeniya
Software Engineer
WSO2, Inc. | http://wso2.com
lean. enterprise. 

Re: [Dev] Is it okay to depend on auto commit when writing JDBC code?

2015-11-23 Thread Nuwan Dias
Depending on it might cause issues. API Manager had to face some
complexities on Postgre. These however were because API Manager depended on
defaultAutoCommit to be false, not true. I guess it can have its
complications on various DB engines.

And as a best practise I think its better to not depend on it. Later if you
introduce complex transactions, you'll have to take the control of the
commits into your source anyway.

Thanks,
NuwanD.

On Mon, Nov 23, 2015 at 4:03 PM, Isuru Perera  wrote:

> Hi,
>
> When we write JDBC code, is it okay if we depend on auto commit in the
> connection we get from the DataSource?
>
> The JDBC Reporter for Metrics [1] depends on auto commit "true" value set
> in the DataSource configuration. The JDBC reporter doesn't have any complex
> transactions and I thought it should be okay to depend on auto commit.
>
> WDYT?
>
> Thanks!
>
> Best Regards,
>
> [1]
> https://github.com/wso2/carbon-metrics/blob/v1.1.1/components/org.wso2.carbon.metrics.jdbc.reporter/src/main/java/org/wso2/carbon/metrics/reporter/JDBCReporter.java#L233-L258
>
> --
> Isuru Perera
> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
> Contact: +IsuruPereraWSO2 
>



-- 
Nuwan Dias

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


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

2015-11-23 Thread Lakmali Baminiwatta
Hi all,

In APIM 1.10.0, when we try to rename an Application, below error is
thrown. When I checked the code, there are queries to UM_PERMISSION table
against the Identity DB [1]. Shouldn't we use existing UM APIs or run these
against the UM DB?

Caused by: org.h2.jdbc.JdbcSQLException: Table "UM_PERMISSION" not found;
SQL statement:
SELECT UM_ID, UM_RESOURCE_ID FROM UM_PERMISSION WHERE UM_RESOURCE_ID LIKE ?
[42102-140]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
at org.h2.message.DbException.get(DbException.java:167)
at org.h2.message.DbException.get(DbException.java:144)
at org.h2.command.Parser.readTableOrView(Parser.java:4498)
at org.h2.command.Parser.readTableFilter(Parser.java:1011)
at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1577)
at org.h2.command.Parser.parseSelectSimple(Parser.java:1682)
at org.h2.command.Parser.parseSelectSub(Parser.java:1571)
at org.h2.command.Parser.parseSelectUnion(Parser.java:1416)
at org.h2.command.Parser.parseSelect(Parser.java:1404)
at org.h2.command.Parser.parsePrepared(Parser.java:392)
at org.h2.command.Parser.parse(Parser.java:275)
at org.h2.command.Parser.parse(Parser.java:247)
at org.h2.command.Parser.prepare(Parser.java:201)
at org.h2.command.Parser.prepareCommand(Parser.java:214)
at org.h2.engine.Session.prepareLocal(Session.java:434)
at org.h2.engine.Session.prepareCommand(Session.java:384)
at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1071)
at org.h2.jdbc.JdbcPreparedStatement.(JdbcPreparedStatement.java:71)
at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:234)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at
org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
at
org.wso2.carbon.ndatasource.rdbms.ConnectionRollbackOnReturnInterceptor.invoke(ConnectionRollbackOnReturnInterceptor.java:51)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
at
org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:67)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
at
org.apache.tomcat.jdbc.pool.interceptor.ConnectionState.invoke(ConnectionState.java:153)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
at org.apache.tomcat.jdbc.pool.TrapException.invoke(TrapException.java:41)
at
org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
at
org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:80)
at com.sun.proxy.$Proxy13.prepareStatement(Unknown Source)
at
org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.readApplicationPermissions(ApplicationDAOImpl.java:2752)
at
org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.updateBasicApplicationData(ApplicationDAOImpl.java:442)
at
org.wso2.carbon.identity.application.mgt.dao.impl.ApplicationDAOImpl.updateApplication(ApplicationDAOImpl.java:337)

[1]
https://github.com/wso2/carbon-identity/blob/master/components/application-mgt/org.wso2.carbon.identity.application.mgt/src/main/java/org/wso2/carbon/identity/application/mgt/dao/impl/ApplicationDAOImpl.java

Thanks,
Lakmali

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


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

2015-11-23 Thread Nuwan Dias
Looks like a bug to me. This would require the Identity and UM tables to be
on a single schema, which would be wrong.

Thanks,
NuwanD.

On Mon, Nov 23, 2015 at 4:28 PM, Lakmali Baminiwatta 
wrote:

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


-- 
Nuwan Dias

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


Re: [Dev] Is it okay to depend on auto commit when writing JDBC code?

2015-11-23 Thread Sumedha Rubasinghe
Isuru,
By allowing autocommit = true, your giving control of your JDBC logic
completely to database engine.
This will be problematic when you want to perform a rollback resulted by
multiple SQL statements.

For example:

with autocommit=true

insertOrder()
//order saved to database
insertPayment()
//payment save to database
Here no way of rollbacking Order if payment is not successful.


with autocommit=false
beginTxn {
  insertOrder()
  insertPayment()
} finally{
  commitTxn()
} error {
  rollback()
}

rollback operation can remove both payment and order records as they are
part of a single txn.





On Mon, Nov 23, 2015 at 4:03 PM, Isuru Perera  wrote:

> Hi,
>
> When we write JDBC code, is it okay if we depend on auto commit in the
> connection we get from the DataSource?
>
> The JDBC Reporter for Metrics [1] depends on auto commit "true" value set
> in the DataSource configuration. The JDBC reporter doesn't have any complex
> transactions and I thought it should be okay to depend on auto commit.
>
> WDYT?
>
> Thanks!
>
> Best Regards,
>
> [1]
> https://github.com/wso2/carbon-metrics/blob/v1.1.1/components/org.wso2.carbon.metrics.jdbc.reporter/src/main/java/org/wso2/carbon/metrics/reporter/JDBCReporter.java#L233-L258
>
> --
> Isuru Perera
> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
> Lean . Enterprise . Middleware
>
> about.me/chrishantha
> Contact: +IsuruPereraWSO2 
>



-- 
/sumedha
m: +94 773017743
b :  bit.ly/sumedha
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [GREG][ES] Validating regex in RXT input values

2015-11-23 Thread Ayesha Dissanayaka
On Mon, Nov 23, 2015 at 1:47 PM, Manuranga Perera  wrote:

> "^.*$"


Nope, this doesn't throw an error if the input is empty.

-- 
*Ayesha Dissanayaka*
Software Engineer,
WSO2, Inc : http://wso2.com

20, Palmgrove Avenue, Colombo 3
E-Mail: aye...@wso2.com 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Log Analyzer progress status

2015-11-23 Thread Malith Dhanushka
On Mon, Nov 23, 2015 at 1:39 PM, Dakshika Jayathilaka 
wrote:

> Hi Anuruddha,
>
> Thank you for sharing related docs. Shall we set up a meeting to discuss
> wireframes. IMO UX team can share some re-usable components as well as
> platform level design guide for implementation.
>
>
Sounds good. I will set up a one.


> Regards,
>
> *Dakshika Jayathilaka*
> PMC Member & Committer of Apache Stratos
> Senior Software Engineer
> WSO2, Inc.
> lean.enterprise.middleware
> 0771100911
>
> On Mon, Nov 23, 2015 at 11:54 AM, Anuruddha Premalal 
> wrote:
>
>> Hi Dakshitha,
>>
>> Find the initial wire-frames link in [1]. Component behavioral
>> description can be found in [2].  As you have noticed in discussion "How
>> the user can configure log publishing agent", we have slightly deviated
>> from configuring distributed agent story, and focused on getting a MVP out.
>> Your feedback and possible improvements are welcome, to both
>>  wire-frames and markups.
>>
>> [1] https://drive.google.com/open?id=0B-pyIRJ1Le-jOTdJa3NUbjhfazg
>> [2]
>> https://docs.google.com/a/wso2.com/document/d/14fzkKtkUs8rH3eu6zkEFWrrlGGgrJE2uyNWjBbGptXk/edit?usp=sharing
>>
>> On Mon, Nov 23, 2015 at 11:46 AM, Dakshika Jayathilaka > > wrote:
>>
>>> Hi Malith,
>>>
>>> Can you share initial wireframes + user stories for this. I have
>>> followed some discussions on thread [1] [2], but couldn't find detailed
>>> stories.
>>>
>>> [1] Component level description of the log analyzer tool
>>> [2]  [Architecture] [LogAnalyzer] How the user can configure log
>>> publishing agent
>>>
>>> Regards,
>>>
>>> *Dakshika Jayathilaka*
>>> PMC Member & Committer of Apache Stratos
>>> Senior Software Engineer
>>> WSO2, Inc.
>>> lean.enterprise.middleware
>>> 0771100911
>>>
>>> On Mon, Nov 23, 2015 at 11:34 AM, Malith Dhanushka 
>>> wrote:
>>>
 Hi All,

 We have progressed in following tasks so far,

 1.) Built a pack with needed features and initiated a git-repo [1]
 2.) Initial wire-frames to markup conversion, jaggery app.
 3.) Log reader and publisher part of Log agent
 4.) Search by file upload api
 5.) Initial search UI

 Also we have initiated a discussion with UES team to get assistance in
 dashboard gadgets.

 [1] https://github.com/malithd/product-la
 

 --
 Malith Dhanushka
 Senior Software Engineer - Data Technologies
 *WSO2, Inc. : wso2.com *
 *Mobile*  : +94 716 506 693

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


>>>
>>
>>
>> --
>> *Anuruddha Premalal*
>> Software Eng. | WSO2 Inc.
>> Mobile : +94717213122
>> Web site : www.anuruddha.org
>>
>>
>


-- 
Malith Dhanushka
Senior Software Engineer - Data Technologies
*WSO2, Inc. : wso2.com *
*Mobile*  : +94 716 506 693
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] Authentication Endpoint deployment failure with Securevault

2015-11-23 Thread Lakmali Baminiwatta
Hi all,

We ran cipher tool for APIM 1.10 and when starting the server,
authentication endpoint web app deployment fails saying "Invalid class as
SecretCallbackHandler : Class Name :
org.wso2.securevault.secret.handler.SecretManagerSecretCallbackHandler".

In the code level it is trying to resolve Endpointconfig.properties file
[1]. Even with this issue, server startup is successful and it seems the
problem is only with authentication endpoint web app.

What is the repository of this "org.wso2.securevault.secret" package ?

Find the complete stack trace below. Any clue about this issue?

[1]
https://github.com/wso2/carbon-identity/blob/master/components/authentication-framework/org.wso2.carbon.identity.application.authentication.endpoint.util/src/main/java/org/wso2/carbon/identity/application/authentication/endpoint/util/TenantDataManager.java


[2015-11-23 11:37:37,273] ERROR - SecretCallbackHandlerFactory Invalid
class as SecretCallbackHandler : Class Name :
org.wso2.securevault.secret.handler.SecretManagerSecretCallbackHandler
[2015-11-23 11:37:37,274] ERROR - StandardContext Exception sending context
initialized event to listener instance of class
org.wso2.carbon.identity.application.authentication.endpoint.util.listener.AuthenticationEndpointContextListener
org.wso2.securevault.SecureVaultException: Invalid class as
SecretCallbackHandler : Class Name :
org.wso2.securevault.secret.handler.SecretManagerSecretCallbackHandler
at
org.wso2.securevault.secret.SecretCallbackHandlerFactory.handleException(SecretCallbackHandlerFactory.java:102)
at
org.wso2.securevault.secret.SecretCallbackHandlerFactory.createSecretCallbackHandler(SecretCallbackHandlerFactory.java:68)
at
org.wso2.securevault.SecretResolverFactory.initPasswordManager(SecretResolverFactory.java:278)
at
org.wso2.securevault.SecretResolverFactory.create(SecretResolverFactory.java:218)
at
org.wso2.carbon.identity.application.authentication.endpoint.util.TenantDataManager.resolveSecrets(TenantDataManager.java:347)
at
org.wso2.carbon.identity.application.authentication.endpoint.util.TenantDataManager.init(TenantDataManager.java:88)
at
org.wso2.carbon.identity.application.authentication.endpoint.util.listener.AuthenticationEndpointContextListener.contextInitialized(AuthenticationEndpointContextListener.java:47)
at
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5016)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5524)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649)
at
org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:290)
at
org.wso2.carbon.tomcat.internal.CarbonTomcat.addWebApp(CarbonTomcat.java:198)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWebappDeployment(TomcatGenericWebappsDeployer.java:258)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleWarWebappDeployment(TomcatGenericWebappsDeployer.java:208)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.handleHotDeployment(TomcatGenericWebappsDeployer.java:175)
at
org.wso2.carbon.webapp.mgt.TomcatGenericWebappsDeployer.deploy(TomcatGenericWebappsDeployer.java:140)
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.synapse.Axis2SynapseController.deployMediatorExtensions(Axis2SynapseController.java:743)
at
org.apache.synapse.Axis2SynapseController.createSynapseEnvironment(Axis2SynapseController.java:388)
at org.apache.synapse.ServerManager.start(ServerManager.java:181)
at
org.wso2.carbon.mediation.initializer.ServiceBusInitializer.initESB(ServiceBusInitializer.java:441)
at
org.wso2.carbon.mediation.initializer.ServiceBusInitializer.activate(ServiceBusInitializer.java:190)
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

Re: [Dev] [IS] "hostname in certificate didn't match:" issue when accessing IS dashboard

2015-11-23 Thread Dilshan Edirisuriya
Sorry the other thread is [1]

[1] - [Clarification](EONPROD-24) Accessing webpage via WSO2 ESB not
possbile - handshake error

On Mon, Nov 23, 2015 at 2:29 PM, Dilshan Edirisuriya 
wrote:

> Hi Aparna,
>
> It seems that the same issue occurring at [1].
>
> [1] - [Dev][IS] "hostname in certificate didn't match:" issue when
> accessing IS dashboard
>
> Regards,
>
> Dilshan
>
> On Fri, Nov 20, 2015 at 11:38 AM, Aparna Karunarathna 
> wrote:
>
>> Actually I have used another Nginx to resolve my issue, not a permanent
>> solution. AFAIU this is getting due to httpclient 4.3.1 doesn't support
>> SNI.
>>
>> @IsuruU, Shouldn't it upgrade to httpclient 4.3.2 ?
>>
>> Regards,
>> Aparna.
>>
>>
>> On Fri, Nov 20, 2015 at 11:24 AM, Malintha Adikari 
>> wrote:
>>
>>> Hi Aprana,
>>>
>>> I am getting the same issue while accessing APIM distributed cluster
>>> nodes fronted through loadbalancer(nginx) instance. Did you able to solve
>>> this issue ? If so how did you solve it ?
>>>
>>> Regards,
>>> Malintha
>>>
>>> On Wed, Oct 28, 2015 at 2:09 PM, Isuru Udana  wrote:
>>>
 Hi Aparna,

 Bundles are coming from features, whatever version defined in the
 product pom have no relationship for that.

  Thanks.

 On Wed, Oct 28, 2015 at 11:20 AM, Aparna Karunarathna 
 wrote:

> Hi Isuru,
>
> I checked version from the ESB master branch pom[1].
>
> 4.1.2
>
> [1] https://github.com/wso2/product-esb/blob/master/pom.xml
>
> Regards,
> Aparna.
>
> On Tue, Oct 27, 2015 at 5:41 AM, Isuru Udana  wrote:
>
>> Hi Aparna,
>>
>> We are using 4.3.1.
>>
>>
>> Thanks.
>>
>> On Mon, Oct 26, 2015 at 10:36 AM, Aparna Karunarathna <
>> apa...@wso2.com> wrote:
>>
>>> Hi Kasun/Isuru,
>>>
>>> Currently ESB uses Apache httpclient 4.1.2, shouldn't it upgrade to
>>> newer version?
>>>
>>> @Deep, Thanks for the clarification.
>>>
>>> Regards,
>>> Aparna
>>>
>>> On Sat, Oct 24, 2015 at 11:38 AM, Deependra Ariyadewa >> > wrote:
>>>
 Hi Aparna,

 This can happen when the client does not send the SNI[1][2] to the
 server side to select the proper HTTPS virtual host. In this case NGINX
 reverse proxy created in the vhost. Most of the modern browsers send 
 SNI to
 server, therefore you will not observe this when you make the request 
 via a
 modern browser.

 Most of the new Java HTTP client libraries also support SNI. As an
 example, Apache httpclient library support SNI from version 4.3.2 [3]. 
 If
 you use a library which does not support SNI, you will get this error 
 for
 HTTPS call going towards services hosted in virtual host environments.

 [1] https://en.wikipedia.org/wiki/Server_Name_Indication
 [2] https://www.ietf.org/rfc/rfc3546.txt
 [3] https://hc.apache.org/news.html

 On Fri, Oct 23, 2015 at 11:07 AM, Aparna Karunarathna <
 apa...@wso2.com> wrote:

> Hi all,
>
> I have encountered a weird "hostname in certificate didn't match:"
> issue when accessing IS dashboard. My setup details are as follows.
>
> *Setup Details*
> *IS cluster*
> - 3 nodes cluster
> - Hostname - mgt.is.wso2.com
> - Certificate CN - mgt.is.wso2.com
>
> *BPS cluster*
> - 2 nodes cluster (manager/worker)
> - Hostnames - Manager - mgt.bps.wso2.com / Worker -
> wrk.bps.wso2.com
> - Certificate CN - *.bps.wso2.com
>
> * Both nodes are fronted by same Nginx plus load balancer.
>
> [1]
> javax.net.ssl.SSLException: hostname in certificate didn't match: <
> mgt.is.wso2.com> != <*.bps.wso2.com>
> at
> org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:238)
> at
> org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
> 
> 
>
> When we check the browser cookie, it gave correct certificate. (
> mgt.is.wso2.com), but when we check it from java client[2] it
> gives the bps certificate (*.bps.wso2.com) instead of IS.
>
> [2]
> https://darray.wordpress.com/2015/07/12/freak-vulnerability-and-disabling-weak-export-cipher-suites-in-wso2-carbon-4-2-0-based-products/
>
> What is the reason for this? Is it my config issue or Nginx issue
> or our product issue?
>
> --
> *Regards,*
>
> *Aparna Karunarathna.*
>
>
> *Associate Technical Lead - QAWSO2 Inc.Mobile: 

Re: [Dev] [IS] "hostname in certificate didn't match:" issue when accessing IS dashboard

2015-11-23 Thread Dilshan Edirisuriya
Hi Aparna,

It seems that the same issue occurring at [1].

[1] - [Dev][IS] "hostname in certificate didn't match:" issue when
accessing IS dashboard

Regards,

Dilshan

On Fri, Nov 20, 2015 at 11:38 AM, Aparna Karunarathna 
wrote:

> Actually I have used another Nginx to resolve my issue, not a permanent
> solution. AFAIU this is getting due to httpclient 4.3.1 doesn't support
> SNI.
>
> @IsuruU, Shouldn't it upgrade to httpclient 4.3.2 ?
>
> Regards,
> Aparna.
>
>
> On Fri, Nov 20, 2015 at 11:24 AM, Malintha Adikari 
> wrote:
>
>> Hi Aprana,
>>
>> I am getting the same issue while accessing APIM distributed cluster
>> nodes fronted through loadbalancer(nginx) instance. Did you able to solve
>> this issue ? If so how did you solve it ?
>>
>> Regards,
>> Malintha
>>
>> On Wed, Oct 28, 2015 at 2:09 PM, Isuru Udana  wrote:
>>
>>> Hi Aparna,
>>>
>>> Bundles are coming from features, whatever version defined in the
>>> product pom have no relationship for that.
>>>
>>>  Thanks.
>>>
>>> On Wed, Oct 28, 2015 at 11:20 AM, Aparna Karunarathna 
>>> wrote:
>>>
 Hi Isuru,

 I checked version from the ESB master branch pom[1].

 4.1.2

 [1] https://github.com/wso2/product-esb/blob/master/pom.xml

 Regards,
 Aparna.

 On Tue, Oct 27, 2015 at 5:41 AM, Isuru Udana  wrote:

> Hi Aparna,
>
> We are using 4.3.1.
>
>
> Thanks.
>
> On Mon, Oct 26, 2015 at 10:36 AM, Aparna Karunarathna  > wrote:
>
>> Hi Kasun/Isuru,
>>
>> Currently ESB uses Apache httpclient 4.1.2, shouldn't it upgrade to
>> newer version?
>>
>> @Deep, Thanks for the clarification.
>>
>> Regards,
>> Aparna
>>
>> On Sat, Oct 24, 2015 at 11:38 AM, Deependra Ariyadewa 
>> wrote:
>>
>>> Hi Aparna,
>>>
>>> This can happen when the client does not send the SNI[1][2] to the
>>> server side to select the proper HTTPS virtual host. In this case NGINX
>>> reverse proxy created in the vhost. Most of the modern browsers send 
>>> SNI to
>>> server, therefore you will not observe this when you make the request 
>>> via a
>>> modern browser.
>>>
>>> Most of the new Java HTTP client libraries also support SNI. As an
>>> example, Apache httpclient library support SNI from version 4.3.2 [3]. 
>>> If
>>> you use a library which does not support SNI, you will get this error 
>>> for
>>> HTTPS call going towards services hosted in virtual host environments.
>>>
>>> [1] https://en.wikipedia.org/wiki/Server_Name_Indication
>>> [2] https://www.ietf.org/rfc/rfc3546.txt
>>> [3] https://hc.apache.org/news.html
>>>
>>> On Fri, Oct 23, 2015 at 11:07 AM, Aparna Karunarathna <
>>> apa...@wso2.com> wrote:
>>>
 Hi all,

 I have encountered a weird "hostname in certificate didn't match:"
 issue when accessing IS dashboard. My setup details are as follows.

 *Setup Details*
 *IS cluster*
 - 3 nodes cluster
 - Hostname - mgt.is.wso2.com
 - Certificate CN - mgt.is.wso2.com

 *BPS cluster*
 - 2 nodes cluster (manager/worker)
 - Hostnames - Manager - mgt.bps.wso2.com / Worker -
 wrk.bps.wso2.com
 - Certificate CN - *.bps.wso2.com

 * Both nodes are fronted by same Nginx plus load balancer.

 [1]
 javax.net.ssl.SSLException: hostname in certificate didn't match: <
 mgt.is.wso2.com> != <*.bps.wso2.com>
 at
 org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:238)
 at
 org.apache.http.conn.ssl.BrowserCompatHostnameVerifier.verify(BrowserCompatHostnameVerifier.java:54)
 
 

 When we check the browser cookie, it gave correct certificate. (
 mgt.is.wso2.com), but when we check it from java client[2] it
 gives the bps certificate (*.bps.wso2.com) instead of IS.

 [2]
 https://darray.wordpress.com/2015/07/12/freak-vulnerability-and-disabling-weak-export-cipher-suites-in-wso2-carbon-4-2-0-based-products/

 What is the reason for this? Is it my config issue or Nginx issue
 or our product issue?

 --
 *Regards,*

 *Aparna Karunarathna.*


 *Associate Technical Lead - QAWSO2 Inc.Mobile: 0714002533
 <0714002533>*

>>>
>>>
>>>
>>> --
>>> Deependra Ariyadewa
>>> WSO2, Inc. http://wso2.com/ http://wso2.org
>>>
>>> email d...@wso2.com; cell +94 71 403 5996 ;
>>> Blog http://risenfall.wordpress.com/
>>> PGP info: KeyID: 'DC627E6F'
>>>
>>> *WSO2 - Lean . Enterprise . Middleware*
>>>
>>
>>

Re: [Dev] [GREG][ES] Validating regex in RXT input values

2015-11-23 Thread Chandana Napagoda
Hi Ayesha,

No, it's not. Governance API doesn't validate the fields when a value is
not present. You can check it in latest G-Reg pack. We(Chanaka and me)
implemented this for G-Reg 5.1.0 release.

Regards,
Chandana

On Mon, Nov 23, 2015 at 1:43 PM, Ayesha Dissanayaka  wrote:

> Hi all,
>
> As of now, governance API validates all the fields which has
> validate="" attribute in the field, and throws an exception
> whenever regex is not matched with input value. Hence, such fields get
> required by default even thought required="true" is not set to the field
> definition in RXT.
>
> ex:
> 
> Age
> 
>
> Should this be the default behavior or should we only check regex match
> for fields which are explicitly defined to be required.
>
>
> Thanks!
> -Ayesha
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>



-- 
*Chandana Napagoda*
Senior Software Engineer
WSO2 Inc. - http://wso2.org

*Email  :  chand...@wso2.com **Mobile : +94718169299*

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


Re: [Dev] [GREG][ES] Validating regex in RXT input values

2015-11-23 Thread Manuranga Perera
seems this Greg side behavior is correct.

On Mon, Nov 23, 2015 at 1:58 PM, Ayesha Dissanayaka  wrote:

>
> On Mon, Nov 23, 2015 at 1:47 PM, Manuranga Perera  wrote:
>
>> "^.*$"
>
>
> Nope, this doesn't throw an error if the input is empty.
>
> --
> *Ayesha Dissanayaka*
> Software Engineer,
> WSO2, Inc : http://wso2.com
> 
> 20, Palmgrove Avenue, Colombo 3
> E-Mail: aye...@wso2.com 
>



-- 
With regards,
*Manu*ranga Perera.

phone : 071 7 70 20 50
mail : m...@wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Implementing -Dsetup in a Carbon product

2015-11-23 Thread Hasitha Hiranya
Hi,

Thanks, Nirmal/Anuruddha, sources were useful

Thanks

On Sun, Nov 22, 2015 at 6:09 PM, Nirmal Fernando  wrote:

> Hi Hasitha,
>
> Check this
> https://github.com/wso2/carbon-ml/blob/master/components/ml/org.wso2.carbon.ml.database/src/main/java/org/wso2/carbon/ml/database/internal/MLDatabaseService.java#L63
> to
> https://github.com/wso2/carbon-ml/blob/master/components/ml/org.wso2.carbon.ml.database/src/main/java/org/wso2/carbon/ml/database/internal/MLDatabaseService.java#L83
>
> On Sat, Nov 21, 2015 at 9:24 PM, Hasitha Hiranya 
> wrote:
>
>> Hi Anuruddha,
>>
>> Thanks for the response.
>> Spotted following code,
>>
>>
>> https://github.com/wso2/carbon-ml/blob/master/components/ml/org.wso2.carbon.ml.database/src/main/java/org/wso2/carbon/ml/database/internal/MLConfigurationParser.java
>> 
>>
>> Here we use javax.xml.bind.Unmarshaller
>>
>> With
>>
>>
>> https://github.com/wso2/carbon-ml/blob/master/components/ml/org.wso2.carbon.ml.commons/src/main/java/org/wso2/carbon/ml/commons/domain/config/MLConfiguration.java
>> 
>>
>> Is this the way to decrypt the xml tags properly? Are we looking at the
>> correct place?
>>
>> Thanks
>>
>> On Sat, Nov 21, 2015 at 6:46 PM, Anuruddha Premalal 
>> wrote:
>>
>>> Hi Hiranya,
>>>
>>> [1] might help you.
>>>
>>> [1]
>>> https://github.com/wso2/carbon-ml/tree/master/components/ml/org.wso2.carbon.ml.database
>>>
>>> On Sat, Nov 21, 2015 at 8:58 AM, Hasitha Hiranya 
>>> wrote:
>>>
 Hi,

 In our carbon product, we have a new database to deal with. We have the
 DB script that creates the necessary tables to work with the product in a
 specified  database pointed by
 /repository/conf/datasources/masterdatasource.xml.

 If we write a code to source the DB Script, we need to
 read masterdatasource.xml file ourselves and decode necessary xml values
 from data source configuration. Is this the correct way of doing it?

 Or does Carbon have some interface or configuration object where it
 loads the configs in masterdatasource.xml so that our code can read from?

 Thanks
 --
 *Hasitha Abeykoon*
 Senior Software Engineer; WSO2, Inc.; http://wso2.com
 *cell:* *+94 719363063*
 *blog: **abeykoon.blogspot.com* 


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


>>>
>>>
>>> --
>>> *Anuruddha Premalal*
>>> Software Eng. | WSO2 Inc.
>>> Mobile : +94717213122
>>> Web site : www.anuruddha.org
>>>
>>>
>>
>>
>> --
>> *Hasitha Abeykoon*
>> Senior Software Engineer; WSO2, Inc.; http://wso2.com
>> *cell:* *+94 719363063*
>> *blog: **abeykoon.blogspot.com* 
>>
>>
>
>
> --
>
> Thanks & regards,
> Nirmal
>
> Team Lead - WSO2 Machine Learner
> Associate Technical Lead - Data Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
>
>


-- 
*Hasitha Abeykoon*
Senior Software Engineer; WSO2, Inc.; http://wso2.com
*cell:* *+94 719363063*
*blog: **abeykoon.blogspot.com* 
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Is it okay to depend on auto commit when writing JDBC code?

2015-11-23 Thread Isuru Perera
Hi Sumedha, Nuwan,

Yes, I understand that we shouldn't be using auto commit if we need to
rollback multiple transactions. In Metrics reporter, it just does a batch
insert and it has only one transaction. So, there were no issues with auto
commit yet.

I thought of asking question as we also let the user to set default auto
commit value from the data source configuration. For example, in Metrics
scenario, if the data source config had default auto commit set to false,
the reporter will not insert any data to the database table. So, the
Metrics reporter depends on having default auto commit set to true.

When we want to use transactions, we can set auto commit to false after
getting a connection. Then we will not depend on the "default auto commit"
from the data source.

I also think it is a good practice to always set auto commit to false when
getting a connection when we want to use transactions. i.e.
con.setAutoCommit(false) [1]. The API Manager code also follows the same
practice [2].

So, in summary,* it's recommended to use transactions in the code and avoid
depending on auto commit.*

I will change the metrics code.

Thanks for your replies and helping me to clarify.

Best Regards,

[1] https://docs.oracle.com/javase/tutorial/jdbc/basics/transactions.html
[2]
https://github.com/wso2/carbon-apimgt/blob/v2.0.1/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/dao/ApiMgtDAO.java#L863

On Mon, Nov 23, 2015 at 4:59 PM, Sumedha Rubasinghe 
wrote:

> Isuru,
> By allowing autocommit = true, your giving control of your JDBC logic
> completely to database engine.
> This will be problematic when you want to perform a rollback resulted by
> multiple SQL statements.
>
> For example:
> 
> with autocommit=true
>
> insertOrder()
> //order saved to database
> insertPayment()
> //payment save to database
> Here no way of rollbacking Order if payment is not successful.
>
> 
> with autocommit=false
> beginTxn {
>   insertOrder()
>   insertPayment()
> } finally{
>   commitTxn()
> } error {
>   rollback()
> }
>
> rollback operation can remove both payment and order records as they are
> part of a single txn.
>
>
>
>
>
> On Mon, Nov 23, 2015 at 4:03 PM, Isuru Perera  wrote:
>
>> Hi,
>>
>> When we write JDBC code, is it okay if we depend on auto commit in the
>> connection we get from the DataSource?
>>
>> The JDBC Reporter for Metrics [1] depends on auto commit "true" value set
>> in the DataSource configuration. The JDBC reporter doesn't have any complex
>> transactions and I thought it should be okay to depend on auto commit.
>>
>> WDYT?
>>
>> Thanks!
>>
>> Best Regards,
>>
>> [1]
>> https://github.com/wso2/carbon-metrics/blob/v1.1.1/components/org.wso2.carbon.metrics.jdbc.reporter/src/main/java/org/wso2/carbon/metrics/reporter/JDBCReporter.java#L233-L258
>>
>> --
>> Isuru Perera
>> Associate Technical Lead | WSO2, Inc. | http://wso2.com/
>> Lean . Enterprise . Middleware
>>
>> about.me/chrishantha
>> Contact: +IsuruPereraWSO2 
>>
>
>
>
> --
> /sumedha
> m: +94 773017743
> b :  bit.ly/sumedha
>



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

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


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

2015-11-23 Thread Chamara Ariyarathne
We have a major design culprit with this situation now with the hostname
not getting picked up from carbon.xml. First reported jira is this
https://wso2.org/jira/browse/EMM-900

Today we found out that even when the Host Names are configured in the
carbonl.xml to be server's identified domain name, the QR code which is
generated while device registration, uses the host ip address which is
picked up from nowhere.
https://wso2.org/jira/browse/EMM-987

This issue will break the clustering scenarios where we need to define host
names in carbon.xml but EMM not picking them up properly.

On Tue, Nov 17, 2015 at 3:18 PM, Chamara Ariyarathne 
wrote:

> Hi Azeez,
>
> Agree with that. However the precedence should be to use the HostName
> value in the carbon.xml which is ultimately the deployment's exposed host
> name, hence the constructed url in the email would be the correct access
> url from outside.
>
> My argument is, this url shouldn't be kept in some other configuration
> file repeatedly.
>
> Thanks.
>
> On Wed, Nov 11, 2015 at 7:04 PM, Afkham Azeez  wrote:
>
>> This is for information purposes only. The mail says the URL we send to
>> the users in the email contains local host. May be you can get the IP
>> address/host from the incoming request and use that.
>>
>> On Wed, Nov 11, 2015 at 3:59 AM, Geeth Munasinghe  wrote:
>>
>>> Hi Azeez,
>>>
>>> In case of URL rewrite by LB, can we handle that by the proxy settings
>>> on catalina-server.xml ?
>>>
>>> Thanks
>>> Geeth
>>>
>>>
>>>
>>>
>>>
>>>
>>> *G. K. S. Munasinghe*
>>> *Senior Software Engineer,*
>>> *WSO2, Inc. http://wso2.com  *
>>> *lean.enterprise.middleware.*
>>>
>>> email: ge...@wso2.com
>>> phone:(+94) 777911226
>>>
>>> On Wed, Nov 11, 2015 at 2:10 PM, Afkham Azeez  wrote:
>>>
 proxy host name

 On Wed, Nov 11, 2015 at 12:28 AM, Chamara Ariyarathne <
 chama...@wso2.com> wrote:

> Hi All,
>
> When a new user is added to EMM, the user will be notified with an
> email to subscribe a device to MDM domain. The email contains the server
> url to be accessed from the device.
>
> https://localhost:9443/mdm/enrollment
>
> In a usual deployment when a EMM cluster is fronted by a LB, this url
> should be changed to the particular gateway host of the deployment. Now a
> doubt arose whether to create this url by taking the value in HostName
> element in carbon.xml or somewhere else.
>
> So the real doubt here is what is the correct way to configure the
> HostName attribute in the carbon.xml in a carbon server. Is it going to be
> the LB host's url which the deployment is exposed with or is it some local
> host name internal to the deployment?
>
> --
> *Chamara Ariyarathne*
> Associate Technical Lead - QA
> WSO2 Inc; http://www.wso2.com/
> Mobile; *+94772786766 <%2B94772786766>*
>



 --
 *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*

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



-- 
*Chamara Ariyarathne*
Associate Technical Lead - QA
WSO2 Inc; http://www.wso2.com/
Mobile; *+94772786766*
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


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

2015-11-23 Thread Nadeesha Meegoda
Hi IS team,

I created a Service Provider and automatically
*Application/Service_Provider_Name* Role was created. This Role is used to
give permission for users to edit and view the SP. Deleting this Role will
also delete the Service Provider created. If this Role was deleted
accidentally,  how am I going to recover the Service Provider since I
cannot add  the same Role name with domain "Application"?

When creating the SP with the same name it gives error creating the
application since the Service Provider is in registry but not shown in UI
due to the deletion of the Application Role.

Any feedback regarding this is highly appreciated!


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


[Dev] Http Servlet forwarding issue

2015-11-23 Thread Godwin Shrimal
Hi,

I am trying to forward the servlet request from *samlsso* servlet to
*commonauth* and getting following error in browser.

*HTTP Status 405 - HTTP method GET is not supported by this URL*

Note : Both servlets are registered from OSGI Service component and has
implemented doGet and doPost methods in both servlets. Its working properly
when we use *response.sendRedirect*.

What can be the reason for this ?

Thanks
Godwin


-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D *
twitter: https://twitter.com/godwinamila
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Builder] Jenkins build became unstable: carbon4-kernel_4.4.x__java8 #88

2015-11-23 Thread Nipuni Perera
Merged fix[1] to 4.4.x branch with commit
2d5895e217cb9eb3873a3f1a41ac908338c2f162

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

Thanks,
Nipuni

On Mon, Nov 23, 2015 at 9:46 AM, Manuri Amaya Perera 
wrote:

> Hi,
>
> The reason is, a fix[1] was introduced for this but it was merged only to
> the 4.5.x branch which was previously the master branch.
> I'll add the same fix to 4.4.x branch too.
>
> [1] https://wso2.org/jira/browse/CARBON-15609
>
> Thank you.
>
> On Mon, Nov 23, 2015 at 9:34 AM, Manuri Amaya Perera 
> wrote:
>
>> I'll look into this.
>>
>> On Mon, Nov 23, 2015 at 1:04 AM,  wrote:
>>
>>> See 
>>>
>>> ___
>>> Builder mailing list
>>> buil...@wso2.org
>>> https://wso2.org/cgi-bin/mailman/listinfo/builder
>>>
>>
>>
>>
>> --
>>
>> *Manuri Amaya Perera*
>>
>> *Software Engineer*
>>
>> *WSO2 Inc.*
>>
>> *Blog: http://manuriamayaperera.blogspot.com
>> *
>>
>
>
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: nip...@wso2.com
Git hub profile: https://github.com/nipuni
Blog : http://nipunipererablog.blogspot.com/
Mobile: +94 (71) 5626680

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


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

2015-11-23 Thread Geeth Munasinghe
Hi Chamara

For the first issue, as you and me had many offline discussions about it,
let me explain the reason again, why we moved the LB host name and LB port
to be taken from a different file (cdm-config.xml). This was required when
we send email to users to get their devices enrolled, we need to get the LB
host and port.

When we configure the EMM servers, they will be in private network IPs. And
those EMM servers will be exposed to the out side through a load balancer
which will be on public IP. Normally load balancer will run on default http
and https ports which are either 80 or 443. But EMM servers could run on
any port (default 9443 and 9763). So when a load balancer receives a
request to either 80 or 443 ports, it will redirect them to EMM server 9443
/ 9763 ports.

Another thing is load balancer could rewrite the urls, for example if the
load balancer host name and port is https://emm.wso2.com:443, then in LB it
can rewrite the urls to https://worker.mdm.com:9443.

So AFAIK there is no configuration in carbon.xml where we can get the LB
host name and port.

And for the second issue, It is a bug which we will fix in next alpha
release. But to fix this, I think the same rule applies. It cannot be taken
from carbon.xml because mgt host name does give any impression about the
load balancer url. So it should be taken from cdm-config.xml.

Thanks
Geeth


*G. K. S. Munasinghe*
*Senior Software Engineer,*
*WSO2, Inc. http://wso2.com  *
*lean.enterprise.middleware.*

email: ge...@wso2.com
phone:(+94) 777911226

On Mon, Nov 23, 2015 at 6:51 PM, Chamara Ariyarathne 
wrote:

> We have a major design culprit with this situation now with the hostname
> not getting picked up from carbon.xml. First reported jira is this
> https://wso2.org/jira/browse/EMM-900
>
> Today we found out that even when the Host Names are configured in the
> carbonl.xml to be server's identified domain name, the QR code which is
> generated while device registration, uses the host ip address which is
> picked up from nowhere.
> https://wso2.org/jira/browse/EMM-987
>
> This issue will break the clustering scenarios where we need to define
> host names in carbon.xml but EMM not picking them up properly.
>
> On Tue, Nov 17, 2015 at 3:18 PM, Chamara Ariyarathne 
> wrote:
>
>> Hi Azeez,
>>
>> Agree with that. However the precedence should be to use the HostName
>> value in the carbon.xml which is ultimately the deployment's exposed host
>> name, hence the constructed url in the email would be the correct access
>> url from outside.
>>
>> My argument is, this url shouldn't be kept in some other configuration
>> file repeatedly.
>>
>> Thanks.
>>
>> On Wed, Nov 11, 2015 at 7:04 PM, Afkham Azeez  wrote:
>>
>>> This is for information purposes only. The mail says the URL we send to
>>> the users in the email contains local host. May be you can get the IP
>>> address/host from the incoming request and use that.
>>>
>>> On Wed, Nov 11, 2015 at 3:59 AM, Geeth Munasinghe 
>>> wrote:
>>>
 Hi Azeez,

 In case of URL rewrite by LB, can we handle that by the proxy settings
 on catalina-server.xml ?

 Thanks
 Geeth






 *G. K. S. Munasinghe*
 *Senior Software Engineer,*
 *WSO2, Inc. http://wso2.com  *
 *lean.enterprise.middleware.*

 email: ge...@wso2.com
 phone:(+94) 777911226

 On Wed, Nov 11, 2015 at 2:10 PM, Afkham Azeez  wrote:

> proxy host name
>
> On Wed, Nov 11, 2015 at 12:28 AM, Chamara Ariyarathne <
> chama...@wso2.com> wrote:
>
>> Hi All,
>>
>> When a new user is added to EMM, the user will be notified with an
>> email to subscribe a device to MDM domain. The email contains the server
>> url to be accessed from the device.
>>
>> https://localhost:9443/mdm/enrollment
>>
>> In a usual deployment when a EMM cluster is fronted by a LB, this url
>> should be changed to the particular gateway host of the deployment. Now a
>> doubt arose whether to create this url by taking the value in HostName
>> element in carbon.xml or somewhere else.
>>
>> So the real doubt here is what is the correct way to configure the
>> HostName attribute in the carbon.xml in a carbon server. Is it going to 
>> be
>> the LB host's url which the deployment is exposed with or is it some 
>> local
>> host name internal to the deployment?
>>
>> --
>> *Chamara Ariyarathne*
>> Associate Technical Lead - QA
>> WSO2 Inc; http://www.wso2.com/
>> Mobile; *+94772786766 <%2B94772786766>*
>>
>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * *
> *email: **az...@wso2.com* 
> * 

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

2015-11-23 Thread Chamara Ariyarathne
So Geeth, my argument is even if there is a url re-write in the load
balancer, the carbon.xml HostName and MgtHostName value should be the
domain name which is exposed to outside world,

hence in your example: emm.wso2.com.

Do you have a counter argument for this?

On Mon, Nov 23, 2015 at 8:03 PM, Geeth Munasinghe  wrote:

> Hi Chamara
>
> For the first issue, as you and me had many offline discussions about it,
> let me explain the reason again, why we moved the LB host name and LB port
> to be taken from a different file (cdm-config.xml). This was required when
> we send email to users to get their devices enrolled, we need to get the LB
> host and port.
>
> When we configure the EMM servers, they will be in private network IPs.
> And those EMM servers will be exposed to the out side through a load
> balancer which will be on public IP. Normally load balancer will run on
> default http and https ports which are either 80 or 443. But EMM servers
> could run on any port (default 9443 and 9763). So when a load balancer
> receives a request to either 80 or 443 ports, it will redirect them to EMM
> server 9443 / 9763 ports.
>
> Another thing is load balancer could rewrite the urls, for example if the
> load balancer host name and port is https://emm.wso2.com:443, then in LB
> it can rewrite the urls to https://worker.mdm.com:9443.
>
> So AFAIK there is no configuration in carbon.xml where we can get the LB
> host name and port.
>
> And for the second issue, It is a bug which we will fix in next alpha
> release. But to fix this, I think the same rule applies. It cannot be taken
> from carbon.xml because mgt host name does give any impression about the
> load balancer url. So it should be taken from cdm-config.xml.
>
> Thanks
> Geeth
>
>
> *G. K. S. Munasinghe*
> *Senior Software Engineer,*
> *WSO2, Inc. http://wso2.com  *
> *lean.enterprise.middleware.*
>
> email: ge...@wso2.com
> phone:(+94) 777911226
>
> On Mon, Nov 23, 2015 at 6:51 PM, Chamara Ariyarathne 
> wrote:
>
>> We have a major design culprit with this situation now with the hostname
>> not getting picked up from carbon.xml. First reported jira is this
>> https://wso2.org/jira/browse/EMM-900
>>
>> Today we found out that even when the Host Names are configured in the
>> carbonl.xml to be server's identified domain name, the QR code which is
>> generated while device registration, uses the host ip address which is
>> picked up from nowhere.
>> https://wso2.org/jira/browse/EMM-987
>>
>> This issue will break the clustering scenarios where we need to define
>> host names in carbon.xml but EMM not picking them up properly.
>>
>> On Tue, Nov 17, 2015 at 3:18 PM, Chamara Ariyarathne 
>> wrote:
>>
>>> Hi Azeez,
>>>
>>> Agree with that. However the precedence should be to use the HostName
>>> value in the carbon.xml which is ultimately the deployment's exposed host
>>> name, hence the constructed url in the email would be the correct access
>>> url from outside.
>>>
>>> My argument is, this url shouldn't be kept in some other configuration
>>> file repeatedly.
>>>
>>> Thanks.
>>>
>>> On Wed, Nov 11, 2015 at 7:04 PM, Afkham Azeez  wrote:
>>>
 This is for information purposes only. The mail says the URL we send to
 the users in the email contains local host. May be you can get the IP
 address/host from the incoming request and use that.

 On Wed, Nov 11, 2015 at 3:59 AM, Geeth Munasinghe 
 wrote:

> Hi Azeez,
>
> In case of URL rewrite by LB, can we handle that by the proxy settings
> on catalina-server.xml ?
>
> Thanks
> Geeth
>
>
>
>
>
>
> *G. K. S. Munasinghe*
> *Senior Software Engineer,*
> *WSO2, Inc. http://wso2.com  *
> *lean.enterprise.middleware.*
>
> email: ge...@wso2.com
> phone:(+94) 777911226
>
> On Wed, Nov 11, 2015 at 2:10 PM, Afkham Azeez  wrote:
>
>> proxy host name
>>
>> On Wed, Nov 11, 2015 at 12:28 AM, Chamara Ariyarathne <
>> chama...@wso2.com> wrote:
>>
>>> Hi All,
>>>
>>> When a new user is added to EMM, the user will be notified with an
>>> email to subscribe a device to MDM domain. The email contains the server
>>> url to be accessed from the device.
>>>
>>> https://localhost:9443/mdm/enrollment
>>>
>>> In a usual deployment when a EMM cluster is fronted by a LB, this
>>> url should be changed to the particular gateway host of the deployment. 
>>> Now
>>> a doubt arose whether to create this url by taking the value in HostName
>>> element in carbon.xml or somewhere else.
>>>
>>> So the real doubt here is what is the correct way to configure the
>>> HostName attribute in the carbon.xml in a carbon server. Is it going to 
>>> be
>>> the LB host's url which the deployment is exposed with or 

Re: [Dev] [IS] Retrieve all permissions and actions of a user using admin services

2015-11-23 Thread Tharindu Edirisinghe
Hi Sajith,

You can take a look at *RemoteAuthorizationManagerService* [1]. There we
have the following method.

*isUserAuthorized* (username, resourceId, action)

>From this you can check if the user is authorized to perform some action on
a particular resource.

similarly you can check the same for a role using the following method.

*isRoleAuthorized* (rolename, resourceId, action)

However AFAIK it is not possible to retrieve all the permissions granted
for a user through an admin service.

If it is needed, one way is to query the* UM_ROLE_PERMISSION* table [2] (of
the internal database) and find out what are the associated permissions (of
*UM_PERMISSION* table) for each role. Then you will have to map the user
with the roles that the user has been assigned.

Hope this will be helpful.

[1] https://localhost:9443/services/RemoteAuthorizationManagerService?wsdl
[2]
http://tharindue.blogspot.com/2015/04/wso2-identity-server-data-dictionary.html

Thanks,
TharinduE

On Mon, Nov 23, 2015 at 6:58 AM, Sajith Ariyarathna 
wrote:

> Hi IS team,
>
> Is it possible to do $subject? I have the username, domain and tenant ID
> of the user.
>
> Thanks.
>
> --
> Sajith Ariyarathna
> Software Engineer; WSO2, Inc.;  http://wso2.com/
> mobile: +94 77 6602284, +94 71 3951048
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 

Tharindu Edirisinghe
Software Engineer | WSO2 Inc
Identity Server Team
Blog : tharindue.blogspot.com
mobile : 408-714-8437
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] WSO2 Committers += Thilini Cooray

2015-11-23 Thread Sajith Ariyarathna
Congratz Thilini!

On Mon, Nov 23, 2015 at 9:52 PM, Nuwan Dias  wrote:

> Hi,
>
> It is with great pleasure we welcome Thilini Cooray as a WSO2 Committer. @
> Thilini, congratulations and keep up the good work!
>
> Thanks,
> NuwanD.
>
> --
> Nuwan Dias
>
> Technical Lead - WSO2, Inc. http://wso2.com
> email : nuw...@wso2.com
> Phone : +94 777 775 729
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Sajith Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
mobile: +94 77 6602284, +94 71 3951048
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] [DAS]Error while getting data from DAS to DB2 tables

2015-11-23 Thread Lakshman Udayakantha
Hi,

I configured APIM with DAS to publish runtime statistics with DB2. When The
spark query runs with cron job, I got below error.










































































* [2015-11-24 10:15:00,007]  INFO
{org.wso2.carbon.analytics.spark.core.AnalyticsTask} -  Executing the
schedule task for: APIM_STAT_SCRIPT for tenant id: -1234[2015-11-24
10:16:07,353] ERROR {org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter}
-  Error in executing task: None.getjava.lang.RuntimeException: None.getat
org.apache.spark.sql.jdbc.carbon.JDBCRelation.insert(JDBCRelation.scala:193)at
org.apache.spark.sql.sources.InsertIntoDataSource.run(commands.scala:53)at
org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult$lzycompute(commands.scala:57)at
org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult(commands.scala:57)at
org.apache.spark.sql.execution.ExecutedCommand.doExecute(commands.scala:68)at
org.apache.spark.sql.execution.SparkPlan$anonfun$execute$1.apply(SparkPlan.scala:88)at
org.apache.spark.sql.execution.SparkPlan$anonfun$execute$1.apply(SparkPlan.scala:88)at
org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:147)at
org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:87)at
org.apache.spark.sql.SQLContext$QueryExecution.toRdd$lzycompute(SQLContext.scala:950)at
org.apache.spark.sql.SQLContext$QueryExecution.toRdd(SQLContext.scala:950)at
org.apache.spark.sql.DataFrame.(DataFrame.scala:144)at
org.apache.spark.sql.DataFrame.(DataFrame.scala:128)at
org.apache.spark.sql.DataFrame$.apply(DataFrame.scala:51)at
org.apache.spark.sql.SQLContext.sql(SQLContext.scala:755)at
org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQueryLocal(SparkAnalyticsExecutor.java:710)at
org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQuery(SparkAnalyticsExecutor.java:692)at
org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeQuery(CarbonAnalyticsProcessorService.java:199)at
org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeScript(CarbonAnalyticsProcessorService.java:149)at
org.wso2.carbon.analytics.spark.core.AnalyticsTask.execute(AnalyticsTask.java:57)at
org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:67)at
org.quartz.core.JobRunShell.run(JobRunShell.java:213)at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)at
java.util.concurrent.FutureTask.run(FutureTask.java:262)at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)at
java.lang.Thread.run(Thread.java:745)Caused by:
java.util.NoSuchElementException: None.getat
scala.None$.get(Option.scala:313)at scala.None$.get(Option.scala:311)at
org.apache.spark.sql.jdbc.carbon.JdbcUtils$.getQueryConfigEntry(JdbcUtils.scala:69)at
org.apache.spark.sql.jdbc.carbon.JdbcUtils$.tableExists(JdbcUtils.scala:45)at
org.apache.spark.sql.jdbc.carbon.JDBCRelation.insert(JDBCRelation.scala:170)...
26 more *


Debugged the analytics code and found this line will throw the error

this.sqlCtx.sql(query);

When running below query

*INSERT OVERWRITE TABLE X1234_APIRequestSummaryData SELECT
api,api_version,version,apiPublisher,consumerKey,userId,context,max_request_time,total_request_count,hostName,year,month,day,time
FROM X1234_API_REQUEST_SUMMARY_FINAL*
Any idea to resolve this issue is much appreciated.

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


[Dev] Adding Metrics to APIManager 1.10.0

2015-11-23 Thread Dinesh J Weerakkody
Hi All,

As a part of the effort of performance measuring and improvement of WSO2
API Manager, we are planing to incorporate the Metrics feature [1], which
will help us to gather statistics during the runtime.

Initially we will add metrics to all the handlers in APIM and based on the
results we will add more data collection points as necessary.

[1] https://github.com/wso2/carbon-metrics


Thanks

*Dinesh J. Weerakkody*
Software Engineer
WSO2 Inc.
lean | enterprise | middleware
M : +94 727 868676 | E : dine...@wso2.com | W : www.wso2.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [IS] Retrieve all permissions and actions of a user using admin services

2015-11-23 Thread Sajith Ariyarathna
Hi Tharindu,

Thanks for the info. Since I'm implementing this using Jaggery, I'll use
the 'RemoteAuthorizationManagerService' admin service.

Cheers.

On Tue, Nov 24, 2015 at 4:30 AM, Tharindu Edirisinghe 
wrote:

> Hi Sajith,
>
> You can take a look at *RemoteAuthorizationManagerService* [1]. There we
> have the following method.
>
> *isUserAuthorized* (username, resourceId, action)
>
> From this you can check if the user is authorized to perform some action
> on a particular resource.
>
> similarly you can check the same for a role using the following method.
>
> *isRoleAuthorized* (rolename, resourceId, action)
>
> However AFAIK it is not possible to retrieve all the permissions granted
> for a user through an admin service.
>
> If it is needed, one way is to query the* UM_ROLE_PERMISSION* table [2]
> (of the internal database) and find out what are the associated permissions
> (of *UM_PERMISSION* table) for each role. Then you will have to map the
> user with the roles that the user has been assigned.
>
> Hope this will be helpful.
>
> [1] https://localhost:9443/services/RemoteAuthorizationManagerService?wsdl
> [2]
> http://tharindue.blogspot.com/2015/04/wso2-identity-server-data-dictionary.html
>
> Thanks,
> TharinduE
>
> On Mon, Nov 23, 2015 at 6:58 AM, Sajith Ariyarathna 
> wrote:
>
>> Hi IS team,
>>
>> Is it possible to do $subject? I have the username, domain and tenant ID
>> of the user.
>>
>> Thanks.
>>
>> --
>> Sajith Ariyarathna
>> Software Engineer; WSO2, Inc.;  http://wso2.com/
>> mobile: +94 77 6602284, +94 71 3951048
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> Tharindu Edirisinghe
> Software Engineer | WSO2 Inc
> Identity Server Team
> Blog : tharindue.blogspot.com
> mobile : 408-714-8437
>
>
>


-- 
Sajith Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
mobile: +94 77 6602284, +94 71 3951048
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Http Servlet forwarding issue

2015-11-23 Thread Godwin Shrimal
Hi Harsha,

As you told, samlsso and commonauth is in separate web context and tomcat
block access across the context by default. But we can enable crossContext
in context.xml. In our carbon products crossContext is enabled by default.


Thanks
Godwin




On Mon, Nov 23, 2015 at 11:29 PM, Harsha Thirimanna 
wrote:

> I think, both samlsso and commonauth behave as separate web context.
> If that is true then the tomcat by default block to access across the
> context . to allow that we have to enable it in tomcat level. I don't think
> we can do it in here.
> AFAIK Only think you can do is redirecting.
> On Nov 23, 2015 7:23 PM, "Godwin Shrimal"  wrote:
>
>> Hi,
>>
>> I am trying to forward the servlet request from *samlsso* servlet to
>> *commonauth* and getting following error in browser.
>>
>> *HTTP Status 405 - HTTP method GET is not supported by this URL*
>>
>> Note : Both servlets are registered from OSGI Service component and has
>> implemented doGet and doPost methods in both servlets. Its working properly
>> when we use *response.sendRedirect*.
>>
>> What can be the reason for this ?
>>
>> Thanks
>> Godwin
>>
>>
>> --
>> *Godwin Amila Shrimal*
>> Senior Software Engineer
>> WSO2 Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: *+94772264165*
>> linkedin: *http://lnkd.in/KUum6D *
>> twitter: https://twitter.com/godwinamila
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>


-- 
*Godwin Amila Shrimal*
Senior Software Engineer
WSO2 Inc.; http://wso2.com
lean.enterprise.middleware

mobile: *+94772264165*
linkedin: *http://lnkd.in/KUum6D *
twitter: https://twitter.com/godwinamila
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [DAS]Error while getting data from DAS to DB2 tables

2015-11-23 Thread Inosh Goonewardena
Hi Lakshman,

There was an issue [1] and this has been fixed now. As a workaround can you
try by specifying the exact DB2 database type instead of DB* in
rdbms-config.xml

[1] https://wso2.org/jira/browse/DAS-311


On Tuesday, November 24, 2015, Lakshman Udayakantha 
wrote:

> Hi,
>
> I configured APIM with DAS to publish runtime statistics with DB2. When
> The spark query runs with cron job, I got below error.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> * [2015-11-24 10:15:00,007]  INFO
> {org.wso2.carbon.analytics.spark.core.AnalyticsTask} -  Executing the
> schedule task for: APIM_STAT_SCRIPT for tenant id: -1234[2015-11-24
> 10:16:07,353] ERROR {org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter}
> -  Error in executing task: None.getjava.lang.RuntimeException: None.getat
> org.apache.spark.sql.jdbc.carbon.JDBCRelation.insert(JDBCRelation.scala:193)at
> org.apache.spark.sql.sources.InsertIntoDataSource.run(commands.scala:53)at
> org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult$lzycompute(commands.scala:57)at
> org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult(commands.scala:57)at
> org.apache.spark.sql.execution.ExecutedCommand.doExecute(commands.scala:68)at
> org.apache.spark.sql.execution.SparkPlan$anonfun$execute$1.apply(SparkPlan.scala:88)at
> org.apache.spark.sql.execution.SparkPlan$anonfun$execute$1.apply(SparkPlan.scala:88)at
> org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:147)at
> org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:87)at
> org.apache.spark.sql.SQLContext$QueryExecution.toRdd$lzycompute(SQLContext.scala:950)at
> org.apache.spark.sql.SQLContext$QueryExecution.toRdd(SQLContext.scala:950)at
> org.apache.spark.sql.DataFrame.(DataFrame.scala:144)at
> org.apache.spark.sql.DataFrame.(DataFrame.scala:128)at
> org.apache.spark.sql.DataFrame$.apply(DataFrame.scala:51)at
> org.apache.spark.sql.SQLContext.sql(SQLContext.scala:755)at
> org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQueryLocal(SparkAnalyticsExecutor.java:710)at
> org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQuery(SparkAnalyticsExecutor.java:692)at
> org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeQuery(CarbonAnalyticsProcessorService.java:199)at
> org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeScript(CarbonAnalyticsProcessorService.java:149)at
> org.wso2.carbon.analytics.spark.core.AnalyticsTask.execute(AnalyticsTask.java:57)at
> org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:67)at
> org.quartz.core.JobRunShell.run(JobRunShell.java:213)at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)at
> java.util.concurrent.FutureTask.run(FutureTask.java:262)at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)at
> java.lang.Thread.run(Thread.java:745)Caused by:
> java.util.NoSuchElementException: None.getat
> scala.None$.get(Option.scala:313)at scala.None$.get(Option.scala:311)at
> org.apache.spark.sql.jdbc.carbon.JdbcUtils$.getQueryConfigEntry(JdbcUtils.scala:69)at
> org.apache.spark.sql.jdbc.carbon.JdbcUtils$.tableExists(JdbcUtils.scala:45)at
> org.apache.spark.sql.jdbc.carbon.JDBCRelation.insert(JDBCRelation.scala:170)...
> 26 more *
>
>
> Debugged the analytics code and found this line will throw the error
>
> this.sqlCtx.sql(query);
>
> When running below query
>
> *INSERT OVERWRITE TABLE X1234_APIRequestSummaryData SELECT
> api,api_version,version,apiPublisher,consumerKey,userId,context,max_request_time,total_request_count,hostName,year,month,day,time
> FROM X1234_API_REQUEST_SUMMARY_FINAL*
> Any idea to resolve this issue is much appreciated.
>
> Thanks
> --
> Lakshman Udayakantha
> WSO2 Inc. www.wso2.com
> lean.enterprise.middleware
> Mobile: *0714388124*
>
>

-- 
Thanks & Regards,

Inosh Goonewardena
Associate Technical Lead- WSO2 Inc.
Mobile: +94779966317
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


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

2015-11-23 Thread Manuri Amaya Perera
Hi,

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

Please share your thoughts on this.

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

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

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


Thank you.

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

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



-- 

*Manuri Amaya Perera*

*Software Engineer*

*WSO2 Inc.*

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


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

2015-11-23 Thread Afkham Azeez
Can carbon-parent be the parent of non-osgi jars as well? If so should we
call it carbon-componet-parent?
On Nov 24, 2015 11:13 AM, "Manuri Amaya Perera"  wrote:

> Hi,
>
> I have created a doc[1] on
> 1. What configurations should be allowed to be changed by component
> developers (may have default values or not)
> 2. What should have default values which cannot be overridden without
> redeclaring the plugin inside the bundle
>
> Please share your thoughts on this.
>
> And this[2] is the documentation I created on the usage of this approach.
>
> I have built C5, carbon-transport, product-mss, product-gw with this.
>
> [1]
> https://docs.google.com/a/wso2.com/spreadsheets/d/1EegtaHbrSVQ1eJf75z9p03PiEkFguCytAYmyQCDSsjI/edit?usp=sharing
> [2]
> https://docs.google.com/a/wso2.com/document/d/1468M7L2vHcJQ-4oChb_5wBpRECNbUX3Om31MFzpZ_nc/edit?usp=sharing
>
>
> Thank you.
>
> On Wed, Nov 11, 2015 at 2:50 PM, Manuri Amaya Perera 
> wrote:
>
>> + architecture@
>>
>> On Wed, Nov 11, 2015 at 2:46 PM, Manuri Amaya Perera 
>> wrote:
>>
>>> Hi,
>>>
>>> Currently for each carbon component's pom file we need to include the
>>> maven bundle plugin. Some of the bundle plugin configuration values such as
>>> group id, artifact id and version are repetitively used in each of these
>>> components(eg: [1])
>>>
>>> We can avoid this repetition by including the bundle plugin inside
>>> carbon-parent pom[2] instead of having it inside each component.
>>> Here we have to include bundle plugin inside build/plugins[3] section of
>>> carbon-parent pom and then the plugin configuration will be inherited by
>>> child modules and any configuration that needs to be overridden could be
>>> mentioned as properties inside child poms.
>>> This will make maintenance easier and reduce code.
>>>
>>> There is also a disadvantage with parameterizing the bundle plugin. That
>>> is, some headers such as Bundle-NativeCode must have a value if that
>>> element is put in the plugin configuration[4], otherwise the build
>>> fails.Therefore we cannot have this inside carbon-parent pom's bundle
>>> plugin configuration as child modules may not have a value for it.
>>> This is the only header we've found out which causes this problem. And I
>>> could not find any usage of this header in a WSO2 repository. Therefore if
>>> this header is not going to be used we can safely remove it from
>>> carbon-parent pom and proceed with parameterizing the bundle plugin.
>>>
>>> Your ideas on moving the bundle-plugin configuration to carbon-parent
>>> pom and parameterization will be highly appreciated.
>>>
>>>
>>> ​[1] https://github.com/wso2/carbon-kernel/blob/5.0.x/core/pom.xml​
>>> ​[2] ​https://github.com/wso2/carbon-parent/blob/master/pom.xml
>>> [3] https://maven.apache.org/pom.html#Plugins
>>> [4] http://bnd.bndtools.org/heads/bundle_nativecode.html
>>>
>>>
>>> ​Thank you.​
>>>
>>> --
>>>
>>> *Manuri Amaya Perera*
>>>
>>> *Software Engineer*
>>>
>>> *WSO2 Inc.*
>>>
>>> *Blog: http://manuriamayaperera.blogspot.com
>>> *
>>>
>>
>>
>>
>> --
>>
>> *Manuri Amaya Perera*
>>
>> *Software Engineer*
>>
>> *WSO2 Inc.*
>>
>> *Blog: http://manuriamayaperera.blogspot.com
>> *
>>
>
>
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


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

2015-11-23 Thread Manuri Amaya Perera
Hi Azeez,

[1] is a non-osgi jar which has the parent carbon-kernel of which the
parent is carbon-parent.
Why do we need to add "component" ? Doesn't it already sound generic?

[1] https://github.com/wso2/carbon-kernel/blob/master/launcher/pom.xml

Thank you.

On Tue, Nov 24, 2015 at 11:18 AM, Afkham Azeez  wrote:

> Can carbon-parent be the parent of non-osgi jars as well? If so should we
> call it carbon-componet-parent?
> On Nov 24, 2015 11:13 AM, "Manuri Amaya Perera"  wrote:
>
>> Hi,
>>
>> I have created a doc[1] on
>> 1. What configurations should be allowed to be changed by component
>> developers (may have default values or not)
>> 2. What should have default values which cannot be overridden without
>> redeclaring the plugin inside the bundle
>>
>> Please share your thoughts on this.
>>
>> And this[2] is the documentation I created on the usage of this approach.
>>
>> I have built C5, carbon-transport, product-mss, product-gw with this.
>>
>> [1]
>> https://docs.google.com/a/wso2.com/spreadsheets/d/1EegtaHbrSVQ1eJf75z9p03PiEkFguCytAYmyQCDSsjI/edit?usp=sharing
>> [2]
>> https://docs.google.com/a/wso2.com/document/d/1468M7L2vHcJQ-4oChb_5wBpRECNbUX3Om31MFzpZ_nc/edit?usp=sharing
>>
>>
>> Thank you.
>>
>> On Wed, Nov 11, 2015 at 2:50 PM, Manuri Amaya Perera 
>> wrote:
>>
>>> + architecture@
>>>
>>> On Wed, Nov 11, 2015 at 2:46 PM, Manuri Amaya Perera 
>>> wrote:
>>>
 Hi,

 Currently for each carbon component's pom file we need to include the
 maven bundle plugin. Some of the bundle plugin configuration values such as
 group id, artifact id and version are repetitively used in each of these
 components(eg: [1])

 We can avoid this repetition by including the bundle plugin inside
 carbon-parent pom[2] instead of having it inside each component.
 Here we have to include bundle plugin inside build/plugins[3] section
 of carbon-parent pom and then the plugin configuration will be inherited by
 child modules and any configuration that needs to be overridden could be
 mentioned as properties inside child poms.
 This will make maintenance easier and reduce code.

 There is also a disadvantage with parameterizing the bundle plugin.
 That is, some headers such as Bundle-NativeCode must have a value if that
 element is put in the plugin configuration[4], otherwise the build
 fails.Therefore we cannot have this inside carbon-parent pom's bundle
 plugin configuration as child modules may not have a value for it.
 This is the only header we've found out which causes this problem. And
 I could not find any usage of this header in a WSO2 repository. Therefore
 if this header is not going to be used we can safely remove it from
 carbon-parent pom and proceed with parameterizing the bundle plugin.

 Your ideas on moving the bundle-plugin configuration to carbon-parent
 pom and parameterization will be highly appreciated.


 ​[1] https://github.com/wso2/carbon-kernel/blob/5.0.x/core/pom.xml​
 ​[2] ​https://github.com/wso2/carbon-parent/blob/master/pom.xml
 [3] https://maven.apache.org/pom.html#Plugins
 [4] http://bnd.bndtools.org/heads/bundle_nativecode.html


 ​Thank you.​

 --

 *Manuri Amaya Perera*

 *Software Engineer*

 *WSO2 Inc.*

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

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


-- 

*Manuri Amaya Perera*

*Software Engineer*

*WSO2 Inc.*

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


Re: [Dev] [DAS]Error while getting data from DAS to DB2 tables

2015-11-23 Thread Lakshman Udayakantha
Hi Inosh,

Thanks for the info. As you pointed out, specifying DB2 type as DB2/NT.
This error is gone and statistics published successfully.

Thanks

On Tue, Nov 24, 2015 at 11:06 AM, Inosh Goonewardena  wrote:

> Hi Lakshman,
>
> There was an issue [1] and this has been fixed now. As a workaround can
> you try by specifying the exact DB2 database type instead of DB* in
> rdbms-config.xml
>
> [1] https://wso2.org/jira/browse/DAS-311
>
>
> On Tuesday, November 24, 2015, Lakshman Udayakantha 
> wrote:
>
>> Hi,
>>
>> I configured APIM with DAS to publish runtime statistics with DB2. When
>> The spark query runs with cron job, I got below error.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> * [2015-11-24 10:15:00,007]  INFO
>> {org.wso2.carbon.analytics.spark.core.AnalyticsTask} -  Executing the
>> schedule task for: APIM_STAT_SCRIPT for tenant id: -1234[2015-11-24
>> 10:16:07,353] ERROR {org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter}
>> -  Error in executing task: None.getjava.lang.RuntimeException: None.getat
>> org.apache.spark.sql.jdbc.carbon.JDBCRelation.insert(JDBCRelation.scala:193)at
>> org.apache.spark.sql.sources.InsertIntoDataSource.run(commands.scala:53)at
>> org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult$lzycompute(commands.scala:57)at
>> org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult(commands.scala:57)at
>> org.apache.spark.sql.execution.ExecutedCommand.doExecute(commands.scala:68)at
>> org.apache.spark.sql.execution.SparkPlan$anonfun$execute$1.apply(SparkPlan.scala:88)at
>> org.apache.spark.sql.execution.SparkPlan$anonfun$execute$1.apply(SparkPlan.scala:88)at
>> org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:147)at
>> org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:87)at
>> org.apache.spark.sql.SQLContext$QueryExecution.toRdd$lzycompute(SQLContext.scala:950)at
>> org.apache.spark.sql.SQLContext$QueryExecution.toRdd(SQLContext.scala:950)at
>> org.apache.spark.sql.DataFrame.(DataFrame.scala:144)at
>> org.apache.spark.sql.DataFrame.(DataFrame.scala:128)at
>> org.apache.spark.sql.DataFrame$.apply(DataFrame.scala:51)at
>> org.apache.spark.sql.SQLContext.sql(SQLContext.scala:755)at
>> org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQueryLocal(SparkAnalyticsExecutor.java:710)at
>> org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQuery(SparkAnalyticsExecutor.java:692)at
>> org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeQuery(CarbonAnalyticsProcessorService.java:199)at
>> org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeScript(CarbonAnalyticsProcessorService.java:149)at
>> org.wso2.carbon.analytics.spark.core.AnalyticsTask.execute(AnalyticsTask.java:57)at
>> org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:67)at
>> org.quartz.core.JobRunShell.run(JobRunShell.java:213)at
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)at
>> java.util.concurrent.FutureTask.run(FutureTask.java:262)at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)at
>> java.lang.Thread.run(Thread.java:745)Caused by:
>> java.util.NoSuchElementException: None.getat
>> scala.None$.get(Option.scala:313)at scala.None$.get(Option.scala:311)at
>> org.apache.spark.sql.jdbc.carbon.JdbcUtils$.getQueryConfigEntry(JdbcUtils.scala:69)at
>> org.apache.spark.sql.jdbc.carbon.JdbcUtils$.tableExists(JdbcUtils.scala:45)at
>> org.apache.spark.sql.jdbc.carbon.JDBCRelation.insert(JDBCRelation.scala:170)...
>> 26 more *
>>
>>
>> Debugged the analytics code and found this line will throw the error
>>
>> this.sqlCtx.sql(query);
>>
>> When running below query
>>
>> *INSERT OVERWRITE TABLE X1234_APIRequestSummaryData SELECT
>> api,api_version,version,apiPublisher,consumerKey,userId,context,max_request_time,total_request_count,hostName,year,month,day,time
>> FROM X1234_API_REQUEST_SUMMARY_FINAL*
>> Any idea to resolve this issue is much appreciated.
>>
>> Thanks
>> --
>> Lakshman Udayakantha
>> WSO2 Inc. www.wso2.com
>> lean.enterprise.middleware
>> Mobile: *0714388124*
>>
>>
>
> --
> Thanks & Regards,
>
> Inosh Goonewardena
> Associate Technical Lead- WSO2 Inc.
> Mobile: +94779966317
>
>


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


Re: [Dev] [DEV] Implement unit/integration test cases for API Manager JAX-RS Rest API

2015-11-23 Thread Dharshana Warusavitharana
Hi Sanjeewa,

Sorry for late reply , some how i missed this.
Please use following versions on dependencies

2.0.0.wso2v1
3.0.2.Final
2.0.1


And place the dependency with scope of compile so that won't conflict with
other dependencies.


org.jboss.resteasy
resteasy-client
compile


Thank you,

Dharshana.



On Mon, Nov 23, 2015 at 12:13 PM, Sanjeewa Malalgoda 
wrote:

> @dharshana can you confirm rest easy version we should use in Apim 1.10x.
> It seems http client version conflict happen in automation tests due to
> obove import.
>
> Thanks
> sanjeewa.
>
> sent from my phone
> On Nov 20, 2015 2:37 PM, "Dharshana Warusavitharana" 
> wrote:
>
>> Hi Sanjeewa,
>>
>> This is ok to add these dependencies but for jax-rs please refer the
>> jax-rs wso2 version that used in the product. Else there will be confilcts.
>>
>> Thank you,
>> Dharshana.
>>
>> On Fri, Nov 20, 2015 at 2:29 PM, Sanjeewa Malalgoda 
>> wrote:
>>
>>> Hi Team,
>>> While implementing test case as per sample provided by dharshanaW i
>>> wanted add following dependencies to test back end pom.
>>>
>>> 
>>> javax.ws.rs
>>> javax.ws.rs-api
>>> 2.0.1
>>> 
>>>
>>> org.jboss.resteasy
>>> resteasy-client
>>> 3.0.2.Final
>>>
>>> Is it ok if added these dependencies to back end tests module?
>>> We have implemented generic data driven test utility class and we may
>>> move it to automation core as its common requirement.
>>> Its main methods input parameters as follows.
>>>
>>> testRestAPI(String url, String requestPayLoad, Map
>>> header, Map queryParams,
>>>   String responsePayLoad)
>>>
>>> Thanks,
>>> sanjeewa.
>>>
>>>
>>>
>>> On Wed, Nov 18, 2015 at 4:58 PM, Sanjeewa Malalgoda 
>>> wrote:
>>>
 As per discussion with automation test team our plan is to implement
 data driven test cases for this.
 With that we will be able to define request data and expected response
 data.
 The utility class we are going to implement will take request data and
 then validate response with provided response.
 If the API got changed in future we do not need to change test.
 We can simply change the data set as per new API.
 This approach will help us to implement test easily and manage them.

 Please let us know your thought on this.

 Thanks,
 sanjeewa.


 On Tue, Nov 3, 2015 at 5:49 PM, Krishantha Samaraweera <
 krishan...@wso2.com> wrote:

> Hi Sanjeewa
>
> On Tue, Oct 20, 2015 at 2:47 PM, Sanjeewa Malalgoda  > wrote:
>
>> QAA team shall we have discussion on this and come to conclusion?
>> Please let us know possible time slots.
>>
>
> +1 shall we meet this week.
>
> Thanks,
> Krishantha.
>
>>
>> Thanks,
>> sanjeewa.
>>
>> On Mon, Oct 19, 2015 at 12:44 PM, Sanjeewa Malalgoda <
>> sanje...@wso2.com> wrote:
>>
>>> Here idea is easily manage the tests and web application.
>>> Since web application purely depend on swagger definition it will
>>> automatically generate beans, service skeletons etc.
>>>
>>> So in same way if we implement test cases we don't have to go and
>>> edit test case code after we adding new parameters or something like 
>>> that.
>>> What we can simply do is change sample data set feed into test.
>>>
>>>
>>>
>>> On Mon, Oct 19, 2015 at 12:34 PM, Joseph Fonseka 
>>> wrote:
>>>
 Hi Nuwan

 Thanks for pointing that out, in that case test can be version-ed
 so auto generated tests for version 1.0.0 should work with API 1.0.1 
 ...

 WDYT?

 Regards
 Jo

 On Mon, Oct 19, 2015 at 12:29 PM, Nuwan Dias 
 wrote:

> Is it right to auto-generate the test client code? IMO one
> objective of this should be to make sure the REST APIs don't change 
> across
> patch releases, etc. If we auto-generate the test stubs we would 
> loose that
> advantage.
>
 I don't get how we loose advantage here.
>>> If we don't want to change service API we don't have to edit swagger
>>> json and that is it.
>>> Then it will not change service API, neither test client or data set
>>> feed in to test.
>>> If we consider both integration and unit tests those will be
>>> released anyway with product and component release.
>>> So tests will be automatically version-ed with component/product
>>> version.
>>>
>>> Thanks,
>>> sanjeewa.
>>>
>>>

> Thanks,
> NuwanD.
>
> On Mon, Oct 19, 2015 at 12:26 PM, Joseph Fonseka 

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

2015-11-23 Thread Afkham Azeez
We can't make all non-osgi jars make carbon-kernel their parent
On Nov 24, 2015 11:37 AM, "Manuri Amaya Perera"  wrote:

> Hi Azeez,
>
> [1] is a non-osgi jar which has the parent carbon-kernel of which the
> parent is carbon-parent.
> Why do we need to add "component" ? Doesn't it already sound generic?
>
> [1] https://github.com/wso2/carbon-kernel/blob/master/launcher/pom.xml
>
> Thank you.
>
> On Tue, Nov 24, 2015 at 11:18 AM, Afkham Azeez  wrote:
>
>> Can carbon-parent be the parent of non-osgi jars as well? If so should we
>> call it carbon-componet-parent?
>> On Nov 24, 2015 11:13 AM, "Manuri Amaya Perera"  wrote:
>>
>>> Hi,
>>>
>>> I have created a doc[1] on
>>> 1. What configurations should be allowed to be changed by component
>>> developers (may have default values or not)
>>> 2. What should have default values which cannot be overridden without
>>> redeclaring the plugin inside the bundle
>>>
>>> Please share your thoughts on this.
>>>
>>> And this[2] is the documentation I created on the usage of this
>>> approach.
>>>
>>> I have built C5, carbon-transport, product-mss, product-gw with this.
>>>
>>> [1]
>>> https://docs.google.com/a/wso2.com/spreadsheets/d/1EegtaHbrSVQ1eJf75z9p03PiEkFguCytAYmyQCDSsjI/edit?usp=sharing
>>> [2]
>>> https://docs.google.com/a/wso2.com/document/d/1468M7L2vHcJQ-4oChb_5wBpRECNbUX3Om31MFzpZ_nc/edit?usp=sharing
>>>
>>>
>>> Thank you.
>>>
>>> On Wed, Nov 11, 2015 at 2:50 PM, Manuri Amaya Perera 
>>> wrote:
>>>
 + architecture@

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

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



 --

 *Manuri Amaya Perera*

 *Software Engineer*

 *WSO2 Inc.*

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

>>>
>>>
>>>
>>> --
>>>
>>> *Manuri Amaya Perera*
>>>
>>> *Software Engineer*
>>>
>>> *WSO2 Inc.*
>>>
>>> *Blog: http://manuriamayaperera.blogspot.com
>>> *
>>>
>>
>
>
> --
>
> *Manuri Amaya Perera*
>
> *Software Engineer*
>
> *WSO2 Inc.*
>
> *Blog: http://manuriamayaperera.blogspot.com
> *
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Architecture] [CARBON] Creating an archetype for a simple carbon component

2015-11-23 Thread Manuri Amaya Perera
Hi,

As decided in the discussion with Carbon Team, I have implemented two
archetypes.

1. carbon-bundle-archetype

This is an archetype for a generic OSGi bundle which does not include
anything Carbon specific.

2. carbon-component-archetype

This is an archetype for a carbon component with a dependency to carbon
core and include a service component which registers an OSGi service as
well as consumes an existing OSGi service from Carbon.

Please find the documentation for carbon-bundle-archetype here[1] and for
carbon-component-archetype[2] here.


[1]
https://docs.google.com/a/wso2.com/document/d/1v11KrSbwXeyIprXibo4lmqKGQwFdcGRy6JCpEjJnj5s/edit?usp=sharing
[2]
https://docs.google.com/a/wso2.com/document/d/1fA5t8C6senC63RqGGOqtkxRwgXn9HRga-DsutzU1ZIE/edit?usp=sharing

On Mon, Nov 16, 2015 at 10:28 PM, Manuri Amaya Perera 
wrote:

> @Maninda This is basically a template, as you said which can be used to
> create a carbon component easily.
>
>
> @Harsha At the moment it has been decided to implement
> 1. a bundle archetype which is for generating a generic OSGi bundle
> and
> 2. a Carbon Component archetype which includes a service component which
> consumes some OSGi services registered in Carbon runtime
>
> after the review with the Carbon team. [2]
>
> And we are expecting to create more archetypes for different types of
> projects. Ideas on new archetypes for projects that can be generalized and
> have repetitively created project structures, patterns and configuration
> are welcome.
>
>
>
> [1] https://maven.apache.org/archetypes/maven-archetype-quickstart/
> [2] mail subject: Invitation: Carbon bundle archetype - review @ Mon Nov
> 16, 2015 4:30pm - 5:30pm
>
> Thank you.
>
> On Mon, Nov 16, 2015 at 9:39 PM, Bhathiya Jayasekara 
> wrote:
>
>>
>> On Mon, Nov 16, 2015 at 9:22 PM, Harsha Thirimanna 
>> wrote:
>>
>>> We can add a sample service holder class also as a template in archetype
>>> to hold OSGi services that is consumed by this component. We may need
>>> to give a commented out code to show that usage and then anyone can follow
>>> that pattern. WDYT  ?
>>>
>>
>> Yes, this is a good idea, because I've seen incorrect usage of Data
>> holder pattern in certain places.
>>
>> Thanks,
>> Bhathiya
>>
>>
>>>
>>>
>>> *Harsha Thirimanna*
>>> Senior Software Engineer; WSO2, Inc.; http://wso2.com
>>> * *
>>> *email: **hars...@wso2.com* * cell: +94 71 5186770 *
>>> *twitter: **http://twitter.com/ *
>>> *harshathirimannlinked-in: **http:
>>> **//www.linkedin.com/pub/harsha-thirimanna/10/ab8/122
>>> *
>>>
>>> *Lean . Enterprise . Middleware*
>>>
>>>
>>> On Sat, Nov 14, 2015 at 10:24 PM, Manuri Amaya Perera 
>>> wrote:
>>>


 On Sat, Nov 14, 2015 at 10:18 PM, Manuri Amaya Perera  wrote:

> Hi,
>
> I have created an archetype for a simple carbon component.
>
> At the moment it has been added under carbon-kernel/archetypes as per
> the discussion during C5 progress review of the Carbon team.
>
> This is the structure for the archetype.
>
> archetypes​
> ├── carbon-bundle-archetype
> │   ├── pom.xml
> │   └── src
> │   └── main
> │   └── resources
> │   ├── archetype-resources
> │   │   ├── pom.xml
> │   │   └── src
> │   │   ├── main
> │   │   │   └── java
> │   │   │   ├── Hello.java
> │   │   │   └── internal
> │   │   │   └── SampleBundleActivator.java
> │   │   └── test
> │   │   └── java
> │   │   └── HelloTest.java
> │   └── META-INF
> │   └── maven
> │   └── archetype-metadata.xml
> └── pom.xml
>
> In order to create a project from this archetype, you can enter the
> command as follows.
>
> mvn archetype:generate -DarchetypeGroupId=org.wso2.carbon
> -DarchetypeArtifactId=org.wso2.carbon.archetypes.bundle
> -DarchetypeVersion=5.0.0-SNAPSHOT  -DgroupId=org.example
> -DartifactId=org.example.project -Dpackage=org.example.project
> -Dversion=1.0.0-SNAPSHOT
> ​
> Structure of the project created would be as follows.
>
> org.example.project
> ├── pom.xml
> └── src
> ├── main
> │   └── java
> │   └── org
> │   └── example
> │   └── project
> │   ├── Hello.java
> │   └── internal
> │   └── SampleBundleActivator.java
> └── test
> └── java
>   

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

2015-11-23 Thread Malintha Adikari
Hi,

I am getting following error while trying to add comment to an API in store
node in a distributed setup. I tried this in stadalone pack and this issue
is not there. Is there any suspicious configuration which cause this error ?

TID: [-1234] [] [2015-11-24 06:34:29,454] ERROR
{org.jaggeryjs.jaggery.core.manager.WebAppManager} -
 org.mozilla.javascript.EcmaError: ReferenceError: "ssoEnabled" is not
defined. (/store/site/blocks/comment/comment-add/ajax/comment-add.jag#33)
{org.jaggeryjs.jaggery.core.manager.WebAppManager}
org.jaggeryjs.scriptengine.exceptions.ScriptException:
org.mozilla.javascript.EcmaError: ReferenceError: "ssoEnabled" is not
defined. (/store/site/blocks/comment/comment-add/ajax/comment-add.jag#33)
at
org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:571)
at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:587)
at
org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:507)
at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:378)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at
org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
at
org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
at
org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
at
org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
at
org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
at
org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at
org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
at
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
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)
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "ssoEnabled"
is not defined.
(/store/site/blocks/comment/comment-add/ajax/comment-add.jag#33)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
at
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
at
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3750)
at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1728)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0._c_anonymous_1(/store/site/blocks/comment/comment-add/ajax/comment-add.jag:33)
at
org.jaggeryjs.rhino.store.site.blocks.comment.comment_add.ajax.c0.call(/store/site/blocks/comment/comment-add/ajax/comment-add.jag)
at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
at

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

2015-11-23 Thread Afkham Azeez
Yes. You have to use the value in the carbon. Xml
On Nov 24, 2015 8:17 AM, "Selvaratnam Uthaiyashankar" 
wrote:

> I agree with Chamara. We have a way to configure public hostname
> (HostName, MgtHostName in carbon.xml) and port (proxy port in
> tomcat/catalina-server.xml). This is what used in generating service
> endpoints, WSDL URLs etc. when a server is fronted with LB. I don't see any
> necessary for EMM to have a new configuration.
>
> On Tue, Nov 24, 2015 at 12:41 AM, Geeth Munasinghe  wrote:
>
>>
>>
>> On Tue, Nov 24, 2015 at 12:12 AM, Chamara Ariyarathne 
>> wrote:
>>
>>> Hi Milan. Thanks for the information. We will try this tomorrow. But our
>>> purpose is to replace this whole url with a configured host name.
>>>
>>> However Geeth, I think the EMM team having to introduce a new config to
>>> put the globally exposed server url deviates from the purpose of having
>>> HostName and MgtHostname properties in the carbon.xml..
>>>
>>
>> Chamara,
>> I think I disagree with on that point. I dont think carbon hostname or
>> mgt host name cannot be used for globally exposing the server url.  AFAIK
>> there is no place to put the port number in carbon.xml. There is no point
>> of having just a host name without the port number. The carbon.xml host
>> name will be the server ip address or the host name of the server which the
>> product is running as clearly mentioned in the document [1].
>>
>> As another reference, AFAIK in ESB, we use WSDLPrefix [2] in order to
>> change the address endpoint of generated wsdls to LB's address when ESB is
>> fronted by a LB.
>>
>> So I think introducing a new config to put the LB host name and port is
>> valid.
>>
>> [1] https://docs.wso2.com/display/Carbon440/Configuring+carbon.xml
>> [2] https://docs.wso2.com/display/ESB490/Setting+Up+Host+Names+and+Ports
>>
>> Thanks
>> Geeth
>>
>>>
>>> On Mon, Nov 23, 2015 at 9:58 PM, Milan Perera  wrote:
>>>
 Hi
 ​Chamara​
 ,

 Today we found out that even when the Host Names are configured in the
> carbonl.xml to be server's identified domain name, the QR code which is
> generated while device registration, uses the host ip address which is
> picked up from nowhere.
>
 ​
 Actually this IP is taking from the PAN. In my machine, if I dont set
 it manually from the carbon.xml to my wlan IP, it pics the pan1
 (10.7.200.1) and it breaks all the download links that are generated by the
 jaggery in most of the time.

 pan1  Link encap:Ethernet  HWaddr c2:1e:fe:3b:6a:6e
   inet addr:10.7.200.1  Bcast:10.7.200.255  Mask:255.255.255.0
   inet6 addr: fe80::c01e:feff:fe3b:6a6e/64 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
   TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
   collisions:0 txqueuelen:0
   RX bytes:0 (0.0 B)  TX bytes:28795 (28.7 KB)

 wlan0 Link encap:Ethernet  HWaddr 84:3a:4b:9b:cf:66
   inet addr:192.168.1.10  Bcast:192.168.1.255
 Mask:255.255.255.0
   inet6 addr: fe80::863a:4bff:fe9b:cf66/64
 Scope:Link
   UP BROADCAST RUNNING MULTICAST  MTU:1500
 Metric:1
   RX packets:207466 errors:0 dropped:0 overruns:0
 frame:0
   TX packets:41603 errors:0 dropped:0 overruns:0
 carrier:0
   collisions:0
 txqueuelen:1000

   RX bytes:209272568 (209.2 MB)  TX bytes:7936480 (7.9 MB) ​

 ​To overcome t​his, what I do is uncomment the  tag from the
 carbon.xml and set it to my wlan ip.
 https://192.168.1.10:
 ${carbon.management.port}${carbon.context}/services/

 ​Regards,​

 --
 *Milan Perera *| Software Engineer
 WSO2, Inc | lean. enterprise. middleware.
 #20, Palm Grove, Colombo 03, Sri Lanka
 Mobile: +94 77 309 7088 | Work: +94 11 214 5345
 Email: mi...@wso2.com  | Web: www.wso2.com
 

>>>
>>>
>>>
>>> --
>>> *Chamara Ariyarathne*
>>> Associate Technical Lead - QA
>>> WSO2 Inc; http://www.wso2.com/
>>> Mobile; *+94772786766 <%2B94772786766>*
>>>
>>
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> S.Uthaiyashankar
> VP Engineering
> WSO2 Inc.
> http://wso2.com/ - "lean . enterprise . middleware"
>
> Phone: +94 714897591
>
> ___
> 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] [BPS][DAS] Sorting feature and range faceting for the aggregated records

2015-11-23 Thread Gimantha Bandara
Hi Chathura,

In DAS 3.0.0, aggregation of bucketed range is not supported. But if the
aggregation is summation, we can use score-functions and use facet count
APIs to aggregate per range.

@Anjana, Shall we add this functionality as an improvement to DAS 3.0.1?

On Mon, Nov 23, 2015 at 1:46 AM, Chathura Ekanayake 
wrote:

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

 We're currently developing the dashboard for BPS statistics data and we
 encounter some problems mentioned below.

 1.) Does DAS already support a sorting feature to retrieve the
 aggregated data in the ascending order ?

 Why we need sorting feature here because let's say as an example,  if
 we are analyzing the involvement of different users in a particular
 process, we have to provide the process ID as the primary filter. There can
 be a large number of users in the system which could result in too many
 entries in the X axis. To overcome this, most graphs have to provide a
 secondary filter to obtain only top X or bottom X entries (asc or dsc
 ordering).

 When retrieving the records through the faceted search for the columns
 which have the aggregated values(eg: avg, sum, etc) from the DAS REST API,
 the data is usually listed in random order. As a solution for that, need to
 provide a mechanism in the DAS side to sort the records in the column such
 a way that they will be retrieved in a specific order so that it can be
 used to sort in ascending order, descending order according to the given
 column or multiple columns.

 eg: {
 "tableName": "USER_INVOLVE_SUMMARY_DATA",
 "groupByField": "processDefKey",
 "query": "assignee:admin",
 *"sort":"totalInvolvedTime asc"*,
 "aggregateFields": [
 {
 "fieldName": "duration",
 "aggregate": "SUM",
 "alias": "totalInvolvedTime"
 }
 ]
 }

 2.) Is it possible to do range faceting in DAS?

 (Here the range facet produces multiple range buckets over numeric
 fields or date fields.)
 Let's say as an example we have a field called *price* in one of the
 summarized tables and we have that field faceted. We want to get the facets
 as ranges of values (*eg:* *0-100, 100-500, 500-1000, etc* - these are
 the ranges that prices fall into). Is it possible to calculate the ranges
 (facet counts for the ranges of prices - eg: say for 5 values) based on the
 values in the table ?

 --
 Isuru Wijesinghe
 *Software Engineer*
 WSO2 inc : http://wso2.com
 lean.enterprise.middleware
 Mobile: 0710933706
 isur...@wso2.com

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


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


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


Re: [Dev] Revoked Access Token and Revoked Refresh Token returned back in token revoke endpoint response

2015-11-23 Thread Sanjeewa Malalgoda
On Tue, Nov 24, 2015 at 7:47 AM, Amila De Silva  wrote:

> Hi Sanjeewa,
>
> On Sunday, November 22, 2015, Sanjeewa Malalgoda 
> wrote:
>
>> In 1.10 we have commemted out cache clear handler in revoke api but it
>> was there in token API. So by default we will not use transport headers
>> coming from revoke request but use in token api. But i dont see any other
>> option if we need to clear cache in gateway.
>> @amila have we done something to clear cache without cache clear handler?
>>
> Nope, the only additional cache related method we introduced was
> getActiveTokensByConsumerKey which is used to clear Gateway Cache, when a
> change happens on the subscription.
>
> During one of the discussions we had when this requirement was brought up,
> one option discussed was calling
> APIAuthenticationService.invalidateCachedTokens from KeyManager. If
> KeyManager has a listener which gets called while tokens get revoked, then
> this operation can be called from that listener.
>
>> if not we have 2 options
>> 1. clear cache during request path of token revoke apis. Then we can
>> clear cache without relying on what happen in key manager side.
>> Disadvantage of this is we have to build message body in request path.
>>
> But still we won't be able to clear the cache when refresh token is used,
> right?
>
Yes refresh token would be a problem and we need to db call to fetch token
entries.
And i think now we don't need to iterate through cache as 2 layer caching
is implemented.

> 2.Have extension point in key manager to register call back for token
>> revoke events. Then we can implement code to call back to gateway.
>>
>> WDYT?
>>
>> Thanks
>> sanjeewa.
>>
>> sent from my phone
>> On Nov 23, 2015 12:38 AM, "Johann Nallathamby"  wrote:
>>
>>> APIM Team,
>>>
>>> Regarding [1], I know this was implemented as part of a requirement for
>>> API Manager. Does API Manager rely on this still ? Can we get rid of
>>> returning these tokens ? In the new versions of API Manager if you are
>>> supporting external key managers according to standards how are you going
>>> to interoperate if you relying on such custom headers ?
>>>
>>> [1] https://wso2.org/jira/browse/IDENTITY-4112
>>>
>>> --
>>> Thanks & Regards,
>>>
>>> *Johann Dilantha Nallathamby*
>>> Technical Lead & Product Lead of WSO2 Identity Server
>>> Governance Technologies Team
>>> WSO2, Inc.
>>> lean.enterprise.middleware
>>>
>>> Mobile - *+9476950*
>>> Blog - *http://nallaa.wordpress.com *
>>>
>>


-- 

*Sanjeewa Malalgoda*
WSO2 Inc.
Mobile : +94713068779

blog
:http://sanjeewamalalgoda.blogspot.com/

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


Re: [Dev] Revoked Access Token and Revoked Refresh Token returned back in token revoke endpoint response

2015-11-23 Thread Amila De Silva
Hi Sanjeewa,

On Sunday, November 22, 2015, Sanjeewa Malalgoda  wrote:

> In 1.10 we have commemted out cache clear handler in revoke api but it was
> there in token API. So by default we will not use transport headers coming
> from revoke request but use in token api. But i dont see any other option
> if we need to clear cache in gateway.
> @amila have we done something to clear cache without cache clear handler?
>
Nope, the only additional cache related method we introduced was
getActiveTokensByConsumerKey which is used to clear Gateway Cache, when a
change happens on the subscription.

During one of the discussions we had when this requirement was brought up,
one option discussed was calling
APIAuthenticationService.invalidateCachedTokens from KeyManager. If
KeyManager has a listener which gets called while tokens get revoked, then
this operation can be called from that listener.

> if not we have 2 options
> 1. clear cache during request path of token revoke apis. Then we can clear
> cache without relying on what happen in key manager side.
> Disadvantage of this is we have to build message body in request path.
>
But still we won't be able to clear the cache when refresh token is used,
right?

> 2.Have extension point in key manager to register call back for token
> revoke events. Then we can implement code to call back to gateway.
>
> WDYT?
>
> Thanks
> sanjeewa.
>
> sent from my phone
> On Nov 23, 2015 12:38 AM, "Johann Nallathamby"  wrote:
>
>> APIM Team,
>>
>> Regarding [1], I know this was implemented as part of a requirement for
>> API Manager. Does API Manager rely on this still ? Can we get rid of
>> returning these tokens ? In the new versions of API Manager if you are
>> supporting external key managers according to standards how are you going
>> to interoperate if you relying on such custom headers ?
>>
>> [1] https://wso2.org/jira/browse/IDENTITY-4112
>>
>> --
>> Thanks & Regards,
>>
>> *Johann Dilantha Nallathamby*
>> Technical Lead & Product Lead of WSO2 Identity Server
>> Governance Technologies Team
>> WSO2, Inc.
>> lean.enterprise.middleware
>>
>> Mobile - *+9476950*
>> Blog - *http://nallaa.wordpress.com *
>>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


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

2015-11-23 Thread Selvaratnam Uthaiyashankar
I agree with Chamara. We have a way to configure public hostname (HostName,
MgtHostName in carbon.xml) and port (proxy port in
tomcat/catalina-server.xml). This is what used in generating service
endpoints, WSDL URLs etc. when a server is fronted with LB. I don't see any
necessary for EMM to have a new configuration.

On Tue, Nov 24, 2015 at 12:41 AM, Geeth Munasinghe  wrote:

>
>
> On Tue, Nov 24, 2015 at 12:12 AM, Chamara Ariyarathne 
> wrote:
>
>> Hi Milan. Thanks for the information. We will try this tomorrow. But our
>> purpose is to replace this whole url with a configured host name.
>>
>> However Geeth, I think the EMM team having to introduce a new config to
>> put the globally exposed server url deviates from the purpose of having
>> HostName and MgtHostname properties in the carbon.xml..
>>
>
> Chamara,
> I think I disagree with on that point. I dont think carbon hostname or mgt
> host name cannot be used for globally exposing the server url.  AFAIK there
> is no place to put the port number in carbon.xml. There is no point of
> having just a host name without the port number. The carbon.xml host name
> will be the server ip address or the host name of the server which the
> product is running as clearly mentioned in the document [1].
>
> As another reference, AFAIK in ESB, we use WSDLPrefix [2] in order to
> change the address endpoint of generated wsdls to LB's address when ESB is
> fronted by a LB.
>
> So I think introducing a new config to put the LB host name and port is
> valid.
>
> [1] https://docs.wso2.com/display/Carbon440/Configuring+carbon.xml
> [2] https://docs.wso2.com/display/ESB490/Setting+Up+Host+Names+and+Ports
>
> Thanks
> Geeth
>
>>
>> On Mon, Nov 23, 2015 at 9:58 PM, Milan Perera  wrote:
>>
>>> Hi
>>> ​Chamara​
>>> ,
>>>
>>> Today we found out that even when the Host Names are configured in the
 carbonl.xml to be server's identified domain name, the QR code which is
 generated while device registration, uses the host ip address which is
 picked up from nowhere.

>>> ​
>>> Actually this IP is taking from the PAN. In my machine, if I dont set it
>>> manually from the carbon.xml to my wlan IP, it pics the pan1 (10.7.200.1)
>>> and it breaks all the download links that are generated by the jaggery in
>>> most of the time.
>>>
>>> pan1  Link encap:Ethernet  HWaddr c2:1e:fe:3b:6a:6e
>>>   inet addr:10.7.200.1  Bcast:10.7.200.255  Mask:255.255.255.0
>>>   inet6 addr: fe80::c01e:feff:fe3b:6a6e/64 Scope:Link
>>>   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>>>   RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>>>   TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
>>>   collisions:0 txqueuelen:0
>>>   RX bytes:0 (0.0 B)  TX bytes:28795 (28.7 KB)
>>>
>>> wlan0 Link encap:Ethernet  HWaddr 84:3a:4b:9b:cf:66
>>>   inet addr:192.168.1.10  Bcast:192.168.1.255
>>> Mask:255.255.255.0
>>>   inet6 addr: fe80::863a:4bff:fe9b:cf66/64
>>> Scope:Link
>>>   UP BROADCAST RUNNING MULTICAST  MTU:1500
>>> Metric:1
>>>   RX packets:207466 errors:0 dropped:0 overruns:0
>>> frame:0
>>>   TX packets:41603 errors:0 dropped:0 overruns:0
>>> carrier:0
>>>   collisions:0
>>> txqueuelen:1000
>>>
>>>   RX bytes:209272568 (209.2 MB)  TX bytes:7936480 (7.9 MB) ​
>>>
>>> ​To overcome t​his, what I do is uncomment the  tag from the
>>> carbon.xml and set it to my wlan ip.
>>> https://192.168.1.10:
>>> ${carbon.management.port}${carbon.context}/services/
>>>
>>> ​Regards,​
>>>
>>> --
>>> *Milan Perera *| Software Engineer
>>> WSO2, Inc | lean. enterprise. middleware.
>>> #20, Palm Grove, Colombo 03, Sri Lanka
>>> Mobile: +94 77 309 7088 | Work: +94 11 214 5345
>>> Email: mi...@wso2.com  | Web: www.wso2.com
>>> 
>>>
>>
>>
>>
>> --
>> *Chamara Ariyarathne*
>> Associate Technical Lead - QA
>> WSO2 Inc; http://www.wso2.com/
>> Mobile; *+94772786766 <%2B94772786766>*
>>
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
S.Uthaiyashankar
VP Engineering
WSO2 Inc.
http://wso2.com/ - "lean . enterprise . middleware"

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


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

2015-11-23 Thread Nuwan Dias
The error says "ssoEnabled" is not defined. Can you check if an old webapp
is being added to the runtime via dep-sync maybe?

Thanks,
NuwanD.

On Tue, Nov 24, 2015 at 12:33 PM, Malintha Adikari 
wrote:

> Hi,
>
> I am getting following error while trying to add comment to an API in
> store node in a distributed setup. I tried this in stadalone pack and this
> issue is not there. Is there any suspicious configuration which cause this
> error ?
>
> TID: [-1234] [] [2015-11-24 06:34:29,454] ERROR
> {org.jaggeryjs.jaggery.core.manager.WebAppManager} -
>  org.mozilla.javascript.EcmaError: ReferenceError: "ssoEnabled" is not
> defined. (/store/site/blocks/comment/comment-add/ajax/comment-add.jag#33)
> {org.jaggeryjs.jaggery.core.manager.WebAppManager}
> org.jaggeryjs.scriptengine.exceptions.ScriptException:
> org.mozilla.javascript.EcmaError: ReferenceError: "ssoEnabled" is not
> defined. (/store/site/blocks/comment/comment-add/ajax/comment-add.jag#33)
> at
> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:571)
> at org.jaggeryjs.scriptengine.engine.RhinoEngine.exec(RhinoEngine.java:273)
> at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.exec(WebAppManager.java:587)
> at
> org.jaggeryjs.jaggery.core.manager.WebAppManager.execute(WebAppManager.java:507)
> at org.jaggeryjs.jaggery.core.JaggeryServlet.doPost(JaggeryServlet.java:29)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
> at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
> at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:378)
> at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
> at org.jaggeryjs.jaggery.core.JaggeryFilter.doFilter(JaggeryFilter.java:21)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
> at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:99)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
> at
> org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:57)
> at
> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
> at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:62)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:159)
> at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
> at
> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:57)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
> at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
> at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
> at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
> 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)
> Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "ssoEnabled"
> is not defined.
> (/store/site/blocks/comment/comment-add/ajax/comment-add.jag#33)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687)
> at
> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665)
> at
> org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3750)
> at org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1728)
> at
> 

[Dev] [Automation] Add new users in Tests

2015-11-23 Thread Lakshani Gamage
Hi all,

I'm trying to write some tests for app manager and I want to login to store
with a non admin user. I updated automation.xml as below.






admin
admin




testuser1
testuser1pass








But when tests are running, it looks like "testuser1" is not available. It
gives following exceptions.

java.lang.Exception: Operation not successful: Invalid username or password.
at
org.wso2.appmanager.integration.utils.VerificationUtil.checkErrors(VerificationUtil.java:35)
at
org.wso2.appmanager.integration.utils.APPMStoreRestClient.login(APPMStoreRestClient.java:68)
at
org.wso2.appmanager.integration.test.cases.RatingTestCase.testWebAppRating(RatingTestCase.java:78)

Am I missing anything?

Thanks,
Lakshani
-- 
Lakshani Gamage

*Software Engineer*
Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


[Dev] WSO2 Committers += Thilini Cooray

2015-11-23 Thread Nuwan Dias
Hi,

It is with great pleasure we welcome Thilini Cooray as a WSO2 Committer. @
Thilini, congratulations and keep up the good work!

Thanks,
NuwanD.

-- 
Nuwan Dias

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


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

2015-11-23 Thread Geeth Munasinghe
What about the port?

On Monday, November 23, 2015, Chamara Ariyarathne  wrote:

> So Geeth, my argument is even if there is a url re-write in the load
> balancer, the carbon.xml HostName and MgtHostName value should be the
> domain name which is exposed to outside world,
>
> hence in your example: emm.wso2.com.
>
> Do you have a counter argument for this?
>
> On Mon, Nov 23, 2015 at 8:03 PM, Geeth Munasinghe  > wrote:
>
>> Hi Chamara
>>
>> For the first issue, as you and me had many offline discussions about it,
>> let me explain the reason again, why we moved the LB host name and LB port
>> to be taken from a different file (cdm-config.xml). This was required when
>> we send email to users to get their devices enrolled, we need to get the LB
>> host and port.
>>
>> When we configure the EMM servers, they will be in private network IPs.
>> And those EMM servers will be exposed to the out side through a load
>> balancer which will be on public IP. Normally load balancer will run on
>> default http and https ports which are either 80 or 443. But EMM servers
>> could run on any port (default 9443 and 9763). So when a load balancer
>> receives a request to either 80 or 443 ports, it will redirect them to EMM
>> server 9443 / 9763 ports.
>>
>> Another thing is load balancer could rewrite the urls, for example if the
>> load balancer host name and port is https://emm.wso2.com:443, then in LB
>> it can rewrite the urls to https://worker.mdm.com:9443.
>>
>> So AFAIK there is no configuration in carbon.xml where we can get the LB
>> host name and port.
>>
>> And for the second issue, It is a bug which we will fix in next alpha
>> release. But to fix this, I think the same rule applies. It cannot be taken
>> from carbon.xml because mgt host name does give any impression about the
>> load balancer url. So it should be taken from cdm-config.xml.
>>
>> Thanks
>> Geeth
>>
>>
>> *G. K. S. Munasinghe*
>> *Senior Software Engineer,*
>> *WSO2, Inc. http://wso2.com  *
>> *lean.enterprise.middleware.*
>>
>> email: ge...@wso2.com 
>> phone:(+94) 777911226
>>
>> On Mon, Nov 23, 2015 at 6:51 PM, Chamara Ariyarathne > > wrote:
>>
>>> We have a major design culprit with this situation now with the hostname
>>> not getting picked up from carbon.xml. First reported jira is this
>>> https://wso2.org/jira/browse/EMM-900
>>>
>>> Today we found out that even when the Host Names are configured in the
>>> carbonl.xml to be server's identified domain name, the QR code which is
>>> generated while device registration, uses the host ip address which is
>>> picked up from nowhere.
>>> https://wso2.org/jira/browse/EMM-987
>>>
>>> This issue will break the clustering scenarios where we need to define
>>> host names in carbon.xml but EMM not picking them up properly.
>>>
>>> On Tue, Nov 17, 2015 at 3:18 PM, Chamara Ariyarathne >> > wrote:
>>>
 Hi Azeez,

 Agree with that. However the precedence should be to use the HostName
 value in the carbon.xml which is ultimately the deployment's exposed host
 name, hence the constructed url in the email would be the correct access
 url from outside.

 My argument is, this url shouldn't be kept in some other configuration
 file repeatedly.

 Thanks.

 On Wed, Nov 11, 2015 at 7:04 PM, Afkham Azeez > wrote:

> This is for information purposes only. The mail says the URL we send
> to the users in the email contains local host. May be you can get the IP
> address/host from the incoming request and use that.
>
> On Wed, Nov 11, 2015 at 3:59 AM, Geeth Munasinghe  > wrote:
>
>> Hi Azeez,
>>
>> In case of URL rewrite by LB, can we handle that by the proxy
>> settings on catalina-server.xml ?
>>
>> Thanks
>> Geeth
>>
>>
>>
>>
>>
>>
>> *G. K. S. Munasinghe*
>> *Senior Software Engineer,*
>> *WSO2, Inc. http://wso2.com  *
>> *lean.enterprise.middleware.*
>>
>> email: ge...@wso2.com
>> 
>> phone:(+94) 777911226
>>
>> On Wed, Nov 11, 2015 at 2:10 PM, Afkham Azeez > > wrote:
>>
>>> proxy host name
>>>
>>> On Wed, Nov 11, 2015 at 12:28 AM, Chamara Ariyarathne <
>>> chama...@wso2.com
>>> > wrote:
>>>
 Hi All,

 When a new user is added to EMM, the user will be notified with an
 email to 

Re: [Dev] [Automation] Add new users in Tests

2015-11-23 Thread Lakshani Gamage
Thanks Irham. It works.

Regards,
Lakshani.

On Mon, Nov 23, 2015 at 9:38 PM, Irham Iqbal  wrote:

> Hi Lakshani,
>
> You need to this extension to populate user
> org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension.
>
> you will have the following inside extentionClasses under 
> platformExecutionManager
> as below.
>
> 
>
>   
>  
> org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension
>  
>  
>   
>   
>  
> org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension
>   
>
>
> For more information you can refer to this[1] as well.
>
> [1]
> https://github.com/wso2/product-apim/blob/master/modules/integration/tests-integration/tests-backend/src/test/resources/automation.xml
>
>
> Thanks,
> Iqbal
>
>
> On Mon, Nov 23, 2015 at 9:29 PM, Lakshani Gamage 
> wrote:
>
>> Hi all,
>>
>> I'm trying to write some tests for app manager and I want to login to
>> store with a non admin user. I updated automation.xml as below.
>>
>> 
>> 
>> 
>> 
>> 
>> admin
>> admin
>> 
>> 
>> 
>> 
>> testuser1
>> testuser1pass
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>
>> But when tests are running, it looks like "testuser1" is not available.
>> It gives following exceptions.
>>
>> java.lang.Exception: Operation not successful: Invalid username or
>> password.
>> at
>> org.wso2.appmanager.integration.utils.VerificationUtil.checkErrors(VerificationUtil.java:35)
>> at
>> org.wso2.appmanager.integration.utils.APPMStoreRestClient.login(APPMStoreRestClient.java:68)
>> at
>> org.wso2.appmanager.integration.test.cases.RatingTestCase.testWebAppRating(RatingTestCase.java:78)
>>
>> Am I missing anything?
>>
>> Thanks,
>> Lakshani
>> --
>> Lakshani Gamage
>>
>> *Software Engineer*
>> Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
>>
>
>
>
> --
> Irham Iqbal
> Software Engineer - Test Automation
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
> phone: +94 777888452
>



-- 
Lakshani Gamage

*Software Engineer*
Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


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

2015-11-23 Thread Milan Perera
Hi
​Chamara​
,

Today we found out that even when the Host Names are configured in the
> carbonl.xml to be server's identified domain name, the QR code which is
> generated while device registration, uses the host ip address which is
> picked up from nowhere.
>
​
Actually this IP is taking from the PAN. In my machine, if I dont set it
manually from the carbon.xml to my wlan IP, it pics the pan1 (10.7.200.1)
and it breaks all the download links that are generated by the jaggery in
most of the time.

pan1  Link encap:Ethernet  HWaddr c2:1e:fe:3b:6a:6e
  inet addr:10.7.200.1  Bcast:10.7.200.255  Mask:255.255.255.0
  inet6 addr: fe80::c01e:feff:fe3b:6a6e/64 Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:0 errors:0 dropped:0 overruns:0 frame:0
  TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
  collisions:0 txqueuelen:0
  RX bytes:0 (0.0 B)  TX bytes:28795 (28.7 KB)

wlan0 Link encap:Ethernet  HWaddr 84:3a:4b:9b:cf:66
  inet addr:192.168.1.10  Bcast:192.168.1.255
Mask:255.255.255.0
  inet6 addr: fe80::863a:4bff:fe9b:cf66/64
Scope:Link
  UP BROADCAST RUNNING MULTICAST  MTU:1500
Metric:1
  RX packets:207466 errors:0 dropped:0 overruns:0
frame:0
  TX packets:41603 errors:0 dropped:0 overruns:0
carrier:0
  collisions:0
txqueuelen:1000

  RX bytes:209272568 (209.2 MB)  TX bytes:7936480 (7.9 MB) ​

​To overcome t​his, what I do is uncomment the  tag from the
carbon.xml and set it to my wlan ip.
https://192.168.1.10:
${carbon.management.port}${carbon.context}/services/

​Regards,​

-- 
*Milan Perera *| Software Engineer
WSO2, Inc | lean. enterprise. middleware.
#20, Palm Grove, Colombo 03, Sri Lanka
Mobile: +94 77 309 7088 | Work: +94 11 214 5345
Email: mi...@wso2.com  | Web: www.wso2.com

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


Re: [Dev] Http Servlet forwarding issue

2015-11-23 Thread Harsha Thirimanna
I think, both samlsso and commonauth behave as separate web context.
If that is true then the tomcat by default block to access across the
context . to allow that we have to enable it in tomcat level. I don't think
we can do it in here.
AFAIK Only think you can do is redirecting.
On Nov 23, 2015 7:23 PM, "Godwin Shrimal"  wrote:

> Hi,
>
> I am trying to forward the servlet request from *samlsso* servlet to
> *commonauth* and getting following error in browser.
>
> *HTTP Status 405 - HTTP method GET is not supported by this URL*
>
> Note : Both servlets are registered from OSGI Service component and has
> implemented doGet and doPost methods in both servlets. Its working properly
> when we use *response.sendRedirect*.
>
> What can be the reason for this ?
>
> Thanks
> Godwin
>
>
> --
> *Godwin Amila Shrimal*
> Senior Software Engineer
> WSO2 Inc.; http://wso2.com
> lean.enterprise.middleware
>
> mobile: *+94772264165*
> linkedin: *http://lnkd.in/KUum6D *
> twitter: https://twitter.com/godwinamila
>
> ___
> 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


[Dev] [IS] Retrieve all permissions and actions of a user using admin services

2015-11-23 Thread Sajith Ariyarathna
Hi IS team,

Is it possible to do $subject? I have the username, domain and tenant ID of
the user.

Thanks.

-- 
Sajith Ariyarathna
Software Engineer; WSO2, Inc.;  http://wso2.com/
mobile: +94 77 6602284, +94 71 3951048
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] [Automation] Add new users in Tests

2015-11-23 Thread Hemika Kodikara
Hi Lakshani,

Can you check whether the user has enough permissions ? Like login and
etc.  This is just a hunch.

Regards,
Hemika

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

Mobile : +9477762

On Mon, Nov 23, 2015 at 10:59 AM, Lakshani Gamage  wrote:

> Hi all,
>
> I'm trying to write some tests for app manager and I want to login to
> store with a non admin user. I updated automation.xml as below.
>
> 
> 
> 
> 
> 
> admin
> admin
> 
> 
> 
> 
> testuser1
> testuser1pass
> 
> 
> 
> 
> 
> 
> 
>
> But when tests are running, it looks like "testuser1" is not available. It
> gives following exceptions.
>
> java.lang.Exception: Operation not successful: Invalid username or
> password.
> at
> org.wso2.appmanager.integration.utils.VerificationUtil.checkErrors(VerificationUtil.java:35)
> at
> org.wso2.appmanager.integration.utils.APPMStoreRestClient.login(APPMStoreRestClient.java:68)
> at
> org.wso2.appmanager.integration.test.cases.RatingTestCase.testWebAppRating(RatingTestCase.java:78)
>
> Am I missing anything?
>
> Thanks,
> Lakshani
> --
> Lakshani Gamage
>
> *Software Engineer*
> Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
>
> ___
> 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] [Automation] Add new users in Tests

2015-11-23 Thread Irham Iqbal
Hi Lakshani,

You need to this extension to populate user
org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension.

you will have the following inside extentionClasses under
platformExecutionManager
as below.


   
  
 
org.wso2.carbon.automation.extensions.servers.carbonserver.CarbonServerExtension
 
 
  
  
 
org.wso2.carbon.integration.common.extensions.usermgt.UserPopulateExtension
  
   

For more information you can refer to this[1] as well.

[1]
https://github.com/wso2/product-apim/blob/master/modules/integration/tests-integration/tests-backend/src/test/resources/automation.xml


Thanks,
Iqbal


On Mon, Nov 23, 2015 at 9:29 PM, Lakshani Gamage  wrote:

> Hi all,
>
> I'm trying to write some tests for app manager and I want to login to
> store with a non admin user. I updated automation.xml as below.
>
> 
> 
> 
> 
> 
> admin
> admin
> 
> 
> 
> 
> testuser1
> testuser1pass
> 
> 
> 
> 
> 
> 
> 
>
> But when tests are running, it looks like "testuser1" is not available. It
> gives following exceptions.
>
> java.lang.Exception: Operation not successful: Invalid username or
> password.
> at
> org.wso2.appmanager.integration.utils.VerificationUtil.checkErrors(VerificationUtil.java:35)
> at
> org.wso2.appmanager.integration.utils.APPMStoreRestClient.login(APPMStoreRestClient.java:68)
> at
> org.wso2.appmanager.integration.test.cases.RatingTestCase.testWebAppRating(RatingTestCase.java:78)
>
> Am I missing anything?
>
> Thanks,
> Lakshani
> --
> Lakshani Gamage
>
> *Software Engineer*
> Mobile : +94 (0) 71 5478184 <%2B94%20%280%29%20773%20451194>
>



-- 
Irham Iqbal
Software Engineer - Test Automation
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware
phone: +94 777888452
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev