namratajan narula

Greenhorn
+ Follow
since Feb 21, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by namratajan narula

HI Paul,
Thanks for the reply.I looked at the POST however still have confusion for attaching the source code.I followed all the steps given in the thread but could see the error as

|org.springframework.web.servlet.handler.AbstractHandlerExceptionResolver:resolveException(106) | Resolving exception from handler [com.dataguise.dgcontrol.servlets.DgCentralControllerServlet@1b963c4]: org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported

I saw in Thread 2 that you have a class as RequestMappingHandlerAdapter .I am not sure if I need to implement it as I am already giving entry in web.xml.(posted in first message).Don't know if I need any more class to be implemented.
Can you recommend me some basic level book that contain the complete sample code that needs to be done for implementing JSON in spring MVC as I am pretty new to Spring MVC architecture.

Thanks for all your help though


Thanks
Namrata
10 years ago
Thanks for the input...I could solve "java.lang.NoSuchMethodError: org.codehaus.jackson.type.JavaType.isConcrete()Z " issue as it seems I was using @EnableWebMvc annotation which when removed seem to resolve that error.But the "Method not allowed" error doesnt seem to go .By the way, DispatcherServlet is class file that is provided by spring and we dont deal with source code of it directly.Secondly, I did applied the debugger points but the control doesnt seem to enter in the @controller class at first place.
I did check on the jsonlint site to confirm the format of json.It seems to be valid json.
I havent implemented any jackson class as such , Just included the following jars and gave the entry in web.xml

com.springsource.org.codehaus.jackson.mapper-1.4.2.jar
com.springsource.org.codehaus.jackson-1.0.0.jar
jackson-core-2.0.2.jar
jackson-core-asl-1.9.7.jar
jackson-datatype-json-org-2.0.2.jar
jackson-mapper-asl-1.9.7.jar
org.springframework.asm-3.0.1.RELEASE-A.jar
org.springframework.beans-3.0.1.RELEASE-A.jar
org.springframework.context-3.0.1.RELEASE-A.jar
org.springframework.context-sources-3.1.0.M1.jar

Do I have to implement any of these classes???
MappingJacksonHttpMessageConverter
MappingJacksonJsonView
10 years ago
Json seems to be correct form..I have used the same format when implementing simple rest web service without spring.It seem to work fine there.
For point 2.I did expliclty added the header contenttype as appplication/json when sending the request through the RESTclient.
Also noticed the console seem to be giving me the following error in tomcat logs



Any idea ???
Do i need to implement some mapping class to indicate my POJO to JSON conversion.??
10 years ago