Bear Bibeault wrote:Using a JSP to generate the JSON is a major problem. Use a servlet instead.
Thanks for your Reply.
Yes as per your suggestion i changed jsp and declared as servlet.
Below is the servlet is had written.
and when i run the following script, to my surprise the servlet thrown a weird errortrace which is
As it clearly states that org.apache.log4j.Category class is missing, i verified my log4j-1.2.16.jar and it contains the mentioned class.
Just for debugging i thought of removing the log4j jar and run, i did it and it executed correctly. and given response correctly.
But for my project the log4j-1.2.16.jar is mandatory for logging.
I am little bit confused with the jars that are required for using json. In a example i saw that the required jars are.
I added all those jars and as i said early my project requires log4j as well.
so the WEB-INF/lib folder contains all the list of jars mentioned along with log4j-1.2.16.jar.
But it json isn't working if i have log4j.jar in my lib folder.
Am i doing any mistake or please let me know the procedure which is greatly appreciated.
Bear Bibeault wrote:The required jar files are missing from your web app. Add them to WEB-INF/lib.
I have already added all required jars and still showing the error.
But i tried to add commons-logging.jar as well and then it worked fine for me.
As it is working fine with my example i tried to use the same for the cross domain url which returns a json object.
Still my struggle goes on. its working for my sample but not for the cross domain Url.
I think there is a problem in forwarding data to the crossdomain url using $.getJSON() Method.
Am i doing anything wrong which doesn't work for cross domain URL