Re: [Dev] FTP to local file transfer
Hi Aman, Please refer the following documentations [1] https://wso2.com/library/articles/2012/01/wso2-esb-example-file-exchanging-hub-part-1/ [2] https://docs.wso2.com/display/EI611/Configuring+File+Inbound+Protocol+for+FTP%2C+SFTP+and+FILE+Connections Thanks, Viduranga. On Mon, Jul 16, 2018 at 4:39 PM Aman Singh wrote: > Hi Team, > > I am trying to copya file from FTP server to local machine, below is my > code: - > > xmlns="http://ws.apache.org/ns/synapse;> > > > > {proxyhost name} > {proxyhost port} > {proxy username} > {proxy pass} > {ftpServerIP} > {ftpServerPort} > {ftpUsername} > {ftpPassword} > /home/subfolder/file.xml > > > ftp://admin:pass@localhost > /home/subfolder/file.xml > file:///D:/WSO2 testing files/Destination > folder File Connector > 10 > true > 10 > > > value="===FTP LOGGGER"/> > > > > > > > > > > > But I am getting the error saying "org.apache.axis2.AxisFault: The input > stream for an incoming message is null." > > Please help > > Thank you, > Aman > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Are Binary and Thrift protocols used in WSO2 API Manager, WSO2 Specific?
Hi Randy, As @Dushani Wellappili has mentioned, WSO2 API Manager mainly uses the *Thrift *and *WebService* protocols for communication. (Eg: Communication between Gateway and Key Manager in an API Manager distributed deployment). However, Thrift is not recommended to be used in a production environment, specifically when fronting a key manager cluster by a load balancer such as Nginx+. The reason for this is that most of the load balancers do not have session-awareness. Hence it is recommended to use *WSClient *intead of * Thrift.* *Thrift * is a service released as an open source Apache project and it was designed to compete with *SOAP * and *REST*. It was introduced with the intention of including - Scalability - Simplicity - Speed - Evolution Please find the below resources in addition to the ones stated by Dushani, [1] https://wso2.com/library/articles/2015/01/wso2-api-manager-deployment-customization-and-troubleshooting-part-02/ [2] https://nordicapis.com/microservice-showdown-rest-vs-soap-vs-apache-thrift-and-why-it-matters/ Thanks, Viduranga. On Thu, Jul 12, 2018 at 8:51 PM Dushani Wellappili wrote: > Hi Randy, > > WSO2 API Manager uses either Apache Thrift [1] [2] [3] which is a binary > communication protocol or Web Service calls for the communication between > gateway and key manager. The default communication protocol of key manager > is Thrift. You can find more information on that from here > <http://thrift.apache.org/static/files/thrift-20070401.pdf> as well. > > [1] https://en.wikipedia.org/wiki/Apache_Thrift > [2] https://thrift.apache.org/ > [3] https://github.com/apache/thrift > > > Regards, > > *Dushani Wellappili* > Software Engineer - WSO2 > > Email : dusha...@wso2.com > Mobile : +94779367571 > Web : https://wso2.com/ > > > > > On Thu, Jul 12, 2018 at 11:11 AM Randy Adams > wrote: > >> Hi devs, >> >> When reading through wso2 documentation I see that two protocols called >> 'Thrift' and 'Binary' are used for certain communication scenarios in API >> Manager. i.e. Throttle data publishing, Key Validation. [1] >> >> But I cannot see any outside external sources about these two protocols. >> So are these two protocols, just WSO2 Specific ( introduced by WSO2) ? If >> not, please provide references describing about these two protocols. >> >> [1] >> https://docs.wso2.com/display/AM210/Deploying+WSO2+API-M+in+a+Distributed+Setup#single-Key-Manager-GW >> >> -- >> Thanks & Regards, >> Randy >> ___ >> 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 > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] IAM: org.apache.rahas.TrustException while executing SSO with WS-Trust scenario
Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">admin>> Method="urn:oasis:names:tc:SAML:2.0:cm:bearer" >>> />>> NotOnOrAfter="2018-07-02T13:53:46.497Z"> >>> https://localhost:10443/services/echo>> Name="http://wso2.org/claims/emailaddress; NameFormat=" >>> http://wso2.org/claims/emailaddress;>http://www.w3.org/2001/XMLSchema-instance; xsi:type="xs:string"> >>> ad...@wso2.com>> Name="http://wso2.org/claims/givenname; NameFormat=" >>> http://wso2.org/claims/givenname;>http://www.w3.org/2001/XMLSchema-instance; >>> xsi:type="xs:string">admin>> AuthnInstant="2018-07-02T13:48:46.504Z">urn:oasis:names:tc:SAML:2.0:ac:classes:Password >>> Renewing 2.0 >>> org.apache.rahas.TrustException: Error in renewing token from : " >>> https://localhost:9443/services/wso2carbon-sts; >>> at org.apache.rahas.client.STSClient.renewToken(STSClient.java:386) >>> at org.wso2.carbon.identity.samples.sts.Client.run(Client.java:153) >>> at org.wso2.carbon.identity.samples.sts.Client.main(Client.java:94) >>> Caused by: org.apache.axis2.AxisFault: java.lang.NullPointerException >>> at org.apache.axis2.util.Utils.ge >>> tInboundFaultFromMessageContext(Utils.java:531) >>> at >>> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:375) >>> at >>> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421) >>> at >>> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229) >>> at >>> org.apache.axis2.client.OperationClient.execute(OperationClient.java:165) >>> at >>> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:555) >>> at org.apache.rahas.client.STSClient.renewToken(STSClient.java:378) >>> >>> >>> *Thanks & Best Regards!* >>> >>> *Achini Jayasena* >>> *Software Engineer - QA | WSO2* >>> >>> Email: achi...@wso2.com >>> Mobile: +943 882 897 >>> >>> [image: http://wso2.com/signature] <http://wso2.com/signature> >>> >> >> > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] XA in WSO2
Hi Robson, Could you please provide some more contextual information regarding the scenario that you are trying out. Meanwhile please refer the documentation[1] <https://docs.wso2.com/display/DSS351/Handling+Distributed+Transactions> [1] https://docs.wso2.com/display/DSS351/Handling+Distributed+Transactions Thanks, Viduranga. On Thu, Jul 12, 2018 at 12:20 AM Robson Duarte wrote: > > Hello good afternoon, > > How do I set up an external data source with XA in WSO2? I'm having > trouble, and I can not connect. > > Can anybody help me. > > > *Atenciosamente* > *Robson Duarte.* > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Lib directory in Stream Processor contains OSGI bundles
Hi Tharindu, Please find the comments inline. On Tue, Jun 19, 2018 at 6:33 PM Tharindu Malawaraarachchi < tharind...@wso2.com> wrote: > Hi all, > In Carbon 4 based wso2 products, there are 2 separate folders (dropins and > lib) to keep OSGI bundles and other non OSGI jars. But in wso2 stream > processor there is no dropins directory and the lib directory keeps OSGI > bundles. > Is it mandate to convert the non OSGI modules to OSGi with stream > processor? > WSO2 products run on an OSGi environment and it would be best to add as an OSGi bundle rather than a jar. However it is not mandatory. You can add jars also. Accoding to guide[1] you only need to add mysql-connector jars as it is to the lib folder. Also you can refer guide[2] to activate the osgi console and refer blog[3] to see how to debug the osgi bundles at runtime. > Or is there a way to add non OSGI jars [example- sql driver jars] to SP > > Thanks and Regards, > Tharindu > -- > *Tharindu Malawaraarachchi* > Software Engineer | WSO2 > > tharind...@wso2.com > +94 719340143 > https://www.linkedin.com/in/tharindun/ > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > [1] https://docs.wso2.com/display/SP400/Fully+Distributed+Deployment [2] https://docs.wso2.com/display/Carbon447/Product+Startup+Options [3] http://movingaheadblog.blogspot.com/2014/01/how-to-debug-wso2-carbon-products-using.html -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] How to read API properties in velocity template
Hi Sachithra, If I'm not mistaken, I don't think it is possible to add a comment in the template that will appear in the output. I myself tried several approaches but still didn't work. Might be able to add it programmatically. Also what would be the use case for having a comment in template output ? Thanks, Viduranga. On Wed, Jun 13, 2018 at 2:39 PM Sachithra Dangalla wrote: > Hi all, > > Continuing on a similar question, is there a way to add visible comments > in the output of the velocity template? [1] denotes only the comments in > the velocity template. > > [1] - http://velocity.apache.org/engine/1.7/vtl-reference.html#comments > > Thanks, > Regards, > > On Wed, Jun 13, 2018 at 12:45 PM Sachithra Dangalla > wrote: > >> Thanks Rajith. >> >> Regards, >> >> On Wed, Jun 13, 2018 at 11:39 AM Rajith Roshan wrote: >> >>> Hi >>> You can read the additional properties like in [1] >>> >>> [1] - $apiObj.additionalProperties.get('property_name') >>> >>> On Wed, Jun 13, 2018 at 10:47 AM Sachithra Dangalla >>> wrote: >>> >>>> Hi all, >>>> >>>> I'm trying to filter out handlers to be executed for an API based on a >>>> custom property which set during API publishing (when setting API >>>> properties in "Manage" section). In order to add a condition in the >>>> velocity template, I need to read the properties set for the API. Other >>>> variables could be read by using variables such as "$!apiVersion", >>>> "$isSoapToRestMode", "$resource.getUriTemplate()" etc. How can I read the >>>> list of properties from velocity template? >>>> >>>> Thanks, >>>> Regards, >>>> -- >>>> >>>> *Sachithra Dangalla* >>>> Software Engineer >>>> WSO2 Inc. http://wso2.com >>>> Blog: http://comexile.blogspot.com >>>> Mobile : +94 71 3700 656 >>>> ___ >>>> Dev mailing list >>>> Dev@wso2.org >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>> >>> >>> -- >>> Rajith Roshan >>> Senior Software Engineer, WSO2 Inc. >>> Mobile: +94-717-064-214 >>> >> >> >> -- >> >> *Sachithra Dangalla* >> Software Engineer >> WSO2 Inc. http://wso2.com >> Blog: http://comexile.blogspot.com >> Mobile : +94 71 3700 656 >> > > > -- > > *Sachithra Dangalla* > Software Engineer > WSO2 Inc. http://wso2.com > Blog: http://comexile.blogspot.com > Mobile : +94 71 3700 656 > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [APIM] axi2MessageContext variable returns null in keymgt component of APIM
Hi Dushani, Try changing the ThriftClient to WSClient in the *api-manager.xml* of the *KeyManager* node. Thanks, Viduranga. On Tue, Feb 20, 2018 at 3:10 PM, Dushani Wellappili <dusha...@wso2.com> wrote: > Hi all, > > I am using APIM 2.1.0 in a distributed deployment. I have enabled debug > logs for APIKeyValidationService class inside > org.wso2.carbon.apimgt.keymgt.service. > I need to log the response time taken for OAuth token response from > keyManager to gateway from line 259 [1]. > > But logMessages() method doesnt get invoked since the if condition [2] > before the method call fails as axis2MessageContext variable is null. > > Any thoughts on this ? > > > [1] https://github.com/wso2/carbon-apimgt/blob/6.x/ > components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/ > java/org/wso2/carbon/apimgt/keymgt/service/APIKeyValidationService.java# > L259 > > [2] https://github.com/wso2/carbon-apimgt/blob/6.x/ > components/apimgt/org.wso2.carbon.apimgt.keymgt/src/main/ > java/org/wso2/carbon/apimgt/keymgt/service/APIKeyValidationService.java# > L205 > > > > *Dushani Wellappili* > Software Engineer - WSO2 > > Email : dusha...@wso2.com > Mobile : +94779367571 <+94%2077%20936%207571> > Web : https://wso2.com/ > > > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/@vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Issues while using Store REST API
.catalina.core.ApplicationFilterChain.doFilter( > ApplicationFilterChain.java:208) > at org.apache.catalina.core.StandardWrapperValve.invoke( > StandardWrapperValve.java:218) > at org.apache.catalina.core.StandardContextValve.invoke( > StandardContextValve.java:122) > at org.apache.catalina.authenticator.AuthenticatorBase.invoke( > AuthenticatorBase.java:505) > at org.apache.catalina.core.StandardHostValve.invoke( > StandardHostValve.java:169) > 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.event.receiver.core.internal.tenantmgt. > TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:48) > 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.CarbonStuckThreadDetectionValv > e.invoke(CarbonStuckThreadDetectionValve.java:159) > at org.apache.catalina.valves.AccessLogValve.invoke( > AccessLogValve.java:958) > 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:452) > at org.apache.coyote.http11.AbstractHttp11Processor.process( > AbstractHttp11Processor.java:1087) > at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler. > process(AbstractProtocol.java:637) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor. > doRun(NioEndpoint.java:1756) > at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor. > run(NioEndpoint.java:1715) > at java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run( > TaskThread.java:61) > at java.lang.Thread.run(Thread.java:748) > > > Regards, > Sivaramya Sivanathan > Associate Software Engineer | WSO2 > Tel: 0770874960 > WSO2 Inc : http://wso2.org > <http://www.google.com/url?q=http%3A%2F%2Fwso2.org=D=1=AFQjCNE_eTDfyl2ibPcq0hcXvRDNVuQmMg> > LinkedIn | www.linkedin.com/in/sivaramya > -- Regards*,* *Viduranga Gunarathne* *Software Engineer* *WSO2 (Pvt) Ltd.* *Mobile : *+94712437484 *Email : *vidura...@wso2.com *Web : *http://wso2.com *Blog: *http://medium.com/@vlgunarathne <http://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [APIM] Error occurred while connecting to back end
; validation failed: java.security.cert.CertPathValidatorException: >>>>> timestamp check failed >>>>> at sun.security.validator.PKIXValidator.doValidate(PKIXValidato >>>>> r.java:352) >>>>> at sun.security.validator.PKIXValidator.engineValidate(PKIXVali >>>>> dator.java:260) >>>>> at sun.security.validator.Validator.validate(Validator.java:260) >>>>> at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustMana >>>>> gerImpl.java:324) >>>>> at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509Trust >>>>> ManagerImpl.java:229) >>>>> at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X50 >>>>> 9TrustManagerImpl.java:124) >>>>> at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHa >>>>> ndshaker.java:1496) >>>>> ... 89 more >>>>> Caused by: java.security.cert.CertPathValidatorException: timestamp >>>>> check failed >>>>> at sun.security.provider.certpath.PKIXMasterCertPathValidator.v >>>>> alidate(PKIXMasterCertPathValidator.java:135) >>>>> at sun.security.provider.certpath.PKIXCertPathValidator.validat >>>>> e(PKIXCertPathValidator.java:219) >>>>> at sun.security.provider.certpath.PKIXCertPathValidator.validat >>>>> e(PKIXCertPathValidator.java:140) >>>>> at sun.security.provider.certpath.PKIXCertPathValidator.engineV >>>>> alidate(PKIXCertPathValidator.java:79) >>>>> at java.security.cert.CertPathValidator.validate(CertPathValida >>>>> tor.java:292) >>>>> at sun.security.validator.PKIXValidator.doValidate(PKIXValidato >>>>> r.java:347) >>>>> ... 95 more >>>>> Caused by: java.security.cert.CertificateExpiredException: NotAfter: >>>>> Mon Jun 19 14:43:07 IST 2017 >>>>> at sun.security.x509.CertificateValidity.valid(CertificateValid >>>>> ity.java:274) >>>>> at sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:629) >>>>> at sun.security.provider.certpath.BasicChecker.verifyTimestamp( >>>>> BasicChecker.java:190) >>>>> at sun.security.provider.certpath.BasicChecker.check(BasicCheck >>>>> er.java:144) >>>>> at sun.security.provider.certpath.PKIXMasterCertPathValidator.v >>>>> alidate(PKIXMasterCertPathValidator.java:125) >>>>> ... 100 more >>>>> >>>>> >>>>> >>>>> Regards, >>>>> >>>>> *Senuwan Withana* >>>>> Software Engineer - Support Team | WSO2 >>>>> >>>>> Email : senu...@wso2.com >>>>> Mobile: 94773212853 >>>>> Web: http://www.wso2.com >>>>> >>>>> >>>>> >>>>> ___ >>>>> Dev mailing list >>>>> Dev@wso2.org >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> Thanks >>>> Abimaran Kugathasan >>>> Senior Software Engineer - API Technologies >>>> >>>> Email : abima...@wso2.com >>>> Mobile : +94 773922820 <+94%2077%20392%202820> >>>> >>>> <http://stackoverflow.com/users/515034> >>>> <http://lk.linkedin.com/in/abimaran> >>>> <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> >>>> <https://twitter.com/abimaran> >>>> >>>> >>> >>> ___ >>> Dev mailing list >>> Dev@wso2.org >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> *Godwin Amila Shrimal* >> Associate Technical Lead >> WSO2 Inc.; http://wso2.com >> lean.enterprise.middleware >> >> mobile: *+94772264165* >> linkedin: *https://www.linkedin.com/in/godwin-amila-2ba26844/ >> <https://www.linkedin.com/in/godwin-amila-2ba26844/>* >> twitter: https://twitter.com/godwinamila >> <http://wso2.com/signature> >> > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [APIM] [2.1.0] Read tenant registry config from jaggery
Hi, @Praminda and @Prasanna thank you for the tips. However when I tried accessing the registry in the following way the below mentioned errors occur. *Code:* var registry = carbon.server.osgiService('org.wso2.carbon.registry.core. service.RegistryService').getGovernanceUserRegistry(provider, tenantID); url = "/_system/config/apimgt/applicationdata/tenant-conf.json"; data = registry.get(url); *Error[1]:* org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.WrappedException: Wrapped org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException: Resource does not exist at path /_system/governance/_system/config/apimgt/applicationdata/tenant-conf.json (/store/site/blocks/api/api-info/block.jag#53) I noticed that the "tenant-conf.json" is in the config registry, instead of the governance registry. Therefore I changed the *.getGovernanceUserRegistry(provider, tenantID) to .getConfigSystemRegistry(tenantId) *but then the following error[2] occurs *Error[2]:* org.jaggeryjs.scriptengine.exceptions.ScriptException: org.mozilla.javascript.EvaluatorException: Can't find method org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService.getConfigSystemRegistry(org.mozilla.javascript.Undefined). (/store/site/blocks/api/api-info/block.jag#41) Help on this is highly appreciated! Thanks, Viduranga. On Thu, Dec 7, 2017 at 11:24 AM, Prasanna Dangalla <prasa...@wso2.com> wrote: > HI Viduranga, > > You can get the content in a registry resource as follows, > > Object content = resource.getContent(); > String jsonContent = RegistryUtils.decodeBytes((byte[]) content); > > This will retourn the You have to get the resource from the tenant > registry you need. > > [1] - https://github.com/wso2/carbon-governance-extensions/blob/ > master/components/governance-extensions/org.wso2.carbon. > governance.platform.extensions/src/org/wso2/carbon/governance/platform/ > extensions/util/Utils.java#L42 > [2] - https://github.com/wso2/carbon-kernel/blob/4.4.x/core/ > org.wso2.carbon.registry.core/src/main/java/org/wso2/carbon/ > registry/core/utils/RegistryUtils.java#L1952 > <https://github.com/wso2/carbon-governance-extensions/blob/master/components/governance-extensions/org.wso2.carbon.governance.platform.extensions/src/org/wso2/carbon/governance/platform/extensions/util/Utils.java#L42> > > Thanks > > *Prasanna Dangalla* > Senior Software Engineer, WSO2, Inc.; http://wso2.com/ > lean.enterprise.middleware > > > *cell: +94 718 11 27 51* > *twitter: @prasa77* > > On Thu, Dec 7, 2017 at 11:03 AM, Viduranga Gunarathne <vidura...@wso2.com> > wrote: > >> Hi Irham, Mushthaq >> >> @Mushthaq, thanks for the prompt reply. I will look into it. >> >> >> On Thu, Dec 7, 2017 at 10:57 AM, Irham Iqbal <iq...@wso2.com> wrote: >> >>> Hi Viduranga, >>> >>> What exactly you're trying to do ? >>> I mean are you trying to directly read the files from Jaggery or trying >>> to access the registry resources by using admin service from Jaggery ? >>> >>> I need to read the configuration from the registry. This config can be >> different from one tenant to another. So the value that should be displayed >> in the Store UI should change based on the tenant who has published the API. >> >> >>> Thanks, >>> Iqbal >>> >>> On Thu, Dec 7, 2017 at 10:48 AM, Viduranga Gunarathne < >>> vidura...@wso2.com> wrote: >>> >>>> Hi, >>>> >>>> I'm working on APIM 2.1.0 and I need to read a configuration in the >>>> tenant registry that is specific to each tenant, from the jaggery layer so >>>> that it can be displayed in the Store UI. >>>> >>>> Any tips on how to do this? >>>> >>>> Also, The media type of the "tenant-conf" is json and can that be >>>> accessed as a json object or is it returned as a resource and we have to >>>> convert it to a json object at the jaggery level ? >>>> >>>> Thanks in advance! >>>> Viduranga. >>>> -- >>>> Regards, >>>> >>>> *Viduranga Gunarathne* >>>> >>>> *Software Engineer Intern* >>>> >>>> >>>> *WSO2* >>>> Email : vidura...@wso2.com >>>> Mobile : +94712437484 <+94%2071%20243%207484> >>>> Web : http://wso2.com >>>> [image: https://wso2.com/signature] <https://wso2.com/signature> >>>> >>>> _______ >>>> Dev mailing list >>>> Dev@wso2.org >>>> http://wso2.o
Re: [Dev] [APIM] [2.1.0] Read tenant registry config from jaggery
Hi Irham, Mushthaq @Mushthaq, thanks for the prompt reply. I will look into it. On Thu, Dec 7, 2017 at 10:57 AM, Irham Iqbal <iq...@wso2.com> wrote: > Hi Viduranga, > > What exactly you're trying to do ? > I mean are you trying to directly read the files from Jaggery or trying to > access the registry resources by using admin service from Jaggery ? > > I need to read the configuration from the registry. This config can be different from one tenant to another. So the value that should be displayed in the Store UI should change based on the tenant who has published the API. > Thanks, > Iqbal > > On Thu, Dec 7, 2017 at 10:48 AM, Viduranga Gunarathne <vidura...@wso2.com> > wrote: > >> Hi, >> >> I'm working on APIM 2.1.0 and I need to read a configuration in the >> tenant registry that is specific to each tenant, from the jaggery layer so >> that it can be displayed in the Store UI. >> >> Any tips on how to do this? >> >> Also, The media type of the "tenant-conf" is json and can that be >> accessed as a json object or is it returned as a resource and we have to >> convert it to a json object at the jaggery level ? >> >> Thanks in advance! >> Viduranga. >> -- >> Regards, >> >> *Viduranga Gunarathne* >> >> *Software Engineer Intern* >> >> >> *WSO2* >> Email : vidura...@wso2.com >> Mobile : +94712437484 <+94%2071%20243%207484> >> Web : http://wso2.com >> [image: https://wso2.com/signature] <https://wso2.com/signature> >> >> _______ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Irham Iqbal > Software Engineer > WSO2 > phone: +94 777888452 > <http://wso2.com/signature> > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] [APIM] [2.1.0] Read tenant registry config from jaggery
Hi, I'm working on APIM 2.1.0 and I need to read a configuration in the tenant registry that is specific to each tenant, from the jaggery layer so that it can be displayed in the Store UI. Any tips on how to do this? Also, The media type of the "tenant-conf" is json and can that be accessed as a json object or is it returned as a resource and we have to convert it to a json object at the jaggery level ? Thanks in advance! Viduranga. -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] How to set ThriftClientPort in APIM Gate Way Node in a cluster setup
Hi Dushantha, Yes. If you are using port offset to deploy the Gateway and KeyManager nodes, then the default Thrift port (10397) in both the nodes will get offset by the specified offset value. Eg: Gateway offset = 2, Then will be 10399 KeyManager offset = 3, Then will be 10400 In a clustered deployment, the KeyManager acts as the Thrift Server and the Gateway as the Thrift client. Hence the Gateway uses the to send a request to the KeyManager where the request is handled at the . For the communication to happen, both the port values (ThriftServerPort in KeyManager and ThriftClientPort in Gateway) should be of the same value. Unless the port offset of both the Gateway and the KeyManager is the same, you will have to manually set the two values. Thanks, Viduranga. On Thu, Nov 23, 2017 at 9:24 PM, Chamara Silva <cham...@wso2.com> wrote: > This already in the public documentation. Please refer "Changing the > Thrift client and server ports" section. > > > [2] https://docs.wso2.com/display/AM210/Changing+the+ > Default+Ports+with+Offset > > Thanks, > Chamara Silva > > On Thu, Nov 23, 2017 at 7:57 PM, Dushantha Batuwita <dushan...@wso2.com> > wrote: > >> Hi >> I'm involved in a gateway cluster set up in the local machine where the >> architecture is explained as follows >> >>1. IS 5.3.0 as KM offset 0 >>2. Publisher/store/TM offset 1 >>3. Gateway worker offset 3 >>4. GatewayWorkerManger offset 2 >> >> I'm following the [1] Clustering API Manager document where it explains >> Configuring the Gateway > Configure key management related communication. >> > c. Specify the ThriftClientPort and ThriftServerPort values. 10397 is >> the default. >> 10397 >> 10397 >> My query is should this port values be incremented according to the given >> offset values >> >> >> [1] https://docs.wso2.com/display/CLUSTER44x/Clustering+API+ >> Manager+2.0.0#b099f11ea91344af8835595ac455a7c1 >> >> >> many thanks >> -- >> *Dushantha Nayanajith Chandima Batuwita* >> Software Engineer Support | WSO2 >> dushan...@wso2.com >> mobile : 0094777453010 <077%20745%203010> >> > > > > -- > Suminda Chamara Silva > Technical Lead > WSO2 Inc. > Mobile: +94718302858 <+94%2071%20830%202858> > blog: http://chamaras.blogspot.com > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Invoking an API through Android Application
;> ... 20 more >> >> Any thoughts on what should be done to invoke API created through the >> Android Application. And any comments are appreciated on what has gone >> wrong here in step 4. >> >> >> *Thanks and Best Regards,* >> >> *Isuru Uyanage* >> *Software Engineer - QA | WSO2* >> *Mobile : **+94 77 <+94%2077%20767%201807> 55 30752* >> *LinkedIn: **https://www.linkedin.com/in/isuru-uyanage/ >> <https://www.linkedin.com/in/isuru-uyanage/>* >> >> >> >> >> ___ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Thanks > Abimaran Kugathasan > Senior Software Engineer - API Technologies > > Email : abima...@wso2.com > Mobile : +94 773922820 <+94%2077%20392%202820> > > <http://stackoverflow.com/users/515034> > <http://lk.linkedin.com/in/abimaran> > <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> > <https://twitter.com/abimaran> > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Invoking an API through Android Application
xecute(MavenCli.java:993) >>> >>> at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345) >>> >>> at org.apache.maven.cli.MavenCli.main(MavenCli.java:191) >>> >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >>> >>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce >>> ssorImpl.java:62) >>> >>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe >>> thodAccessorImpl.java:43) >>> >>> at java.lang.reflect.Method.invoke(Method.java:498) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnha >>> nced(Launcher.java:289) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Lau >>> ncher.java:229) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithEx >>> itCode(Launcher.java:415) >>> >>> at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launc >>> her.java:356) >>> >>> Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: >>> Compilation failure >>> >>> at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execut >>> e(AbstractCompilerMojo.java:972) >>> >>> at org.apache.maven.plugin.compiler.CompilerMojo.execute(Compil >>> erMojo.java:129) >>> >>> at org.apache.maven.plugin.DefaultBuildPluginManager.executeMoj >>> o(DefaultBuildPluginManager.java:134) >>> >>> at org.apache.maven.lifecycle.internal.MojoExecutor.execute(Moj >>> oExecutor.java:208) >>> >>> ... 20 more >>> >>> Any thoughts on what should be done to invoke API created through the >>> Android Application. And any comments are appreciated on what has gone >>> wrong here in step 4. >>> >>> >>> *Thanks and Best Regards,* >>> >>> *Isuru Uyanage* >>> *Software Engineer - QA | WSO2* >>> *Mobile : **+94 77 <+94%2077%20767%201807> 55 30752* >>> *LinkedIn: **https://www.linkedin.com/in/isuru-uyanage/ >>> <https://www.linkedin.com/in/isuru-uyanage/>* >>> >>> >>> >>> >>> ___ >>> Dev mailing list >>> Dev@wso2.org >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Thanks >> Abimaran Kugathasan >> Senior Software Engineer - API Technologies >> >> Email : abima...@wso2.com >> Mobile : +94 773922820 <+94%2077%20392%202820> >> >> <http://stackoverflow.com/users/515034> >> <http://lk.linkedin.com/in/abimaran> >> <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> >> <https://twitter.com/abimaran> >> >> >> ___ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > > *Krishan Wijesena* > Software Engineer | WSO2 > > Email : krish...@wso2.com > Mobile : +94776219923 <+94%2077%20621%209923> > WSO2 Inc : http://wso2.com > [image: http://wso2.com/signature] <http://wso2.com/signature> > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Invoking an API through Android Application
t; > *Thanks and Best Regards,* > > *Isuru Uyanage* > *Software Engineer - QA | WSO2* > *Mobile : **+94 77 <+94%2077%20767%201807> 55 30752* > *LinkedIn: **https://www.linkedin.com/in/isuru-uyanage/ > <https://www.linkedin.com/in/isuru-uyanage/>* > > > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Establishing SSL connection without server's identity verification is not recommended warning when apim and the IS+KM set up is started up
Hi, I too got the same warning when setting up a distributed deployment of APIM 2.1.0. The work around was as follows: 1) If you are running the API Manager nodes and the MySQL DB in the same machine, - Follow the guide[1] to create a new keystore to the server where the nodes are running. (Name the keystore as wso2carbon.jks and use password "wso2carbon" so that you do not need to change any configurations in the APIM) - Then export the public key from of the newly created keystore and then import it to the "client-truststore.jks" file that can be found in "/repository/resources/security" - Replace the "wso2carbon.jks" in the same directory with the newly created "wso2carbon.jks" keystore. 2) If you are running APIM and MySQL in two separate servers, then you will have to follow the above steps for both servers and also import the public key of one server to the client-truststore.jks of the other and vice-versa. For more information on keytool, please follow [2] [1] https://docs.wso2.com/display/ADMIN44x/Creating+New+Keystores#CreatingNewKeystores-Creatingakeystoreusinganewcertificate [2] https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html Hope this helps. Thanks, Viduranga. On Thu, Nov 16, 2017 at 11:31 PM, Maneesha Wijesekara <manee...@wso2.com> wrote: > Hi Dushantha, > > In addition to Sashika's suggestion, you can omit this warning by using > ssl while disabling server certificate verification to establish the > connection. > > jdbc:mysql://localhost:3306/carbon_db > *?verifyServerCertificate=false=true* > > Regards > Maneesha > > On Thu, Nov 16, 2017 at 10:24 PM, Sashika Wijesinghe <sash...@wso2.com> > wrote: > >> Hi Dushantha, >> >> As defined in the warning message, you should be able to get rid of this >> by disabling JDBC trying to connect to DB over SSL by configuring the JDBC >> String as below. >> >> jdbc:mysql://localhost:3306/carbon_db?autoReconnect=true >> *useSSL=false* >> >> Regards, >> Sashika >> >> On Thu, Nov 16, 2017 at 7:32 PM, Dushantha Batuwita <dushan...@wso2.com> >> wrote: >> >>> Hi Dev; >>> >>> I'm involved in setting up a cluster in local machine with port offset. >>> For the time being, consider the setup is consisted of APIM 2.1.0 and IS as >>> KM 5.3.0 >>> I have followed the [1] Configuring WSO2 Identity Server as a Key >>> Manager document. >>> >>> I have set up MySQL databases as it has been described in the document >>> (e.g. WSO2UM_DB, WSO2REG_DB, WSO2AM_DB) >>> and configured those in the /repository >>> /conf/datasources/master-datasources.xml >>> >>> Both nodes have been lifted without error. >>> >>> My question is >>> >>> When the APIM starts up a warning is shown as bellow. Please let me know >>> how to avoid the said warning. >>> >>> Establishing SSL connection without server's identity verification is >>> not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ >>> requirements SSL connection must be established by default if explicit >>> option isn't set. For compliance with existing applications not using SSL >>> the verifyServerCertificate property is set to 'false'. You need either to >>> explicitly disable SSL by setting useSSL=false, or set useSSL=true and >>> provide truststore for server certificate verification. >>> >>> many thanks >>> -- >>> *Dushantha Nayanajith Chandima Batuwita* >>> Software Engineer Support | WSO2 >>> dushan...@wso2.com >>> mobile : 0094777453010 >>> >>> ___ >>> Dev mailing list >>> Dev@wso2.org >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> >> *Sashika WijesingheSoftware Engineer - QA Team* >> Mobile : +94 (0) 774537487 >> sash...@wso2.com >> >> ___ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Maneesha Wijesekara > Software Engineer - QA Team > WSO2 Inc. > > Email: manee...@wso2.com > Linkedin: http://linkedin.com/in/maneeshawijesekara > Mobile: +94712443119 > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] Code formatting for swagger2MSF4J
Hi, This java code formatter[1] from Google can be used to programmatically format java code. But this plugin re-formats the code in accordance to the Google Java Style[2] [1] https://github.com/google/google-java-format [2] https://google.github.io/styleguide/javaguide.html Thanks, Viduranga. On Tue, Nov 14, 2017 at 9:13 AM, Inosh Perera <ino...@wso2.com> wrote: > Hi Sanjeewa, > > Noted. Thanks. > > On Tue, Nov 14, 2017 at 8:44 AM, Sanjeewa Malalgoda <sanje...@wso2.com> > wrote: > >> Yes agree with abimaran. Since this same code runs on swagger online >> editor and this use as generic tool i think we do not need to add licence >> headers. >> Class, method name constructing logic followed standard swagger way of >> generating code. However you might need to add licence before you commit >> code. >> >> Thanks, >> sanjeewa. >> >> On Tue, Nov 14, 2017 at 8:18 AM, Inosh Perera <ino...@wso2.com> wrote: >> >>> Hi Abimaran, >>> >>> Understood. Thanks for the clarification. >>> >>> Regards, >>> Inosh >>> >>> On Mon, Nov 13, 2017 at 5:36 PM, Abimaran Kugathasan <abima...@wso2.com> >>> wrote: >>> >>>> Hi Inosh, >>>> >>>> On Mon, Nov 13, 2017 at 2:27 PM, Inosh Perera <ino...@wso2.com> wrote: >>>> >>>>> Hi All, >>>>> >>>>> I'm writing device type APIs for IoT server and I have written a yaml >>>>> that I'm trying to convert[1] to MSF4J. When checking the generated code, >>>>> it looks bit messy and there is no proper formatting or license headers in >>>>> the generated code. Is there a way to do this with io.swagger.codegen or >>>>> is >>>>> it done manually? >>>>> >>>> >>>> Normally we don't format the code or license header for the generated >>>> code. License can be added through mustache files. But, this code gen don't >>>> have the capability to auto format the code as class names, parameters >>>> names are depends on your API swagger file parameters. It's hard to format. >>>> >>>> Also, since this gen directory is replace each time you generate the >>>> code, we don't do anything manually there. But, functionality should work. >>>> >>>> [1]: https://github.com/sanjeewa-malalgoda/swagger2MSF4J/tre >>>> e/master/src/main/resources/MSF4J >>>> >>>>> >>>>> [1]. https://github.com/sanjeewa-malalgoda/swagger2MSF4J >>>>> >>>>> Regards, >>>>> Inosh >>>>> >>>>> -- >>>>> Inosh Perera >>>>> Senior Software Engineer, WSO2 Inc. >>>>> Tel: 077813 7285, 0785293686 <078%20529%203686> >>>>> >>>>> ___ >>>>> Dev mailing list >>>>> Dev@wso2.org >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> Thanks >>>> Abimaran Kugathasan >>>> Senior Software Engineer - API Technologies >>>> >>>> Email : abima...@wso2.com >>>> Mobile : +94 773922820 <+94%2077%20392%202820> >>>> >>>> <http://stackoverflow.com/users/515034> >>>> <http://lk.linkedin.com/in/abimaran> >>>> <http://www.lkabimaran.blogspot.com/> <https://github.com/abimarank> >>>> <https://twitter.com/abimaran> >>>> >>>> >>> >>> >>> -- >>> Inosh Perera >>> Senior Software Engineer, WSO2 Inc. >>> Tel: 077813 7285, 0785293686 <078%20529%203686> >>> >> >> >> >> -- >> >> *Sanjeewa Malalgoda* >> WSO2 Inc. >> Mobile : +94713068779 <+94%2071%20306%208779> >> >> <http://sanjeewamalalgoda.blogspot.com/>blog >> :http://sanjeewamalalgoda.blogspot.com/ >> <http://sanjeewamalalgoda.blogspot.com/> >> >> >> > > > -- > Inosh Perera > Senior Software Engineer, WSO2 Inc. > Tel: 077813 7285, 0785293686 > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] MSF4J (v2.4.1) Metrics sample throws NPE
Hi, I too encountered the same issue, when I used the following code as stated in the sample[1]: public static void main(String[] args) { new MicroservicesRunner() .addInterceptor(new MetricsInterceptor()) .deploy(new HelloService()) .deploy(new DemoService()) .start(); } It seems the "addInterceptor()" method is deprecated. The workaround to this was as follows: *No need to pass an instance of "MetricsInterceptor" public static void main(String[] args) { new MicroservicesRunner() .addGlobalRequestInterceptor() .addGlobalResponseInterceptor() .deploy(new HelloService()) .deploy(new DemoService()) .start(); } This worked out for me. Hope this helps! [1] https://github.com/wso2/msf4j/tree/master/samples/metrics Thanks, Viduranga. On Thu, Oct 26, 2017 at 9:40 AM, Chanaka Fernando <chana...@wso2.com> wrote: > Hi Devs, > > When I try to run metrics sample[1] in MSF4J, I'm getting the below NPE > during the invocation of the service. > > [msf4j.executor.workerpool-1] INFO org.wso2.msf4j.analytics.metrics.Metrics > - Initializing Metrics Services > [msf4j.executor.workerpool-1] ERROR > org.wso2.msf4j.analytics.metrics.MetricsInterceptor > - Exception while executing request interceptor class > org.wso2.msf4j.analytics.metrics.MetricsInterceptor > java.lang.NullPointerException > at org.wso2.carbon.metrics.core.Metrics.(Metrics.java:78) > at org.wso2.msf4j.analytics.metrics.Metrics.initializeServices(Metrics. > java:62) > at org.wso2.msf4j.analytics.metrics.Metrics.getMetricService(Metrics.java: > 83) > at org.wso2.msf4j.analytics.metrics.MetricsInterceptor. > preCall(MetricsInterceptor.java:96) > at org.wso2.msf4j.Interceptor.interceptRequest(Interceptor.java:65) > at org.wso2.msf4j.interceptor.InterceptorExecutor. > executeRequestInterceptor(InterceptorExecutor.java:321) > at org.wso2.msf4j.interceptor.InterceptorExecutor. > executeGlobalRequestInterceptors(InterceptorExecutor.java:206) > at org.wso2.msf4j.interceptor.InterceptorExecutor. > executeGlobalRequestInterceptors(InterceptorExecutor.java:52) > at org.wso2.msf4j.internal.router.HttpMethodInfo. > invokeResource(HttpMethodInfo.java:179) > at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke( > HttpMethodInfo.java:143) > at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod( > MSF4JMessageProcessor.java:248) > at org.wso2.msf4j.internal.MSF4JMessageProcessor.lambda$receive$0( > MSF4JMessageProcessor.java:160) > at java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > at java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > > Did anyone encounter such an issue? > > [1] https://github.com/wso2/msf4j/tree/master/samples/metrics > > Thanks, > Chanaka > -- > Thank you and Best Regards, > Chanaka Fernando > Senior Technical Lead > m: +94 773337238 <+94%2077%20333%207238> > https://wso2.com <https://wso2.com/signature> > > > > > > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] Multiple scopes for REST resources in APIM Store and Publisher
Hi, With the existing implementation in the store and publisher yaml, there is only a single scope provided in the security for resources as shown in Image #1. But other swagger definitions tend to have multiple scopes for a single resource as shown in Image #2. Currently there is no requirement in API Manager to support for multiple scopes but I was wondering if there would be a requirement to cater to multiple scopes in future ? Image #1: (store-api.yaml in API Manager) --- === Image #2: (Petstore swagger in http://petstore.swagger.io/) === Thanks, Viduranga. -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] REST API resource name
Hi everyone, I'm implementing a REST API endpoint to retrieve a list of programming language names (java, python, android, ...) which are the supported languages for swagger-codegen, in generating SDKs for APIs in WSO2 API Manager Store. The resource name I came up with is *"basePath/sdkgenlanguages"* Appreciate suggestions on this! Thanks in advance. -- Regards, *Viduranga Gunarathne* *Software Engineer Intern* *WSO2* Email : vidura...@wso2.com Mobile : +94712437484 Web : http://wso2.com [image: https://wso2.com/signature] <https://wso2.com/signature> ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev