Java Restful Service Tutorial - Creating a rest service - Part 2

308tube · 226K views · 2013 · 35:20

Open on YouTube

Web developmentSoftware practice, open source & careerstutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed to build a Jersey REST service, and cite it when asking about errors that came up while following it.

Recommended by 2 people across 2 different months, 2013 to 2016.

What it is

A 35-minute screencast from the 308tube channel showing how to build a Java REST service with the Jersey framework in Eclipse. It is part 2 of a series and walks through project setup, a first service and some best practices, with a companion GitHub repo.

What people said

Recommends Benjamin Pack · 2013-08 · Stack Overflow · on “Can a java program be the mediator between webpage javascript and a Database?”

Yes, Java can do this. So can Python, PHP and most other languages. Using javascript to directly access a database from a web page is problematic for security reasons. Without knowing more about the problem, the constraints or your experience with Java it's difficult to provide clearer direction. If all of this is new to you then I will say you have a non-trivial amount of work to learn how to do this. For interacting with a database from Java, the following may be helpful: [LINK] Here's a series of video tutorials using Java to create Rest services that javascript can interact with via Ajax: [LINK] [this video] [LINK]

Recommends toing_toing · 2016-09 · Stack Overflow · on “javax.naming.NameNotFoundException: Name > [com] is not bound in this Context. Unable to find [com]”

I am developing a simple jersey web service from dynamic web project type, following this [this video] tutorial. So far I have the following code: ServiceStatus.Java (in package au.com.biting.bolat.status) package au.com.biting.bolat.status; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @Path("/v1/status") public class ServiceStatus { @GET @Produces(MediaType.TEXT_HTML) public String returnTitle() { return "<p>Java Web Service</p>"; } } web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=" [LINK] " xmlns=" [LINK] " xsi:schemaLocation=" [LINK] [LINK] " id="WebApp_ID" version="3.0"> <display-name>au.com.biting.bolat</display-name> <welcome-file-list> <welcome-file>index.htm

Cites eeadev · 2014-02 · Stack Overflow · on “Tomcat error 500 when using JAXB”

I used a rest web service using jersey (followed this tutorial [this video] ) and everything works fine. Now I am trying to use a WS which returns a basic JSON . When I try and use it via browser I get this error HTTP Status 500 - Servlet.init() for servlet Jersey REST Service threw exception Question: Where should I investigate further? I am using: Eclipse JEE, jersey-archive-1.18, Tomcat 7 THis is my class: package com.name.rest.status; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @Path("/v1/status") public class V1_status { private static final String api_version = "1.00.1"; @GET @Produces(MediaType.TEXT_HTML) public String returnTitle() { return "<p> Java Web Service </p>"; } @Pat

Cites HP Asus · 2015-07 · Stack Overflow · on “org.eclipse.core.runtime.CoreException: Module named '_auto_generated_ear_' failed to deploy”

I was following this tutorial [this video] . And I followed the steps. But I am getting this error: org.eclipse.core.runtime.CoreException: Module named '_auto_generated_ear_' failed to deploy. See Error Log view for more detail. at oracle.eclipse.tools.weblogic.server.internal.WlsJ2EEDeploymentHelper.deployAutoGenerateEarApplication(WlsJ2EEDeploymentHelper.java:806)...... at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishWeblogicModules(WeblogicServerBehaviour.java:1425) at oracle.eclipse.tools.weblogic.server.internal.WeblogicServerBehaviour.publishToServer(WeblogicServerBehaviour.java:917) Contains: Module named '_auto_generated_ear_' failed to start. Contains: we

Cites anbu selvan · 2016-05 · Stack Overflow · on “Http method GET shows error when using jersey”

I am following a tutorial to learn REST api. Below is my code that has GET annotation and use Weblogic server to deploy my application. For some reason it is showing the following error: HTTP method GET is not supported by this URL Sample.java import javax.ws.rs.*; import javax.ws.rs.core.MediaType; @Path("/v1") public class V1_status { @GET @Produces(MediaType.TEXT_HTML) public String returnTitle(){ return "<p> Yess </p>"; } } web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi=" [LINK] " xmlns=" [LINK] " xmlns:web=" [LINK] " xsi:schemaLocation=" [LINK] [LINK] " id="WebApp_ID" version="3.0"> <display-name>com.glasschecker.rest</display-name> <welcome-file-list> <welcome-file>i