404 with Jersey with Maven IntelliJ and Tomcat

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

404 with Jersey with Maven IntelliJ and Tomcat

Anurag Jain
Hi all,

This is my first post.

I'm not a java guy but I've to write some REST APIs and I wanted to
try out Jersey JAX-RS library as per the recommendation from my peers.
I've been able to configure a non-maven project in Eclipse and I'm
able to invoke an example REST API.

But I'm unable to do the same with IntelliJ idea ultimate. I'm trying
to configure a maven project with Jersey and Tomcat in IntelliJ Idea
Ultimate.

Below are the steps I followed.

1: Created a maven project with the archetype groupId -
org.glassfish.jersey.archetypes and artifactId  -
jersey-quickstart-webapp with  version 2.5. Maven downloads
2: Created tomcat configuration. During build Maven downloads the
necessary libs and on running I see the jersey JARs being placed
inside target folder's ..\target\{Projectname}\WEB-INF\lib

Yet I get 404 not found while connecting with the rest API URL. I'm
unsure what might the issue be and need some assistance. I'm attaching
my pom.xml, web.xml and other necessary files here below.

Regards,
--
Anurag Jain

pom.xml (2K) Download Attachment
web.xml (1K) Download Attachment
MyResource.java (812 bytes) Download Attachment
index.jsp (340 bytes) Download Attachment