I am trying to access a resource on my Hello world (for now) application. However, I get this HTTP status 404 - not found when I deploy it ot Tomcat and hit the URL: localhost:8080/test/rest. Here are my pom.xml depdendencies:
<dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-common</artifactId> <version>2.26-b03</version> </dependency> <dependency> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-server</artifactId> <version>2.26-b03</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>2.26-b03</version> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.11</version> <scope>test</scope> </dependency> And here are my web.xml configurations:
<web-app> <display-name>Archetype Created Web Application</display-name> <servlet> <servlet-name>HelloWorld Jersey Service </servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> <param-name >jersey.config.server.provider.packages</param-name> <param-value >com.latin.translator.app</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name >HelloWorld Jersey Service </servlet-name > <url-pattern >/test/*</url-pattern > </servlet-mapping> </web-app> The java code is:
@Path("/test") public class Test { @GET @Produces(TEXT_PLAIN) @Path("/rest") public String test() { return "Great success"; } } Do you have any ideas what I am doing wrong?