Me and group just took over a development project from some guys that didn't have the time to continue. The project consist of a RESTful server using jersey and jetty, and a java client. Unfortunately, they're unavailable, and we're stuck trying to deploy the server.
They've been using eclipse for development, and for the server project maven has been used to take care of dependencies. They did not use maven for deploying the .jar files though, they only extracted them through eclipse.
We'ce used both maven-install to create a jar-file and just exporting through Eclipse. In both cases we manage to get it up and running, but when we start the client we get the following error on the server:
Caused by: com.sun.jersey.api.MessageException: A message body writer for Java class java.lang.String, and Java type class java.lang.String, and MIME media type text/plain was not found
The same happens if we try to access the webservices through a regular browser.
However, when running the project through Eclipse as in "Run As"->"Java Application" it works.
I've already read a lot of posts, including A message body writer for Java class ... and MIME media type text/html was not found, and I've added the jersey-json dependency, but the same error occurs.
The resources are defined in this manner:
@Path("/{token}/users")
public class Users {
@GET
@Path("/show/{username}")
@Produces("text/plain")
public String getUser(@PathParam("username") String username,
@PathParam("token") String token) {
(...)
}
We haven't studied the actual HTTP requests/responses yet, but might do that if someone thinks any information from those would be interesting.
Thanks for any help! Any input is appreciated!
EDIT: Using maven-assembly to deploy, and the POM-file contains this (and more):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>no.abakus.backup.abacash.webservice.AbaCashCoreLauncher</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>