Getting an error with plugins.serialize.fromJSON()

I’m having the following exception raised every time i try to de-serialize some JSON data, it reads like I’m missing some file… ?

org.jabsorb.serializer.UnmarshallException: Class specified in javaClass hint not found: (unknown) (gQueryTradeTool, line 22)

Have not really looked into this but doing a search on the web gave me this hit: http://groups.google.com/group/jabsorb- … a79e6bfd75

Humm… I have patched the JSONSerializer.java as mentioned in the post and recompiled the .jar file however I don’t get any extra information to the problem :frowning:

HOWEVER…

Doing
var pageData = plugins.http.getPageData(urlString,‘mybrowser’);
var myObject = eval(‘(’ + pageData + ‘)’);

Works just fine for de-serializing the JSON string into an Object, so I think I’m all set with this. Although it begs the question…why do we need the plugin if eval() and uneval() work just fine for (de)serialization?

Would help if you show us the JSON data you try to deserialize. It complains about a certain class, so which class can it not convert?

Paul

Ryan,

can you post the actual string value that could not be deserialized?

Rob

{‘restriction’: ‘No Encryption’, ‘part_number’: ‘CAB-AC’, ‘hts’: ‘8544.42.9000’, ‘description’: ‘Power Cord,110V’, ‘eccn’: ‘5A991’}

Ryan,

The plugin tries to create a java object for all non-primitives.
It tries to find a javaClass attribute which is not found.

The eval-should work fine.
Note that the eval has a security issue, it can execute any javascript code, so only use data from a trusted source, see http://en.wikipedia.org/wiki/JSON

Rob