AppEngine and Jackson Class Not Found: JaxbAnnotationIntrospector (at first) - json

I'm trying to get a simple AppEngine working that serves as webservices and will delivery content in JSON format.
I'm using Jersey an Jackson, although when I launch the app and access one of the webservices for the first time I get this error:
java.lang.NoClassDefFoundError: com/google/appengine/repackaged/org/codehaus/jackson/xc/JaxbAnnotationIntrospector
If I try to access another WS right after (or try to re-access the current one) then everything seems to go fine. Just not the first time.
Anyone knows how to solve this?
Kr,
Dirk

Related

NullPointerException from Liferay 6.2 JSON Web Service API

I'm pulling my hair out over this.. We had a service in place when we were on Liferay 6.0 that read new entries from out HR database (new hires, terminations, changes, etc). It would then loop through and call the Liferay API using tunnel-web to call the functions to make changes (add user, update user, etc). When we upgraded to 6.2 it broke my custom service and after some trial and error I was able to get some methods working again using the jsonws api.
I worked out a few of them but I am having major problems with user/update-user. I am using VB.net to build a LiferayUser class, call get-user-by-screen-name, fill in values in new LiferayUser object, update values from HR database, convert object to json, call update-user and post the json object.
Right now all I get returned is {"exception":"java.lang.NullPointerException"}. This is also all that shows up in the server logs. I've tried both POST and GET methods, posting a json object. I even tried posting the form parameters to the /invoke method that is used on the api reference.
Has anyone come across this before and resolved it?

WSo2 API Manager 1.8.0 - JSON parsing issue

I am new to wso2 API Manager, trying to set it up expose my plain HTTP POST back end calls as a REST API. I am sure this is not a new pattern that I am trying to achieve here. The requirement is to convert the JSON data coming in (has array structures) into the HTTP URL query string parameters.
After some research through the documentation and other posts on this forum, decided to go with the script mediator that would parse the JSON data and convert it to a string that can be appended to the endpoint URL. Some how I am not able to achieve this.
I have followed the following post that seems to be very straight forward. As the original poster suggested, I am also not able to use getPayloadJSON() method. Even have trouble using the work around suggested there due to JSON.parse() not working.
Link
Also, this approach of editing the service bus configuration from source view does not sound like the correct option. Is there another elegant solution to achieve this? Thanks for the help in advance.
I was able to get both methods working by using an external script instead of the inline java script. Thanks

JSON.stringify on Dynatree.toDict works in Development environment but not on other machines

Very new to WCF and almost got everything to work doing POST from JQuery to WCF. I thought?
The Jquery is processing a DynaTree and gets the latest dictionary which needs to be serialized in order to perform a successful post.
When I run Visual Studio, it works fine. When I access the site from my development machine - not in debug mode - it also works fine. But when accessing the site from any other machine siting on the same domain within the WLAN, it fails.
var dict = $("#tree").dynatree("getTree").toDict();
The line in particular that fails is JSON.stringify(dict);
The alerts shows an object coming through and hence toDict() works fine. However, when JSON tries to serialize it, fails.
This serialized data will be my post data to WCF handle. There is nothing wrong in WCF, the call to WCF is never made as the code fails one line above.
Need help.

Json parsing in IBM Worklight

I am trying to achieve something like which is mentioned in this link
but i don't know whereto write the parsing code. I tried to write it in new method and added the method in "my adapter.xml" but nothing happens. I even don't know how to log in IBM WorkLight. I used WL.logger(some) but its throwing error that "Logger can not be called on an object".
Any help would be appreciated. Thanks in advance.!
In most cases you don't need to manually parse responses because WL adapter framework will do this for you. Anything you retrieve via WL.Server.invokeHttp API will be parsed to JSON automatically unless you specify returnedContentType:"plain". In case you DO need to manually parse JSON you can use JSON.parse() and JSON.stringify() APIs.
Server side logging is achieved via WL.Logger.debug/error/info etc. You can get more info about it here
You don't have to parse JSON data, there are libraries in Javascript to do that. Try JSON.parse(). You should learning how to write adapters and invoking them from clients. The Getting Started modules are a good place to start, specifically Module 4 in your case.

Axis2 WebServices with JSON objects

I'm trying to get Axis2 WebServices to work with JSON Objects for three days, and can't get it right.
They have to receive and return JSON so it can comunicate with an iPhone app. I've tried everything it the first seven pages in Google and got nothing.
I've already put the Message Formatters and Message Builders in axis2.xml. So as jettison jar in the lib folder.
Can someone help me, please? I need an example of how to make this to work.
Thanks!