Java API | Developing Restful APIs | Rest API In Java | Java Tutorial | Java Training | Edureka
Why Stack Overflow recommends it
Stack Overflow users cite it as the tutorial they followed when setting up a Jersey 'hello world' REST service on Tomcat and then hit 404 errors or ClassNotFoundException problems.
Recommended by 2 people across 2 different months, 2018 to 2021.
What it is
A 31-minute Edureka tutorial that explains what an API is, how APIs work in Java, and what a REST API is, then walks through building a RESTful web service with Jersey, Eclipse and Tomcat. It is presented as a beginner-oriented step-by-step walkthrough from a paid-training channel.
What people said
Recommends Hamish Kendall · 2018-06 · Stack Overflow · on “Java Rest Server”
I've tried multiple reinstallations of tomcat and followed this tutorial: [this video] However I always get this error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Screenshot here: This is my current Hello.java class: package test; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("/hello") public class Hello { @GET @Produces(MediaType.TEXT_PLAIN) public String sayHello() { String resource="This is some test return text"; return resource; } } Current web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=" [LINK] " xmlns=" [LINK] " xsi
Recommends Andre Leon Rangel · 2019-01 · Stack Overflow · on “Which Architecture can be used if the Web Service Location changes continuously”
Task 1) Is not a matter of architecture is more an issue of service design. Based on the principles of service design and the 8 service desing principles [LINK] this scenario pretty much violates lots of defined practices. The service itselt should be interoperable and apply service discoverability. The way the service is exposed should consider a scenario where the URL will change. Technically this could be address by using a DNS, reverse proxy or simply adding a defined static URL that can do service invocation, and re-direct to the desired service operation in SOAP terminology or API resource in REST terminology. It should be a static one like [LINK] and weather.asmx will contain other op
Cites Eswar · 2018-08 · Stack Overflow · on “404 response while running simple hello restapi on tomcat”
I am attempting basic hello restAPi following this link [this video] . The program is done in java in eclipse. However towards I get the error: Several ports (8005, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or or change the port number(s). I have tried changing port number, it doesn't work. I have did the checks and I get the apache home page on 8080 and not on the changed port number 8081. Running on 8081 gives me a 404 response while running on 8080 throws the error shown above. What's the way around this
Cites Eswar · 2018-08 · Stack Overflow · on “Unable to create simple java restapi in eclipse”
I am following this link for creating a simple Java restApi in Eclipse: [this video] . However, I am getting a 404 response and console reports an error of java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class It's a dynamic web project and web.xml is as follows: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=" [LINK] " xmlns=" [LINK] " xsi:schemaLocation=" [LINK] [LINK] " id="WebApp_ID" version="3.1"> <display-name>JavaAPI</display-name> <servlet> <servlet-name>JAVA_API</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer.class</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-valu
Cites funnyguy · 2019-01 · Stack Overflow · on “RESTfull API does not print content on a specific path using jersey framework and apache tomact server”
I am quite new in programming, I am trying to create my first RESTfull API. I have created a server with Apache Tomcat/8.5.37 and I used jersey RESTfull web services. My problem is that class content (XML) is not printed on localhost:8080 using the path [LINK] I created a tomcat server and used both JAX-RS 2.0 / Jersey 2.25.x and JAX-RS 2.1 / Jersey 2.26+ in the case of a versioning problem, none of them works. I just cannot think of what could be the problem. package test; import javax.ws.rs.ApplicationPath; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Application; @Path("/hello") public class Hello
Cites aviator · 2019-07 · Stack Overflow · on “Developing Hangouts Chat Bot using Eclipse and Apache Tomcat 9.0”
I am attempting to develop a hangouts chat bot. I am attempting to write this up in Java using Eclipse as my development software - along with Apache Tomcat 9 as my server. My question is how do I develop the API to integrate with my bot program. The ultimate goal is to have a chat bot for Google Hangouts that is in house developed and can take information from an incoming chat and send it as an email to myself. I am using a tomcat 9.0 server I am basing my project of this tutorial video - I followed all the steps, but something is missing. I realize in the video he is using tomcat 8.5, hopefully this is not the root of my issue. [this video] I figured if I could follow the steps in the above vid
Cites Varun Gawande · 2021-05 · Stack Overflow · on “Class not found even though it is clearly visible in Web App Libraries”
Similar question exists [LINK] but none of the answers helped. Starting Tomcat Server 9 on my Eclipse Project gives the error java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1364) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1187) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:539) Even though I can clearly see ServletContainer.class under org.glassfish.jersey.servlet under jersey-container-servlet-core.jar under Web App Libraries . All the required jars were added to /src/main/weba