java - Error converting JSON to object via jersey -


i've created dynamicweb project (not maven) in eclipse target server tomcat 7.

in location '\webcontent\web-inf\lib' placed jars:
jersey-json-1.19.jar
jersey-bundle-1.19.jar
jersey-core-1.19.jar

in web.xml have:

<init-param>     <param-name>com.sun.jersey.api.json.pojomappingfeature</param-name>     <param-value>true</param-value> </init-param> 

pojo:

@xmlrootelement(name = "input") public class inputob {     string name;      public string getname() {         return name;     }      public void setname(string name) {         this.name = name;     }  } 

rest resource:

@path("/add") public class addob {      @post     @consumes(mediatype.application_json)     @produces(mediatype.application_json)        public response add(inputob input) {         ....             }    } 

when try call it, getting:

severe: message body reader java class datatypes.inputob, , java type class datatypes.inputob, , mime media type application/json not found.

try add dependencies through pom.xml , use maven run. maybe goes wrong jars.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -