Git Product home page Git Product logo

jabsorb's People

Contributors

arthurblake avatar gmkll avatar wbecker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

isigma

jabsorb's Issues

List Serialization

What steps will reproduce the problem?
1. toJSON() parse Array to JSON data error, leading 592 error
parsed data using the old version jsonrpc.js toJSON()
"list": 
[{"id": "123456"}], 
"javaClass": "java.util.Vector"


parsed data using the 1.3.2 version jsonrpc.js toJSON()
"list": {
    "0": {"id": "123456"}
}, 
"javaClass": "java.util.Vector"

2. jabsorb.jar  throw new UnmarshallException

public class ListSerializer extends AbstractSerializer
JSONArray jsonlist;
    try
    {
      jsonlist = jso.getJSONArray("list");
    }
catch (JSONException e)
    {
      throw new UnmarshallException("Could not read list: " + e.getMessage(), e);
    }


What is the expected output? What do you see instead?
UnmarshallException

What version of the product are you using? On what operating system?
1.3.2

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 6 Nov 2014 at 6:49

LinkedHashMap is serialized as HashMap

What steps will reproduce the problem?
1. try to serialize a LinkedHashMap from Servlet to javascript layer.

What is the expected output? What do you see instead?
the order of entries in javascript layer should be the same as the Servlet layer

What version of the product are you using? On what operating system?
Version is 1.3.2; the library is included in a Web Application deployed in 
Glassfish v 2.1

Please provide any additional information below.
The bug seems to be related to re-insertion of LinkedHashMap entries in a plain 
HashMap during serialization. In fact, the method "marshall" of class 
"MapSerializer" during the "while(i.hasNext())" cycle, inserts the entries in 
the JSONObject with the method .put(keyString, json). But JSONObject has a 
inner HashMap, so the order of entries is lost during marshalling.
A possible way to resolve this, is to change "on the fly" the inner HashMap of 
JSONObject with a LinkedHashMap, by setting field.setAccessible(true) just 
before marshalling the map. The solution could be like this:

    class  MapSerializer {

        @Override
        public Object marshall(SerializerState state, Object p, Object o)
                throws MarshallException {
            Map map = (Map) o;
            JSONObject obj = new JSONObject();
            JSONObject mapdata = new JSONObject();

            // the following code has been added to support the
            // LinkedHashMap and the keeping of entry order. :)
            //---------------------------------------------//
            if(o != null && o.getClass() == LinkedHashMap.class) {
                try {
                    Field mapField = JSONObject.class.getDeclaredField("myHashMap");
                    mapField.setAccessible(true);
                    mapField.set(mapdata, new LinkedHashMap());
                    mapField.set(obj, new LinkedHashMap());
                } catch (Exception ex) {
                    throw new MarshallException("Cannot update JSON internal map");
                }
            }

            .....

Original issue reported on code.google.com by [email protected] on 27 Jun 2012 at 7:46

RPC call exception 593

  bean java.util.Collections$UnmodifiableCollection can't invoke isEmpty: Class org.jabsorb.serializer.impl.BeanSerializer can not access a member of class java.util.Collections$UnmodifiableCollection with modifiers "public"
    at org.jabsorb.client.Client.processException(Client.java:181)
    at org.jabsorb.client.Client.invoke(Client.java:158)
    at org.jabsorb.client.Client.invoke(Client.java:135)
    at $Proxy13.evaluateProduct(Unknown Source)
    at nextag.build.CatalogJSONRPC.evaluateProduct(CatalogJSONRPC.java:160)

What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?
1.3.1

Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 16 Oct 2012 at 10:12

Date Serialization

What steps will reproduce the problem?
1. Try to serialize an object with Date field
2. Print out JSON result
3. Look at the serialized object java.sql.Timestamp for the date field

What is the expected output? What do you see instead?
It could be useful to choose output format for the date type (i.e. 
/Date(1292851800000+0100)/ WCF format) to make the library more compliant

What version of the product are you using? On what operating system?


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 5 Oct 2012 at 10:52

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.