Using vCAC plug-in (5.1) I was trying to create a vCAC PhysicalMachine Entity. Couple of of attributes in PhysicalMachine Entity are numeric type.
For example: To create a PhysicalMachineEntity I am sending below properties map to createModelEntity
var physicalMachineProps = {
PhysicalMachineID = "UUID",
MemoryInMB=1121,
ProcessorCount=2,
Vendor="Vendor",
AssetTag="SDSDSD",
Model="usrLbl",
ServiceTag="DN",
Slot=0
};
createModelEntity always failing with java.lang.Double cannot be cast to java.lang.Short error. Looks like number type from Rhino always getting converted to java.lang.Double and its failing at plugin. How can we force type to be Short
Any one have seen this. Appreciate any inputs on this.
Caused by: java.lang.ClassCastException: java.lang.Double cannot be cast to java.lang.Short
at org.odata4j.core.OSimpleObjects.create(OSimpleObjects.java:38)
at org.odata4j.core.OProperties.simple(OProperties.java:54)
at com.vmware.o11n.plugin.dynamicops.model.support.ODataAccessService.createSimpleProperty(ODataAccessService.java:1012)
at com.vmware.o11n.plugin.dynamicops.model.support.ODataAccessService.populateSimpleArgument(ODataAccessService.java:934)
at com.vmware.o11n.plugin.dynamicops.model.support.ODataAccessService.saveEntity(ODataAccessService.java:843)
at com.vmware.o11n.plugin.dynamicops.model.EntityManager.createModelEntity(EntityManager.java:53)
at com.vmware.o11n.plugin.dynamicops.model.EntityManager$$FastClassByCGLIB$$5bb4b803.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at com.vmware.o11n.plugin.sdk.spring.impl.CurrentFactoryAnnotationAdvisor$1.call(CurrentFactoryAnnotationAdvisor.java:71)
at com.vmware.o11n.plugin.sdk.spring.AbstractSpringPluginFactory.doInCurrent(AbstractSpringPluginFactory.java:193)
at com.vmware.o11n.plugin.sdk.spring.impl.CurrentFactoryAnnotationAdvisor.invoke(CurrentFactoryAnnotationAdvisor.java:67)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)
at com.vmware.o11n.plugin.dynamicops.model.EntityManager$$EnhancerByCGLIB$$93e675fa.createModelEntity(<generated>)