Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Java Training Curriculum, Visit our Website: bit.ly/32Ymvde
Very informative. Thank you very much ! The installation part is a bit too long and should be more concentrated on new and specific issues regarding ReST.
Hey Sabuhi, thanks for checking out our tutorial. This is one of the implementation done through Rest API. There are several methods in Java to implement REST API and JSON is one of those. Since this is a beginner level tutorial, this is the simplest to start off with and that's why we have used it. Cheers!
Hey Vijay, thanks for the wonderful feedback! We're glad you found our tutorials useful. Here's another video that we thought you might like: ruclips.net/video/aqHhpahguVY/видео.html. Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!
Hey Arsalan, thanks for the wonderful feedback! We're glad we could help. Do subscribe to our channel to stay posted on upcoming tutorials. You can also check out our complete training here: www.edureka.co/java-j2ee-soa-training. Cheers!
Hey Arjun, thanks for checking out our tutorial! We're glad you found it useful. Here's another video that we thought you might like: ruclips.net/video/aqHhpahguVY/видео.html. Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!
Iol, i don't know what is the issue but after watching this video twice and follow exactly i am still getting 404 in the end.....video is good maybe version problem is the issue
Thanks for showing interest in edureka kindly visit the channel for more videos our content creators are eagerly waiting for your suggestion to make new videos on your interest :) DO subscribe for the video update
Very Informative Video. Towards the end I am still getting 404 error even after following what was said to append /rest/hello at end of url.. Could you please assist
Hey Sridhar, thanks for the wonderful feedback! We're glad you liked our tutorial. There could be two main reasons for this, first could be because of some mistake made in code written in the web.xml file. Second could be because the tomcat server isn't running or is being used by another application. You can also try to access your application from your web browser by going to the path localhost:8080/RestTest/hello Hope this helps. Cheers!
Hey Amlan, thanks for checking out our tutorial! There could be two reasons for this. First could be because of some mistake made in code written in the web.xml file. Second could be because the tomcat server isn't running or is being used by another application. You can also try to access your application from your web browser by going to the path localhost:8080/RestTest/hello Hope this helps. Cheers!
Hi I did run on browser and did web.xml as per the tutorial but getting same error . HTTP Status 404 - Not Found Type Status Report Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Apache Tomcat/8.5.16
Had the same experience, try this: Unable to run the application, had to change some config in the Web.xml on this servlet-class param: >>> org.glassfish.jersey.servlet.ServletContainer without the ".class" extension and now able to run. Hope this helps.
We are super happy that Edureka is helping you learn better. Your support means a lot to us and it motivated us to create even better learning content and courses experience for you . Do subscribe the channel for more updates : ) Hit the bell icon to never miss an update from our channel : )
Followed the tutorial fully, but getting the error java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class in console, and 404 in browser.
I could resolve this issue by adding "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" as sevlet-class in web.xml
Thanks Santosh for sharing the solution. It might be useful to mention this at the top of the video description so everyone can easily fix the code before reporting the same issue repeatedly.
Getting Status 404 The origin server did not find a current representation for the target resource or is not willing to disclose that one exists After following all steps you have shown in video
Hey Varun, WordPress has various built-in and freely available plugins, you can use any of them. If you wish to learn about how to exclusively create a plug-in for WordPress, we shall consider it. Hope this helps!
So I'm following along with your tutorial, btw, you are a great teacher. So I downloaded jersey and extracted it, but when I open up eclipse, I don't see dynamic web. Since I'm fairly new to this, where else would I look?
Hey Tiya, For this you need to install eclipse for JavaEE Developers. Here is the link - www.eclipse.org/downloads/packages/release/indigo/sr2/eclipse-ide-java-ee-developers Hope this helps!
hello sir,I have watched your tutorial and it was very helpful .I followed all the steps as shown in the tutorial but then also i m getting " java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class " error ,why so?
Hey Mayur, thanks for checking out our tutorial. We're glad you found it useful. With regard to the error, Try to copy your jersey jar files into WebContent -> WEB-INF -> lib. Hope this helps. Cheers!
remove ".class" from "org.glassfish.jersey.servlet.ServletContainer.class" in web.xml for servlet class & check all libraries are copied to lib or not.
Hello i followed exact steps on latest version of jars and tomcat 9 server but i always get below error 404 with description as 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.'
While launching the application in the browser is it always necessary for the user to give the hard coded value of package name and class name in URL or there is some way we can configure them ?
Hey Sandeep, For this, you just have to check whether your tomcat is being set properly, if not re configure all the servers again and make sure servlet.api is present. Hope this helps!
Hey Sahil, Check if you have done proper configuration changes for Rest service in web.xml and if you are still getting the error post the exact code that you have used.
+Tha buli, thanks for checking out our tutorial! You can download Jersey files from the following link: goo.gl/Qie7ZN. You will need to extract the file and copy it inside /WebContent/WEB-INF/lib folder of your dynamic web project. Hope this helps. Cheers!
I could resolve this issue by adding "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" as sevlet-class in web.xml..credits goes to @santosh BT
It is showing error as error is showing in console org.apache.concurrent.excecutionexception Then the error coming in dialogue box as starting tomcat v9.0 server at localhost has encountered a problem. Server tomcat v9.0 server at localhost failed to start
Usage of POST in webswervice: if server is responsible for creating the ID's of the new resources then use POST, for example POST /users/ Now, POST will carry a key and value which client uses to send username=john and ID will be automatically generated by Server. Withour @queryParams(): You can get the query parameters grammatically, via “@Context UriInfo“ for example: import java.util.List; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.core.Context; import javax.ws.rs.core.Response; import javax.ws.rs.core.UriInfo; @Path("/users") public class UserService { @GET @Path("/query") public Response getUsers(@Context UriInfo info) { String from = info.getQueryParameters().getFirst("from"); String to = info.getQueryParameters().getFirst("to"); List orderBy = info.getQueryParameters().get("orderBy"); return Response .status(200) .entity("getUsers is called, from : " + from + ", to : " + to + ", orderBy" + orderBy.toString()).build(); } } Hope this helps :)
Had a port issue when trying to start the server, said 'Several ports (8005, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use.' Double-clicked the server down below in bottom window on Eclipse, changed server Port numbers from 8005, 8080, 8009, to 8008 (respectively), and that seemed to fix the issue.
Strange issue: my code is identical to yours, but if I included the ApplicationPath and core.Application packages, it returns a blank page when running server. If I do include them, it returns the "Hello from HTML" line, even though it is the third method listed....why is this?
Hi Pranavi, Go to the API Console. From the projects list, select a project or create a new one. If the APIs & services page isn't already open, open the left side menu and select APIs & services. On the left, choose Credentials. Click Create credentials and then select API key.
Got a question on the topic? Please share it in the comment section below and our experts will answer it for you. For Java Training Curriculum, Visit our Website: bit.ly/32Ymvde
Dude you are awesome. I am in this IT industry for last 20 yrs. you are one of a good teacher I have seen.
Hey Siva, we are glad you feel this way. Do subscribe to the channel and hit the bell icon to never miss an update from us in the future. Cheers!
The best Indian tutorial RUclips channel ever . I can understand every single thing very clearly that you teach👍🏻
Thanks a lot man! We were having a mental breakdown, but your video saved us! You are our hero!!
Very informative. Thank you very much ! The installation part is a bit too long and should be more concentrated on new and specific issues regarding ReST.
Hi, thank you for your valuable feedback, we have considered it . Do subscribe to our channel for more content, cheers :)
This is very nice and clear presentation.... thank you
Thank you. Very educational
Super useful, Thanks !!!
You're welcome 😊 Glad it was helpful!!!
IT IS GOOD VIDEO TO LEARN API
Hi, explanation is great Thanks But why you don't use example with JSON. I believe it is more common.
Hey Sabuhi, thanks for checking out our tutorial.
This is one of the implementation done through Rest API. There are several methods in Java to implement REST API and JSON is one of those. Since this is a beginner level tutorial, this is the simplest to start off with and that's why we have used it. Cheers!
This video is a excellent tutorial
Thank you for watching our videos. Do subscribe to our youtube channel and stay updated with our content. Cheers :)
really eudreka you guys are very informative and useful videos...
Hey Vijay, thanks for the wonderful feedback! We're glad you found our tutorials useful.
Here's another video that we thought you might like: ruclips.net/video/aqHhpahguVY/видео.html.
Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!
u r great edureka thank u for all of ur tutorials
Hey Arsalan, thanks for the wonderful feedback! We're glad we could help.
Do subscribe to our channel to stay posted on upcoming tutorials.
You can also check out our complete training here: www.edureka.co/java-j2ee-soa-training. Cheers!
Very well explained..Great tutorial
Muy bueno, aunque estaría bueno un ejemplo de CRUD.
should we need this xml configurations when we use spring boot ? and create an maven prjct or anyother prjct .
i started learning from edureka from java tutorials.Thank you very much
Hey Arjun, thanks for checking out our tutorial!
We're glad you found it useful. Here's another video that we thought you might like: ruclips.net/video/aqHhpahguVY/видео.html.
Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!
it is realy very helpful thanks
Iol, i don't know what is the issue but after watching this video twice and follow exactly i am still getting 404 in the end.....video is good maybe version problem is the issue
Hey Manish, yes version compatibility can be an issue. Try using the same version as used in this tutorial, you will not face this issue. Cheers :)
Thank you very much!!!
How to communicate & fetch details from different applications using REST API with url ..Kindly share video asap.
Thanks for showing interest in edureka kindly visit the channel for more videos our content creators are eagerly waiting for your suggestion to make new videos on your interest :) DO subscribe for the video update
Very Informative Video.
Towards the end I am still getting 404 error even after following what was said to append /rest/hello at end of url..
Could you please assist
Hey Sridhar, thanks for the wonderful feedback! We're glad you liked our tutorial.
There could be two main reasons for this, first could be because of some mistake made in code written in the web.xml file. Second could be because the tomcat server isn't running or is being used by another application. You can also try to access your application from your web browser by going to the path localhost:8080/RestTest/hello
Hope this helps. Cheers!
Hey Amlan, thanks for checking out our tutorial!
There could be two reasons for this. First could be because of some mistake made in code written in the web.xml file. Second could be because the tomcat server isn't running or is being used by another application. You can also try to access your application from your web browser by going to the path localhost:8080/RestTest/hello
Hope this helps. Cheers!
Hi I did run on browser and did web.xml as per the tutorial but getting same error .
HTTP Status 404 - Not Found
Type Status Report
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
Apache Tomcat/8.5.16
Had the same experience, try this:
Unable to run the application, had to change some config in the Web.xml on this servlet-class param:
>>> org.glassfish.jersey.servlet.ServletContainer
without the ".class" extension and now able to run.
Hope this helps.
Use org.glassfish.jersey.servlet.ServletContainer instead org.glassfish.jersey.servlet.ServletContainer.class
Hope this will fix your issue.
Great tutorial and easy to understand.
Super very good explanation crystal clear
Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)
i liked yours teaching style
Hey Gopal, thank you for appreciating oour work. Subscribe and stay tuned for updates in the future. :)
Nice video for beginners :) and very well explained .
Hey Kim, we are glad you loved the video. Do subscribe to the channel and hit the bell icon to never miss an update from us in the future. Cheers!
Thank you bro. Very nicely explained rest api
We are super happy that Edureka is helping you learn better. Your support means a lot to us and it motivated us to create even better learning content and courses experience for you . Do subscribe the channel for more updates : ) Hit the bell icon to never miss an update from our channel : )
thank you for nice class
Nice explanation with in 13 min
Hey Hari, we try to make out tutorials short and informative. We are glad that you liked our content. Subscribe to us and stay connected. Cheers :)
Thanks Edureka! this video was so helpful hoping more amazing videos from you guys in future...all the best!
Hey Varun, glad you loved the video. Do subscribe and hit the bell icon to never miss an update from us in the future. Cheers!
Followed the tutorial fully, but getting the error java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class in console, and 404 in browser.
I could resolve this issue by adding "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" as sevlet-class in web.xml
Hey Santosh, Glad it worked out.
Do subscribe to our channel to stay posted on upcoming tutorials. Cheers!
This is the correct solution, thanks!
thanks bro
Thanks Santosh for sharing the solution. It might be useful to mention this at the top of the video description so everyone can easily fix the code before reporting the same issue repeatedly.
thank you
Getting Status 404
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists
After following all steps you have shown in video
Thanks neel...you really explains thing very well with perfect example.
Thank you for watching our video. Do subscribe, like and share to stay connected with us. Cheers :)
Good explanation
Will we would be able to develop plugins for wordpress?
Hey Varun, WordPress has various built-in and freely available plugins, you can use any of them. If you wish to learn about how to exclusively create a plug-in for WordPress, we shall consider it.
Hope this helps!
pace so nice
So I'm following along with your tutorial, btw, you are a great teacher. So I downloaded jersey and extracted it, but when I open up eclipse, I don't see dynamic web. Since I'm fairly new to this, where else would I look?
Hey Tiya, For this you need to install eclipse for JavaEE Developers. Here is the link - www.eclipse.org/downloads/packages/release/indigo/sr2/eclipse-ide-java-ee-developers
Hope this helps!
hello sir,I have watched your tutorial and it was very helpful .I followed all the steps as shown in the tutorial but then also i m getting " java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer.class " error ,why so?
Hey Mayur, thanks for checking out our tutorial. We're glad you found it useful.
With regard to the error, Try to copy your jersey jar files into WebContent -> WEB-INF -> lib.
Hope this helps. Cheers!
Use "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" in web.xml
do not use a .class extension, just org.glassfish.jersey.servlet.ServletContainer
remove ".class" from "org.glassfish.jersey.servlet.ServletContainer.class" in web.xml for servlet class & check all libraries are copied to lib or not.
try setting org.glassfish.jersey.servlet.ServletContainer (without class) as ...
org.glassfish.jersey.servlet.ServletContainer
Hello i followed exact steps on latest version of jars and tomcat 9 server but i always get below error 404 with description as 'The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.'
Hey Mihir, Did you try running it as admin? That usually solves any firewall block issue. Try it out and let us know.
While launching the application in the browser is it always necessary for the user to give the hard coded value of package name and class name in URL or there is some way we can configure them ?
Hey Abbas, yes you need to use the hardcoded value. Hope this helps!
kinda useful
Hi ,
I have put jersey servlet jars in web-inf/lib and library also but still my tomcat not getting up and application is not running, pls help me
Hey Sandeep, For this, you just have to check whether your tomcat is being set properly, if not re configure all the servers again and make sure servlet.api is present.
Hope this helps!
I am not getting a restart server option after finish , so getting 404 error even after adding rest/hello
What can I do to solve it?
Hey Sahil, Check if you have done proper configuration changes for Rest service in web.xml and if you are still getting the error post the exact code that you have used.
Remove ".class" from servletContainer.class in tag servlet-class in web.xml, if already done then check for errors in console while server startup
@@edurekaIN Thanks for the video. Even I am getting 404 error even after adding rest/hello, refer web.xml content
JavaAPI
Java API
org.glassfish.jersey.servlet.ServletContainer.class
jersey.config.server.provider.packages
test
1
Java API
/rest/*
I am not able to view xml response, it is always giving error as whitespace is not allowed at this location.
Hey Mukul, "Put the string in a block as below:
hello sir. i try to download Jersey but unable to download it. whats an alternative
+Tha buli, thanks for checking out our tutorial!
You can download Jersey files from the following link: goo.gl/Qie7ZN. You will need to extract the file and copy it inside /WebContent/WEB-INF/lib folder of your dynamic web project. Hope this helps. Cheers!
how to consume the web services either soap or restful
Hey Sowbhagya, "searchmicroservices.techtarget.com/tip/REST-vs-SOAP-Choosing-the-best-web-service
Refer this blog. It might be of some help to you."
I am facing an issue. Trying 2 many times still getting an error 404. I have done exactly the same thing which u are doing in ur video. Assist me asap
Hey Musicat, can you tell us the exact error that you faced along with screenshot. We will definitely try helping you out. Cheers :)
I could resolve this issue by adding "org.glassfish.jersey.servlet.ServletContainer" instead of "org.glassfish.jersey.servlet.ServletContainer.class" as sevlet-class in web.xml..credits goes to @santosh BT
I was having the same issue and removing the ".class" worked, thanks
Worked Great thanks Bro.
thaks @narayana srikar
it works by removing this .class
It is showing error as error is showing in console org.apache.concurrent.excecutionexception
Then the error coming in dialogue box as
starting tomcat v9.0 server at localhost has encountered a problem.
Server tomcat v9.0 server at localhost failed to start
Hi Sir, its is really help full... could you please help me Usage of POST method use and how to insert with out useing queryParam ?
Usage of POST in webswervice: if server is responsible for creating the ID's of the new resources then use POST, for example
POST /users/
Now, POST will carry a key and value which client uses to send username=john and ID will be automatically generated by Server.
Withour @queryParams(): You can get the query parameters grammatically, via “@Context UriInfo“ for example: import java.util.List;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriInfo;
@Path("/users")
public class UserService {
@GET
@Path("/query")
public Response getUsers(@Context UriInfo info) {
String from = info.getQueryParameters().getFirst("from");
String to = info.getQueryParameters().getFirst("to");
List orderBy = info.getQueryParameters().get("orderBy");
return Response
.status(200)
.entity("getUsers is called, from : " + from + ", to : " + to
+ ", orderBy" + orderBy.toString()).build();
}
}
Hope this helps :)
Had a port issue when trying to start the server, said 'Several ports (8005, 8080, 8009) required by Tomcat v8.5 Server at localhost are already in use.'
Double-clicked the server down below in bottom window on Eclipse, changed server Port numbers from 8005, 8080, 8009, to 8008 (respectively), and that seemed to fix the issue.
404 error is coming->localhost:7080/JavaAPI/rest/hello please help me about this type issue
Hey Subelay, "You can try changing your port to 8080 instead of 7080. If the issue persists, you can reach back to us, we would be glad to help."
great explaination
Hey Dileep, we are glad you loved the video. Do subscribe and hit the bell icon to never miss an update from us in the future. Cheers!
Strange issue: my code is identical to yours, but if I included the ApplicationPath and core.Application packages, it returns a blank page when running server. If I do include them, it returns the "Hello from HTML" line, even though it is the third method listed....why is this?
Hey Edward, Can you please elaborate? have you tried stopping and restarting the service? That usually solves this issue.
how to create api key
Hi Pranavi, Go to the API Console.
From the projects list, select a project or create a new one.
If the APIs & services page isn't already open, open the left side menu and select APIs & services.
On the left, choose Credentials.
Click Create credentials and then select API key.
All the people who are getting 404 error, try to run the app in postman or in browser once the server is started. You will be good. Good luck.
many thanks !
You're welcome 😊 Glad you liked it!!
Thank you very much!
Thank you so much!!!
You're welcome!