Adding Thishan and Mohan. Hi Sabra,
I built product-cep and the carbon module has the address method. Thank You, Sameera On Fri, Feb 27, 2015 at 11:39 AM, Sabra Ossen <[email protected]> wrote: > Hi Sameera, > > Thank you for the clarification. Depending on a fix for this issue, I will > use an appropriate method to access the address of the server. > > Thanks. > > On Fri, Feb 27, 2015 at 11:30 AM, Sameera Medagammaddegedara < > [email protected]> wrote: > >> Hi Sabra, >> >> There could be an issue with the version of the carbon module used by CEP >> 4.0.0.The address method has not been removed from the carbon module and >> was added before 3.1.0 and has not been changed since. >> >> Thank You, >> Sameera >> >> On Thu, Feb 26, 2015 at 5:57 PM, Sabra Ossen <[email protected]> wrote: >> >>> Hi, >>> >>> I tried it. But it returns "https://null:9443" as the server address, I >>> have shown the code segment below. The host variable is null. >>> >>> var carbon = require('carbon'); >>> >>> var getAddress = function(transport){ >>> var process = require("process"), >>> host = process.getProperty('server.host'), >>> ip = process.getProperty('carbon.local.ip'); >>> var log = new Log(); >>> var port; >>> if(transport=="http"){ >>> port = process.getProperty('mgt.transport.http.proxyPort'); >>> if(!port){ >>> //can use http.port as well >>> port = process.getProperty('mgt.transport.http.port'); >>> } >>> }else if(transport=="https"){ >>> port = process.getProperty('mgt.transport.https.proxyPort'); >>> if(!port){ >>> //can use https.port as well >>> port = process.getProperty('mgt.transport.https.port'); >>> } >>> } >>> var postUrl; >>> if(host=="localhost"){ >>> postUrl = "https://" + ip + ":" + port; >>> }else{ >>> postUrl = "https://" + host+ ":" +port; >>> } >>> return postUrl; >>> } >>> >>> print(getAddress('https')); >>> print('<br>'); >>> print(carbon.server.tenantDomain()); >>> print('<br>'); >>> print(carbon.server.tenantId()); >>> print('<br>'); >>> print(carbon.server.tenantUser('admin')); >>> print('<br>'); >>> >>> >>> On Thu, Feb 26, 2015 at 5:39 PM, Inshaf Mahath <[email protected]> wrote: >>> >>>> Hi Sabra, >>>> >>>> You can try [1] sample to get the runtime server address. >>>> >>>> [1] - https://gist.github.com/dulichan/9577696 >>>> >>>> >>>> >>>> >>>> On Thu, Feb 26, 2015 at 5:33 PM, Sabra Ossen <[email protected]> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am getting the following error when trying to run the jaggery sample >>>>> [1] in WSO2 CEP 4.0.0. The mentioned sample runs fine in WSO2 CEP 3.1.0. >>>>> >>>>> [2015-02-26 17:18:52,580] ERROR - {WebAppManager} >>>>> org.mozilla.javascript.EcmaError: TypeError: Cannot find function address >>>>> in object [object Object]. (/Test//index.jag#12) >>>>> org.jaggeryjs.scriptengine.exceptions.ScriptException: >>>>> org.mozilla.javascript.EcmaError: TypeError: Cannot find function address >>>>> in object [object Object]. (/Test//index.jag#12) >>>>> 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.execute(WebAppManager.java:559) >>>>> at >>>>> org.jaggeryjs.jaggery.core.JaggeryServlet.doGet(JaggeryServlet.java:24) >>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) >>>>> 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:501) >>>>> at >>>>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) >>>>> at >>>>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) >>>>> at >>>>> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:183) >>>>> at >>>>> org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47) >>>>> at >>>>> org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56) >>>>> at >>>>> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47) >>>>> at >>>>> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:146) >>>>> 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:408) >>>>> at >>>>> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) >>>>> at >>>>> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) >>>>> at >>>>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1721) >>>>> at >>>>> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1679) >>>>> at >>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) >>>>> at >>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) >>>>> at java.lang.Thread.run(Thread.java:722) >>>>> Caused by: org.mozilla.javascript.EcmaError: TypeError: Cannot find >>>>> function address in object [object Object]. (/Test//index.jag#12) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3687) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3665) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3693) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3712) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3783) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2269) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2251) >>>>> at org.jaggeryjs.rhino.Test.c0._c_script_0(/Test//index.jag:12) >>>>> at org.jaggeryjs.rhino.Test.c0.call(/Test//index.jag) >>>>> at >>>>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394) >>>>> at >>>>> org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091) >>>>> at org.jaggeryjs.rhino.Test.c0.call(/Test//index.jag) >>>>> at org.jaggeryjs.rhino.Test.c0.exec(/Test//index.jag) >>>>> at >>>>> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567) >>>>> ... 36 more >>>>> >>>>> >>>>> When I checked the server.js file in the carbon modules in both the >>>>> CEP versions I noticed that the server.address function present in the >>>>> server,js file in CEP 3.1.0 has been removed from the server.js file in >>>>> CEP >>>>> 4.0.0. >>>>> >>>>> Is there any other way I could get the server address mentioned like >>>>> in the example. server.tenantDomain(), server.tenantId(), and >>>>> server.tenantUser('admin') works ok in CEP 4.0.0. >>>>> >>>>> Any clarification on this issue is appreciated. >>>>> >>>>> [1] http://jaggeryjs.org/documentation.jag?api=server2 >>>>> >>>>> Thanks. >>>>> -- >>>>> Sabra Ossen >>>>> *Software Engineering Intern* >>>>> Mobile : +94 (0) 785 227 769 >>>>> [email protected] >>>>> >>>>> _______________________________________________ >>>>> Dev mailing list >>>>> [email protected] >>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>>> >>>>> >>>> >>>> >>>> -- >>>> Inshaf Mahath >>>> WSO2 Inc. >>>> Lean . Enterprise . Middleware >>>> >>>> >>> >>> >>> -- >>> Sabra Ossen >>> *Software Engineering Intern* >>> Mobile : +94 (0) 785 227 769 >>> [email protected] >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Sameera Medagammaddegedara >> Software Engineer >> >> Contact: >> Email: [email protected] >> Mobile: + 94 077 255 3005 >> > > > > -- > Sabra Ossen > *Software Engineering Intern* > Mobile : +94 (0) 785 227 769 > [email protected] > -- Sameera Medagammaddegedara Software Engineer Contact: Email: [email protected] Mobile: + 94 077 255 3005
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
