This is not the case with MAVEN building the Jersey project.
I post the files that Pom relies on.
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-server</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-client</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
The blackbody part is a must-depend
Jersey-json If the return data is required, the JSON format is also required to rely on the last dependency of the write test
What I'm going to say here is some of the mistakes I've had here since the completion.
In case of a 500 error
Severe:mapped exception to response:500 (Internal Server Error)
1, the method of Pojo class is not annotated @XmlRootElement or the class has a list object without @xmlelement annotations
2, @Produces ({mediatype.application_xml, Mediatype.application_json}) MIME return form if only Mediatype.application_json is not dependent Jersey-json packet will be error
Recent contact with Jersey to discuss