Hi,

It seems like this issue is due to corrupted m2 artifacts in my local m2
repo. This issue was fixed after removing appmgt artifacts from local m2
repo.

Thanks,

Harshan Liyanage
Software Engineer
Mobile: *+94724423048*
Email: [email protected]
Blog : http://harshanliyanage.blogspot.com/
*WSO2, Inc. :** wso2.com <http://wso2.com/>*
lean.enterprise.middleware.

On Wed, Jan 27, 2016 at 2:42 PM, Ruwan Abeykoon <[email protected]> wrote:

> Hi Harshan,
> looks like a bug. We will look and find a solution soon.
> Cheers,
> Ruwan
>
> On Wed, Jan 27, 2016 at 1:05 PM, Harshan Liyanage <[email protected]>
> wrote:
>
>> Hi,
>>
>> I'm getting the following exception when try to add a mobile app using
>> the publisher console.
>>
>> [2016-01-27 12:48:27,494] ERROR {JAGGERY.apis.v1.asset_api_router:jag} -
>>  org.mozilla.javascript.EcmaError: TypeError: Cannot find function trim in
>> object 1.0,2.5.0.
>> (/publisher/modules/ext/scripts/validations/mandatory.field.validator.js#89)
>> 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.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:83)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.scripts.validations.c1._c_handleField_5(/publisher/modules/ext/scripts/validations/mandatory.field.validator.js:89)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.scripts.validations.c1.call(/publisher/modules/ext/scripts/validations/mandatory.field.validator.js)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.scripts.validations.c1._c_handleTable_4(/publisher/modules/ext/scripts/validations/mandatory.field.validator.js:59)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.scripts.validations.c1.call(/publisher/modules/ext/scripts/validations/mandatory.field.validator.js)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.scripts.validations.c1._c_execute_3(/publisher/modules/ext/scripts/validations/mandatory.field.validator.js:39)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.scripts.validations.c1.call(/publisher/modules/ext/scripts/validations/mandatory.field.validator.js)
>> at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>> at
>> org.jaggeryjs.rhino.publisher.modules.validations.c0._c_anonymous_5(/publisher/modules/validations/validation.manager.js:62)
>> at
>> org.jaggeryjs.rhino.publisher.modules.validations.c0.call(/publisher/modules/validations/validation.manager.js)
>> at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.core.c3._c_anonymous_9(/publisher/modules/ext/core/extension.management.js:119)
>> at
>> org.jaggeryjs.rhino.publisher.modules.ext.core.c3.call(/publisher/modules/ext/core/extension.management.js)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:85)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1._c_addNewMobileApp_26(/publisher/apis/v1/asset_api_router.jag:949)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1.call(/publisher/apis/v1/asset_api_router.jag)
>> at
>> org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:63)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1._c_anonymous_18(/publisher/apis/v1/asset_api_router.jag:373)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1.call(/publisher/apis/v1/asset_api_router.jag)
>> at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)
>> at
>> org.jaggeryjs.rhino.publisher.modules.c4._c_anonymous_12(/publisher/modules/router-g.js:183)
>> at
>> org.jaggeryjs.rhino.publisher.modules.c4.call(/publisher/modules/router-g.js)
>> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1._c_anonymous_1(/publisher/apis/v1/asset_api_router.jag:1285)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1.call(/publisher/apis/v1/asset_api_router.jag)
>> at
>> org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2430)
>> at org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:269)
>> at org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:97)
>> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
>> at
>> org.jaggeryjs.rhino.publisher.modules.c6._c_anonymous_17(/publisher/modules/publisher.js:438)
>> at
>> org.jaggeryjs.rhino.publisher.modules.c6.call(/publisher/modules/publisher.js)
>> at org.mozilla.javascript.optimizer.OptRuntime.call0(OptRuntime.java:23)
>> at
>> org.jaggeryjs.rhino.<store>.scripts.c0._c_anonymous_17(<store>/scripts/server.js:266)
>> at org.jaggeryjs.rhino.<store>.scripts.c0.call(<store>/scripts/server.js)
>> at org.mozilla.javascript.optimizer.OptRuntime.call2(OptRuntime.java:42)
>> at
>> org.jaggeryjs.rhino.publisher.modules.c6._c_anonymous_16(/publisher/modules/publisher.js:433)
>> at
>> org.jaggeryjs.rhino.publisher.modules.c6.call(/publisher/modules/publisher.js)
>> at org.mozilla.javascript.optimizer.OptRuntime.callN(OptRuntime.java:52)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1._c_script_0(/publisher/apis/v1/asset_api_router.jag:17)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1.call(/publisher/apis/v1/asset_api_router.jag)
>> at
>> org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
>> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3091)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1.call(/publisher/apis/v1/asset_api_router.jag)
>> at
>> org.jaggeryjs.rhino.publisher.apis.v_1.c1.exec(/publisher/apis/v1/asset_api_router.jag)
>> at
>> org.jaggeryjs.scriptengine.engine.RhinoEngine.execScript(RhinoEngine.java:567)
>> 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.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>> 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.webapp.authenticator.framework.WebappAuthenticationValve.invoke(WebappAuthenticationValve.java:43)
>> 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)
>>
>> [2016-01-27 12:48:27,496] ERROR {JAGGERY.apis.v1.asset_api_router:jag} -
>>  An asset of type: mobileapp could not be created.
>>
>> This is in a fresh pack of EMM 2.0.1-SNAPSHOT with APPM version 1.1.1. I
>> checked the mandatory.field.validator.js file
>> in /publisher/modules/ext/scripts/validations/. This is the code block
>> which causes the above issue.
>>
>> //Get the value of the field from the model
>>             var fieldInstance = model.get(tableName + '.' + field.name);
>>
>>             if(!fieldInstance){
>>                 report.record(field.name,'Mandatory field '+field.name+'
>> is not present.');
>>                 return;
>>             }
>>
>>             var value= "" + fieldInstance.value;
>>             value=value.trim();
>>             value=value.replace("undefined","");
>>
>> Then I checked the type of objects which comes as valve using the below
>> code.
>>
>>             var value= "" + fieldInstance.value;
>>             log.info("Value " + value + " , Type " + typeof value);
>>             value=value.trim();
>>
>> Result was :
>> [2016-01-27 12:48:27,489]  INFO {mandatory.field.validator} -  Value
>> admin , Type object
>> [2016-01-27 12:48:27,490]  INFO {mandatory.field.validator} -  Value
>> whatsapp, Type string
>> [2016-01-27 12:48:27,491]  INFO {mandatory.field.validator} -  Value
>> what, Type string
>> [2016-01-27 12:48:27,492]  INFO {mandatory.field.validator} -  Value
>> 1.0,2.5.0, Type object
>>
>> The value which causes the above issue is "1.0,2.5.0" which is type of
>> object. 2.5.0 is the value I inserted for the version field. I noticed that
>> 1.0, is appended to the version value I have entered (even if I create
>> another mobile app entry). My question is why I'm always getting 1.0,
>> appended prior to the value I put to the version field?
>>
>> Thanks,
>>
>> Harshan Liyanage
>> Software Engineer
>> Mobile: *+94724423048*
>> Email: [email protected]
>> Blog : http://harshanliyanage.blogspot.com/
>> *WSO2, Inc. :** wso2.com <http://wso2.com/>*
>> lean.enterprise.middleware.
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
>
> *Ruwan Abeykoon*
> *Architect,*
> *WSO2, Inc. http://wso2.com <http://wso2.com/> *
> *lean.enterprise.middleware.*
>
> email: [email protected]
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to