Thank you so much for the error demonstration. It is very important for me! It shows that you don't have to be afraid of mistakes, you just have to deal with them. This video is very valuable!🙏
Hello Navin sir, this playlist is going very well, usually I dont comment on videos, however the kind of dedication you are taking and the content that you are making is mind blowing. Thank you for this and keep uploading. We are waiting to learn these things.
The problem why lombok is not working is due to IDE. Intellij doesn't understand the lombok features i.e getters , setters , constructors predefined method. To solve this error you need to install Lombok Plugin in your Intellij IDE
00:03 Understanding request mapping in Spring MVC 01:54 To send data from server to client in a suitable format. 03:40 Creating a class to represent a product with specific attributes 05:37 Introducing service layer in Spring MVC for separate business logic 07:23 Creating package structure and defining service methods 09:31 Troubleshooting port number issues in Spring MVC 11:29 Implementing Spring MVC logic 13:38 Troubleshooting issues with port number and code errors 16:10 Testing APIs using different tools and understanding API usage
@Telusko Sir, The issue your are facing that port is already in use is because your SpringBoot application re run automatically so when you are trying to run it again it gave you that error .So you don't have to re run it Sir. 😊
First of all, this is an excellent video. Many thanks to Telusko! Here, the @Component annotation in the Product class is the root cause of the problem. Any class with the @Component annotation is asked to have its "Bean" managed by Spring. To put it another way, we request that Spring generate a "Singleton" instance of this class that may be injected into other classes or components.
@Telusko I've tried different ways about the issue that you got. So here is the solution other than restarting. As we are considering the Product as a simple model so it shouldn't have @Component annotation. So keep @Data annotation and execute it will work.. Please correct me if I'm wrong..
Bruh, I tried with and without Lombok both and both were running good with having costructors and getter setters only, so, @Component was causing the issue, but I wanna know why? Don't we need an object of Product inside our IoC container?
@@SHIVAMKUMAR-gj3tdHere the Product model is not managed by Spring IoC bcz we are instantiated manually in ProductService class. If we wanna make it handle by the spring IoC then we have to create a configuration class and write the list there and call them in the ProductService constructor . If needed we have to use @comoonentScan annotation to scan for components... Note: I took help of copiolot to get the clear info
@@SHIVAMKUMAR-gj3td Here, the @Component annotation in the Product class is the root cause of the problem. Any class with the @Component annotation is asked to have its "Bean" managed by Spring. To put it another way, we request that Spring generate a "Singleton" instance of this class that may be injected into other classes or components. Hope this helps.
you could have just ran this in the cmd "netstat -ano | findstr :", which will provide you the port id and with port id you can stop the server port which was already running due to another console by following command "taskkill /PID /F" , andd its done the server port is no more running and ready to use for a new application.
For these problem you need to go setings in that build ->compile-> Annotation process you need enable the obtained 2nd option then Lombok will work all problems solve
Multiple server instant have already been created and didn't stop properly. If you're using windows, type below command in cmd netstat -aon | find /i "listening" | find "your_port_no" Hit the enter button and then, Taskkill /F /PID "type_PID_id_of_current_port" and then hit enter If you're using linux ps -aux | grep tomcat kill -9 TYPE_YOUR_PID_ID Hope it will work
int not found because you declare model as component, so your container trying to initiate it but failed because it didn't know what int that should be used. You can remove the error, by removing @component or adding empty constructor and thus give your container ability to initiate model but using default primitive values.
For lombok, I think we need to install that lombok plugin from intellij marketplace and also that configure plugin shown at bottom right 5:13 needs to be clicked
@Telusko , Amazing videos ! I was facing the same port issue while working with eclipse and I tried terminating that port exclusively and then restarting my java code, it works :) Command - lsof -i :8080 , then kill -9 Hope it works for you !
Same error was popping up in my machine server busy. I did this in command panel Step 1 = fuser 8080/tcp (check port running on localhost 8080) Step 2 = fuser -k 8080/tcp (To kill 8080)
The issue you're facing, where the response shows [{}, {}, {}] instead of the actual properties and values of the Product objects, is likely due to how the Product class is being serialized into JSON. By default, Jackson (the JSON library used by Spring Boot) serializes objects by their getters. So you need to create getter methods for all of the properties inside the Product class,or add @Getter lombok annotation : @Component @AllArgsConstructor @NoArgsConstructor @Getter public class Product { private int id; private String name; private double price; }
Thank you for sharing not just the results but the errors, it's good to see how somebody with good knowledge in programming deals with errors
Hi bro need help
Thank you so much for the error demonstration.
It is very important for me!
It shows that you don't have to be afraid of mistakes, you just have to deal with them.
This video is very valuable!🙏
bro i love to solve error
Spring made programming easy ❌ TELUSKO made Spring easy ✅
Hello Navin sir, this playlist is going very well, usually I dont comment on videos, however the kind of dedication you are taking and the content that you are making is mind blowing. Thank you for this and keep uploading. We are waiting to learn these things.
The problem why lombok is not working is due to IDE. Intellij doesn't understand the lombok features i.e getters , setters , constructors predefined method. To solve this error you need to install Lombok Plugin in your Intellij IDE
thanks! very useful!
Thats why i still use VS CODE
Thank you!
You don't teach, you educate! Thank you!
Bro's Teaching everything
that's soooooo gooood
goood to know how things work behind the scene so we can fix bugs pretty quickly
00:03 Understanding request mapping in Spring MVC
01:54 To send data from server to client in a suitable format.
03:40 Creating a class to represent a product with specific attributes
05:37 Introducing service layer in Spring MVC for separate business logic
07:23 Creating package structure and defining service methods
09:31 Troubleshooting port number issues in Spring MVC
11:29 Implementing Spring MVC logic
13:38 Troubleshooting issues with port number and code errors
16:10 Testing APIs using different tools and understanding API usage
@Telusko Sir, The issue your are facing that port is already in use is because your SpringBoot application re run automatically so when you are trying to run it again it gave you that error .So you don't have to re run it Sir. 😊
the actual problem is on place of restart if we run the already running program means it open in new terminal that's the issue
You are a Master Educator! And I am Lucky to learn from you Sir! Love from Tamilnadu ❤
First of all, this is an excellent video. Many thanks to Telusko! Here, the @Component annotation in the Product class is the root cause of the problem. Any class with the @Component annotation is asked to have its "Bean" managed by Spring. To put it another way, we request that Spring generate a "Singleton" instance of this class that may be injected into other classes or components.
You're amazing Sir. King of Java
its teaching....it's a style of teaching... helps a lot 😍
I really appreciate your hard work in creating such simple yet valuable content in your videos.
Thanks please don't stop making videos. I need it for my finaly year project
spring made programming easy ❌ but he did... yes, Navin Reddy made programming easy 💥
@Telusko I've tried different ways about the issue that you got. So here is the solution other than restarting.
As we are considering the Product as a simple model so it shouldn't have @Component annotation. So keep @Data annotation and execute it will work..
Please correct me if I'm wrong..
Bruh, I tried with and without Lombok both and both were running good with having costructors and getter setters only, so, @Component was causing the issue, but I wanna know why?
Don't we need an object of Product inside our IoC container?
@@SHIVAMKUMAR-gj3tdHere the Product model is not managed by Spring IoC bcz we are instantiated manually in ProductService class.
If we wanna make it handle by the spring IoC then
we have to create a configuration class and write the list there and call them in the ProductService constructor .
If needed we have to use @comoonentScan annotation to scan for components...
Note: I took help of copiolot to get the clear info
@@SHIVAMKUMAR-gj3td Here, the @Component annotation in the Product class is the root cause of the problem. Any class with the @Component annotation is asked to have its "Bean" managed by Spring. To put it another way, we request that Spring generate a "Singleton" instance of this class that may be injected into other classes or components. Hope this helps.
This time your code works for me. I face strange issues sometime and most of the time reset of Intellij fix the problem.
You're very good at teaching. I can't wait for the next lesson!
Thank you for making it easier to understand.
you could have just ran this in the cmd "netstat -ano | findstr :", which will provide you the port id and with port id you can stop the server port which was already running due to another console by following command "taskkill /PID /F" , andd its done the server port is no more running and ready to use for a new application.
Thank you for this video! Everything worked on my machine as well!
For these problem you need to go setings in that build ->compile-> Annotation process you need enable the obtained 2nd option then Lombok will work all problems solve
Thank you sir
Please continue this series
You are Good...!!
Explanation is Amazing!
Thank you for this video! Everything worked on my machine!
Multiple server instant have already been created and didn't stop properly.
If you're using windows, type below command in cmd
netstat -aon | find /i "listening" | find "your_port_no"
Hit the enter button and then,
Taskkill /F /PID "type_PID_id_of_current_port" and then hit enter
If you're using linux
ps -aux | grep tomcat
kill -9 TYPE_YOUR_PID_ID
Hope it will work
Thank you for the great video . please keep uploading more such kind of videos
Wow. amazing videos. Thank you for the videos Sir
Hi Navin!!!... the lombok works normally in my machine and it's typically you need to restart you system.
Hi Sir, please upload videos on regular basis.
Your content is superb✌️
THANKS FOR THIS AMAZING VIDEO!!! THANKS TELUSKO
Appreciate your every video! Thank you
These vids are amazing. More uploads please
Thank you
these videos are really helpful
int not found because you declare model as component, so your container trying to initiate it but failed because it didn't know what int that should be used. You can remove the error, by removing @component or adding empty constructor and thus give your container ability to initiate model but using default primitive values.
Really good lessons, keep updating please
For lombok, I think we need to install that lombok plugin from intellij marketplace and also that configure plugin shown at bottom right 5:13 needs to be clicked
Why are we considering using another version of the Lombok dependency? Sir, I believe the issue lies with the current version.
Great explanation, upload more lectures
Thank you sir for video ❤
Really lot of fun sir to learn spring boot
Appreciate the efforts!
Love your videos!
This is premium level content for free NGL
Top notch content!!
Thank you for the video.
Great work sir
best teatcher ever
In IntelliJ we have to enable runtime settings for lambok
thank you sir 🙂
make a default constructor in product for removing the error.
Nice Video Sir Thank You
you have to add lombok plugin to solve this issue
Lombok will work but use the annotations called @Setter and @Getter
Don't add @Component annotation for Product class, it will cause issues.
Thank you SIR
Thank you
@Telusko , Amazing videos ! I was facing the same port issue while working with eclipse and I tried terminating that port exclusively and then restarting my java code, it works :) Command - lsof -i :8080 , then kill -9 Hope it works for you !
thank you!
as it's taking time to upload videos, is there any other way that we can learn it fast?
i mean any course in udemy?
Great video
need a separate video for Lombok please!
Awesome video
Telusko ❤
good job
Same error was popping up in my machine server busy. I did this in command panel
Step 1 = fuser 8080/tcp (check port running on localhost 8080)
Step 2 = fuser -k 8080/tcp (To kill 8080)
Hi Sir, why are we using @Component annotation on Product class? We are not using it as a bean.
for modularity and encapsulation
How is that related here?
@Component is not necessary for Product class in this case, as we r manually creating object using new keyword inside Arrays.asList method
CFBR ❤
I don't know the real reason for the Port number issue. It worked for me in the first attempt with Port number 8080.
Interestingly i was able to use lombok library
Looks like, You didn't enable Lombok IntelliJ plugin. You got popup to configure Lombok in intelliJ at 5.09 minute in video.
Getting an empty list on my browser. Any suggestions to fix this?
The issue you're facing, where the response shows [{}, {}, {}] instead of the actual properties and values of the Product objects, is likely due to how the Product class is being serialized into JSON. By default, Jackson (the JSON library used by Spring Boot) serializes objects by their getters. So you need to create getter methods for all of the properties inside the Product class,or add @Getter lombok annotation :
@Component
@AllArgsConstructor
@NoArgsConstructor
@Getter
public class Product {
private int id;
private String name;
private double price;
}
I also had the issue with IntelliJ, 8080 still in use... that's annoying lol
Hey fellow alien, lombok works fine in my machine in Intellij Ultimate.
Im getting this error "Consider defining a bean of type 'int' in your configuration."
No sir Initially, lombok was not working for me as well, but after making some changes to the settings in Eclipse, it is working properly right now.
Lombok is not working for you because you need to enable lombok in your IDE
int range exceed
lombok library is always a problem for me as well
Lombok dependency problem sir
🎉
❤❤❤❤❤
nice!
I am getting blank json. Please help
Even I was facing the same issue.
package com.example.demo.model;
import org.springframework.stereotype.Component;
@Component
public class Product {
private int prodId;
private String pName;
private int price;
// Default constructor
public Product() {}
// Parameterized constructor
public Product(int prodId, String name, int price) {
this.prodId = prodId;
this.pName = name;
this.price = price;
}
// // Getters and setters
public int getProdId() {
return prodId;
}
//
// public void setProdId(int prodId) {
// this.prodId = prodId;
// }
//
public String getpName() {
return pName;
}
//
// public void setpName(String pName) {
// this.pName = pName;
// }
//
public int getPrice() {
return price;
}
//
// public void setPrice(int price) {
// this.price = price;
// }
}
@@deepak_jain i am facing application failed to start
Same issue any solution to this
@@deepak_jainsame issue
@telusko
💝
5.09
layers simplified
sudo lsof -nP -iTCP -sTCP:LISTEN
Please daily upload video sir... what happened to you 😢
Lewis Ruth Young Shirley Robinson Richard
wass here
ncccccceeeeeeeeeeeeee
thank you
❤❤❤