GitHub user zjffdu opened a pull request:

    https://github.com/apache/zeppelin/pull/2311

    ZEPPELIN-2485. AngularModel can be serialized correctly.

    ### What is this PR for?
    AngularModel would be serialized as part of AngularObject, but it would 
fail to serialized to json sometimes. 
    
    ```
    ERROR [2017-05-03 14:25:31,563] ({pool-21-thread-1} 
AngularObject.java[run]:193) - Exception on watch
    java.lang.IllegalArgumentException: class 
org.apache.zeppelin.display.angular.notebookscope.AngularModel declares 
multiple JSON fields named name
        at 
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:122)
        at 
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:72)
        at com.google.gson.Gson.getAdapter(Gson.java:349)
        at 
com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.write(TypeAdapterRuntimeTypeWrapper.java:55)
        at 
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.write(ReflectiveTypeAdapterFactory.java:89)
        at 
com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.write(ReflectiveTypeAdapterFactory.java:195)
        at com.google.gson.Gson.toJson(Gson.java:582)
        at com.google.gson.Gson.toJson(Gson.java:561)
        at com.google.gson.Gson.toJson(Gson.java:516)
        at com.google.gson.Gson.toJson(Gson.java:496)
        at 
org.apache.zeppelin.interpreter.remote.RemoteInterpreterEventClient.angularObjectUpdate(RemoteInterpreterEventClient.java:96)
    ```
    
    
    ### What type of PR is it?
    [Bug Fix]
    
    ### Todos
    * [ ] - Task
    
    ### What is the Jira issue?
    * https://issues.apache.org/jira/browse/ZEPPELIN-2485
    
    ### How should this be tested?
    Unit test is added
    
    
    ### Questions:
    * Does the licenses files need update? No
    * Is there breaking changes for older versions? No
    * Does this needs documentation? No


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/zjffdu/zeppelin ZEPPELIN-2485

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/zeppelin/pull/2311.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2311
    
----
commit b2bbe3147b2dd798b8f4694a24d1f462cfb9de3b
Author: Jeff Zhang <[email protected]>
Date:   2017-05-03T08:46:01Z

    ZEPPELIN-2485. AngularModel can be serialized correctly.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to