Java RESTful Web Services Tutorial for Beginner with Jersey and Tomcat

  Рет қаралды 41,823

Code Java

Code Java

Күн бұрын

Пікірлер: 90
@scientist_nick
@scientist_nick 3 жыл бұрын
I originally spent more than 24 hours trying to understand REST Web Services with Eclipse Jersey (I work mostly with mobile and web apps as a developer). When I went through your video and your webpage on this, I could replicate everything and understand all of the things you mentioned. You deserve an accolade what can I say, thanks a bunch. I will recommend your video to my colleagues as well which are learning this.
@CodeJava
@CodeJava 3 жыл бұрын
I'm very glad that you found my video helpful. Thanks and come to my channel more often.
@archana123ist
@archana123ist 8 күн бұрын
Thank you so much! I was stuck with exceptions and your video, helped me a lot and made my program work! Appreciate your efforts!
@CodeJava
@CodeJava 7 күн бұрын
You're welcome! Glad it helped! Check out more videos here: kzbin.info/aero/PLR2yPNIFMlL90yhBvXzaQWc3ID40tzilk
@GhanaTableTennis
@GhanaTableTennis 4 жыл бұрын
Thanks a million for this tutorial. The tools I use are Glassfish 5.0, Java 8, Netbeans 11, and JEE8. Following your tutorial with such a setup works like charm. Thanks for sharing your knowledge.
@CodeJava
@CodeJava 4 жыл бұрын
Glad it helped
@ruixue6955
@ruixue6955 4 жыл бұрын
3:36 steps 5:16 convert project to Maven 5:50 add Jersey API 14:52 parameter config for org.glassfish.jersey.servlet.ServletContainer
@Sirmontmanful
@Sirmontmanful 4 жыл бұрын
Great tutorial, man, video is almost 2 years old and it's still relevant
@CodeJava
@CodeJava 4 жыл бұрын
Glad to know that. Happy coding!
@tausifiqbal9451
@tausifiqbal9451 2 жыл бұрын
Thank you so much for such great video , finally I created REST Web Services with jersey without any error😊.
@CodeJava
@CodeJava 2 жыл бұрын
Welcome 👍
@amaryadav8703
@amaryadav8703 3 жыл бұрын
Thank you for this simple and clear tutorial, you are a saviour!
@CodeJava
@CodeJava 3 жыл бұрын
You're welcome!
@arunprajapati6445
@arunprajapati6445 2 жыл бұрын
Thank you for such an explanatory tutorial ! You deserve a big clap .
@CodeJava
@CodeJava 2 жыл бұрын
You are welcome!
@skhandle123
@skhandle123 4 жыл бұрын
Finally got no 404 error after watching your video. Thanks a ton😄
@CodeJava
@CodeJava 4 жыл бұрын
Happy to help
@carloseduardorodriguezlope3542
@carloseduardorodriguezlope3542 3 жыл бұрын
How did you do it? I'm still receiving the 404 error, I follow the example with Netbeans 12.4 using jersey 3.0.2
@ahmadjk
@ahmadjk 2 жыл бұрын
Great tutorial, simple and practical. Thanks for the efforts!
@CodeJava
@CodeJava 2 жыл бұрын
You're welcome!
@HariHaran-wv4pz
@HariHaran-wv4pz Жыл бұрын
Thank you , such a great video...👌
@CodeJava
@CodeJava Жыл бұрын
Glad you liked it!
@kamilrozwaka5221
@kamilrozwaka5221 2 жыл бұрын
Thanks a lot, your videos saved my life again!
@CodeJava
@CodeJava 2 жыл бұрын
Glad I could help!
@tsuiben6528
@tsuiben6528 Жыл бұрын
Thank you for the tutorial.
@CodeJava
@CodeJava Жыл бұрын
you're welcome.
@jinbeanpark9021
@jinbeanpark9021 2 жыл бұрын
Thanks for sharing the good tutorial video!
@CodeJava
@CodeJava 2 жыл бұрын
Glad it was helpful!
@fernandolivia1571
@fernandolivia1571 4 жыл бұрын
Thank you so much, this tuturial is excellent ...it helped me a lot.
@CodeJava
@CodeJava 4 жыл бұрын
Glad it helped! Also check my playlist for Web Services here: kzbin.info/www/bejne/moHNi6qYg86Veas
@arulmurugan6878
@arulmurugan6878 5 жыл бұрын
Thank you so much for this video
@christiancamilogutierrezmo3329
@christiancamilogutierrezmo3329 3 жыл бұрын
Awesome tutorial!!! It would be great, that you teach how to consume the web service with a web-form...!!! Greetings from Colombia!!!
@CodeJava
@CodeJava 3 жыл бұрын
then you need to use AJAX with Javascript/jQuery. This video will give you some ideas: kzbin.info/www/bejne/bZ6WaWl9eq-EqqM
@ucmanhpham5647
@ucmanhpham5647 4 жыл бұрын
From Vietnam with love
@CodeJava
@CodeJava 4 жыл бұрын
Thank you. Enjoy learning & happy coding!
@yashbansal1548
@yashbansal1548 4 жыл бұрын
Can you please give some insights on what does , , tags signifies and from where do u got their values.
@CodeJava
@CodeJava 4 жыл бұрын
That XML stuff is used to declare a Servlet (Jersey Servlet Container in this case) to intercept the requests to handle incoming connections from the clients. Jersey Servlet Container will identify if the requests are for the RESTful webservices or not, and handle accordingly. You can find the values in the official Jersey document.
@1995taunus
@1995taunus 4 жыл бұрын
Thank you! Great tutorial!
@CodeJava
@CodeJava 4 жыл бұрын
You're very welcome!
@dickyr4437
@dickyr4437 3 жыл бұрын
I followed your steps to create the Dynamic Web Project and after I clicked Finish, I got the following error in web.xml: Multiple annotations found at this line: - There is '1' error in 'javaee_7.xsd'. - schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not . I have the latest versions of Tomcat (10.0.6) and Eclipse (2021-03). I see that my Dynamic Web Module Version is 4.0 (default) whereas yours is 3.0. Can you help resolve the error?
@CodeJava
@CodeJava 3 жыл бұрын
I have not used Tomcat 10. Maybe it is causing the problem?
@vauvau1823
@vauvau1823 4 жыл бұрын
Thank you for the dedication to French people i'm from belgium and i'm following your course on udemy. Thanks again. it would be great to make the same e-commerce web application using Spring ,hibernate and if possible create and consume a web service. I would be taker. Merci beaucoup
@CodeJava
@CodeJava 4 жыл бұрын
I'm currently making such a course as you mentioned, with Spring Boot, Thymeleaf, Bootstrap, jQuery and Restful Webservices.
@vauvau1823
@vauvau1823 4 жыл бұрын
@@CodeJava Nice!!!!!!!!!!! We are waiting
@nagitokomaeda3021
@nagitokomaeda3021 2 жыл бұрын
Hello! I am getting "localhost refused to connect" any idea how to fix this? At first it was because port 8080 was in used but I changed that already and I am still not able to connect to the localhost.
@LonelyAncient
@LonelyAncient 2 жыл бұрын
it's a bit late but for anyone else getting this error, it might be because the port you chose is already in use or because you forgot to start the server after making changes.
@arulmurugan6878
@arulmurugan6878 5 жыл бұрын
please give me spring mav using restful web services complete video sir.
@GVB438
@GVB438 3 жыл бұрын
how can we use connection pool c3po,bonecp etc with rest api's jersy
@CodeJava
@CodeJava 3 жыл бұрын
check my written tutorial on how to use C3P0 with Hibernate: www.codejava.net/frameworks/hibernate/how-to-use-c3p0-database-connection-pooling-library-with-hibernate-jpa
@TheMrCalindo
@TheMrCalindo 4 жыл бұрын
didn't you say jax-rs in the description not jax-ws ??
@CodeJava
@CodeJava 4 жыл бұрын
this is for JAX-RS (Java RESTful webservices)
@ansar6662
@ansar6662 2 жыл бұрын
Concise👍
@CodeJava
@CodeJava 2 жыл бұрын
thanks for watching.
@saliqabano8431
@saliqabano8431 3 жыл бұрын
Maven Dependencies are not appearing in my project after configure and convert to maven project can anybody help?
@CodeJava
@CodeJava 3 жыл бұрын
could you open the pom.xml file?
@case406
@case406 4 жыл бұрын
Thank you so much!!
@CodeJava
@CodeJava 4 жыл бұрын
You're welcome!
@case406
@case406 4 жыл бұрын
@@CodeJava Is there some sort of problem if you want to display a mediatype.application_xml because i it gives me the error 500 and I have no clue?
@CodeJava
@CodeJava 4 жыл бұрын
It should give the reason for 500 error. What is it?
@afomiaterefe2557
@afomiaterefe2557 3 жыл бұрын
what can i do to solve the problem i got 404 error
@CodeJava
@CodeJava 3 жыл бұрын
check URL mapping, view name, etc. 404 meaning a resource not found - due to typos in URL, name, path, etc.
@davidwarner2491
@davidwarner2491 4 жыл бұрын
I am getting http status 500 error root cause Java.lang.IllegalArgumentException
@CodeJava
@CodeJava 4 жыл бұрын
that error means one of parameters has invalid value. Please post the full exception stack trace so I can identify the root cause.
@davidwarner2491
@davidwarner2491 4 жыл бұрын
Can you give me your mail id? I'll mail you.Thanks in advance
@CodeJava
@CodeJava 4 жыл бұрын
please post here. I don't support via email.
@davidwarner2491
@davidwarner2491 4 жыл бұрын
@@CodeJava ok this is my error, when i go to :localhost:8081/ToAru/rest/start Type Exception Report Message Servlet.init() for servlet [t-shirt] threw exception Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception javax.servlet.ServletException: Servlet.init() for servlet [t-shirt] threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:830) Root Cause java.lang.IllegalArgumentException jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:171) jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:153) jersey.repackaged.org.objectweb.asm.ClassReader.(ClassReader.java:425) org.glassfish.jersey.server.internal.scanning.AnnotationAcceptingListener.process(AnnotationAcceptingListener.java:170) org.glassfish.jersey.server.ResourceConfig.scanClasses(ResourceConfig.java:915) org.glassfish.jersey.server.ResourceConfig._getClasses(ResourceConfig.java:869) org.glassfish.jersey.server.ResourceConfig.getClasses(ResourceConfig.java:775) org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.(ResourceConfig.java:1206) org.glassfish.jersey.server.ResourceConfig$RuntimeConfig.(ResourceConfig.java:1178) org.glassfish.jersey.server.ResourceConfig.createRuntimeConfig(ResourceConfig.java:1174) org.glassfish.jersey.server.ApplicationHandler.(ApplicationHandler.java:345) org.glassfish.jersey.servlet.WebComponent.(WebComponent.java:392) org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:177) org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:369) javax.servlet.GenericServlet.init(GenericServlet.java:158) org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373) org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868) org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590) org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) java.base/java.lang.Thread.run(Thread.java:830) Note The full stack trace of the root cause is available in the server logs. //////////////////////////// this is my Touma.java class: package com.rail; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; @Path("/start") public class Touma { @GET @Produces(MediaType.TEXT_PLAIN) public String getMsg() { return "hello"; } } /////////////////////////////// And this is my web.xml: ToAru t-shirt org.glassfish.jersey.servlet.ServletContainer jersey.config.server.provider.packages com.rail 1 t-shirt /rest/* index.html index.htm index.jsp default.html default.htm default.jsp /////////////////////////////////////////
@imanfatima682
@imanfatima682 3 жыл бұрын
Please teach us the same thing on Netbeans Ide plz
@CodeJava
@CodeJava 3 жыл бұрын
Oh, I'll try with NetBeans. but the code is same regardless of IDE.
@imanfatima682
@imanfatima682 3 жыл бұрын
@@CodeJava Yah Plz I will wait
@ggAtr
@ggAtr 4 жыл бұрын
It's secure??
@CodeJava
@CodeJava 4 жыл бұрын
No, it's not because no authentication required.
@konstantine5711
@konstantine5711 3 жыл бұрын
thanks alot!
@CodeJava
@CodeJava 3 жыл бұрын
You're welcome!
@nvs4600
@nvs4600 4 жыл бұрын
Are you Vietnamese?
@CodeJava
@CodeJava 4 жыл бұрын
absolutely I am
@nvs4600
@nvs4600 4 жыл бұрын
@@CodeJava Can I have a question for you?
@CodeJava
@CodeJava 4 жыл бұрын
sure, feel free to ask.
@nvs4600
@nvs4600 4 жыл бұрын
​@@CodeJava 15:55 Why is param-name like this? I searched for that on Google but I still can't understand it.
@CodeJava
@CodeJava 4 жыл бұрын
@@nvs4600 it is required by Jersey, so it will know where to load webservices classes.
@khanhduy9540
@khanhduy9540 3 жыл бұрын
Anh học tiếng anh như thế nào vậy ạ
@CodeJava
@CodeJava 3 жыл бұрын
anh có học đâu, nên nghe mới lởm như vậy :)
@khanhduy9540
@khanhduy9540 3 жыл бұрын
@@CodeJava em cũng muốn nói được như anh vậy ^^
@saravananmarimuthu6278
@saravananmarimuthu6278 25 күн бұрын
When I implemented the same with Tomcat10/11 is not working as you mentioned. Throws an error with servlet filter issue. Exception jakarta.servlet.ServletException: Error instantiating servlet class [org.glassfish.jersey.servlet.ServletContainer] Root Cause java.lang.NoClassDefFoundError: javax/servlet/Filter can you help me to understand to solve the issue with latest tomcat server with latest EclipseIDE/STS IDE.
@CodeJava
@CodeJava 24 күн бұрын
Tomcat 10 uses Jakarta Servlet instead of Java Servlet. So you need to change import package from javax.* to jakarta.*
@huuvan4500
@huuvan4500 3 жыл бұрын
Nghe a đọc tiếng anh như mấy ông bên Ấn ghê :)))
@CodeJava
@CodeJava 3 жыл бұрын
haha, em có hiểu gì hem?
@huuvan4500
@huuvan4500 3 жыл бұрын
@@CodeJava Dạ có a
@karlaaraujo6077
@karlaaraujo6077 3 жыл бұрын
Thank you for this tutorial
@CodeJava
@CodeJava 3 жыл бұрын
You're welcome 😊
Java RESTful Web Services CRUD API Examples with Jersey and Tomcat
1:34:30
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
She made herself an ear of corn from his marmalade candies🌽🌽🌽
00:38
Valja & Maxim Family
Рет қаралды 18 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 11 МЛН
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Java XML Web Services Tutorial for Beginner Part 1 (JDK 8)
21:28
REST API & RESTful Web Services Explained | Web Services Tutorial
15:33
What is a REST API?
9:12
IBM Technology
Рет қаралды 1,6 МЛН
Best of CES 2025
14:50
The Verge
Рет қаралды 556 М.
Code and Deploy Java XML Web Services (JAX-WS) on Tomcat
26:34
Why living in Canada has become Impossible
17:01
Hindsight
Рет қаралды 6 МЛН
What is REST API? | Web Service
11:28
Telusko
Рет қаралды 3,1 МЛН
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН