[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-8708?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14967785#comment-14967785
 ] 

ASF GitHub Bot commented on CLOUDSTACK-8708:
--------------------------------------------

Github user borisroman commented on the pull request:

    https://github.com/apache/cloudstack/pull/932#issuecomment-150010981
  
    @DaanHoogland I tested this PR again today.
    
    When using the listSystemVms API call:
    
    ```
    INFO  [c.c.a.ApiServer] (1975058800@qtp-1945752215-4:ctx-c6162e68 
ctx-1705495f) class 
    org.apache.cloudstack.api.response.SystemVmResponse declares multiple JSON 
fields named jobid
    ```
    
    And in general when collecting host stats:
    
    ```
    ERROR [c.c.s.StatsCollector] (StatsCollector-3:ctx-a786a412) Error trying 
to retrieve storage stats
    java.lang.ArrayIndexOutOfBoundsException: 0
        at 
com.cloud.agent.manager.AgentManagerImpl.send(AgentManagerImpl.java:365)
        at 
org.apache.cloudstack.storage.RemoteHostEndPoint.sendMessage(RemoteHostEndPoint.java:125)
        at 
com.cloud.server.StatsCollector$StorageCollector.runInContext(StatsCollector.java:725)
        at 
org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
        at 
org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
        at 
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
        at 
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
        at 
org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
        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)
    WARN  [c.c.a.m.AgentManagerImpl] (StatsCollector-1:ctx-887e9d12) Exception 
while sending
    java.lang.ArrayIndexOutOfBoundsException: 0
        at 
com.cloud.agent.manager.AgentManagerImpl.send(AgentManagerImpl.java:365)
        at 
com.cloud.agent.manager.AgentManagerImpl.easySend(AgentManagerImpl.java:938)
        at 
com.cloud.resource.ResourceManagerImpl.getHostStatistics(ResourceManagerImpl.java:2485)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
        at 
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
        at 
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
        at 
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at com.sun.proxy.$Proxy158.getHostStatistics(Unknown Source)
        at 
com.cloud.server.StatsCollector$HostCollector.runInContext(StatsCollector.java:380)
        at 
org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:49)
        at 
org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:56)
        at 
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:103)
        at 
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:53)
        at 
org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:46)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThradPoolExecutor.java:293)
        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)
    WARN  [c.c.r.ResourceManagerImpl] (StatsCollector-1:ctx-887e9d12) Unable to 
obtain host 1 statistics. 
    ```
    
    So it doesn't work in my setup. Could you have a look again? And also run 
the vm lifecycle integration tests and post the results, please.
    
    Ping @wido 


> Use Google Gson 2.3.1
> ---------------------
>
>                 Key: CLOUDSTACK-8708
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8708
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.6.0
>            Reporter: Wido den Hollander
>            Assignee: Daan Hoogland
>            Priority: Critical
>              Labels: gson, reflection
>
> Currently CloudStack uses Google GSON 1.7.2 which is from 30-Sep-2011.
> This is a outdated version. CLOUDSTACK-8677 (Call-Home feature) uses GSON 
> 2.3.1 (20-Nov-2014) which is not compatible with the current code.
> The roadmap of Gson shows that since 2.0 there is a change in casting: 
> https://sites.google.com/site/gson/gson-roadmap
> "Gson 2.0 doesn’t support type adapters for primitive types."
> The "com.cloud.agent.transport.RequestTest" test in "core" fails with the new 
> Gson version and this leads back to "ArrayTypeAdaptor" which does the 
> serializing and de-serializing of JSON to Objects and back.
> Class<?> type = ((Class<?>)typeOfT).getComponentType();
> Fails, since getComponentType() doesn't return com.cloud.api.Command.
> This seems to be a Java Reflection issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to