Eclipse tomcat java service HTTP error 404
I try to keep up with the java service. So I found several tutorials that explain always the same way. But I cannot run this: (.
I did Dynamic Web Project in Version 2.5 and Tomcat 7.0 in eclipse. Then I load the following jars into WEB-INF / lib
My project name is com.freespots.rest. I created the following web.xml
Ok, now am I going to create permissions for the Java class? Well, I did this Java Resources / src / com.freespots.rest.service:
If I start Tomcat and type the url for my browser like localhost: 8080 / com.freespots.rest, Tomcat shows my index.html file. But if I go to url localhost: 8080 / com.freespots.rest / api / hello there is only HTTP 404 error:
Good thing I am new to Java Webdevelopment and I cannot figure out my problem. Hope some guy can explain my mistake. Thanks in advance.
source to share
You are using the old (1.x) Jersey configuration. In Jersey 2.x, the class names and property names have changed. Instead, you should use
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
...
More deployment options here
source to share
localhost: 8080 / com.freespots.rest This url will run the welcome page which is index.html as you said and no 404 no error found pages found here. Try to set the method and call localhost:8080/com.freespots.rest/api/hello
@Path("name")
localhost:8080/com.freespots.rest/api/hello/name
source to share