Hey guys, at czcams.com/video/7PsjGI-88sc/video.html the property spring.datasource.initialize property is Deprecated with latest Spring Boot Releases, so use the property spring.datasource.initialization-mode=always as a replacement for that property
This is excellent is so hard finding rich content in CZcams that guide intermediate learners, what is the best way to use these tutorials, is it by cloning both the front /backend? or watch your video and code along with you? Im trying to figure out the best way to take advantage of this great opportunity and learn as much as I can , Big thank you
The annotation @NotBlank is deprecated and I cannot get it working nor find alternatives. I've tried both imports: import javax.validation.constraints.NotBlank like you have and import org.hibernate.validator.constraints.NotBlank; The example SpringBoot version used is 2.1.9 and I am using 2.3.1. Please advise, thanks.
search for javax validation dependency in mvn repository. try thi s javax.validation validation-api 2.0.1.Final and also look at this stackoverflow.com/questions/50017134/javax-validation-notblank-missing-validator
Teguh Pratama is correct, however it's better to use the dependency provided by Spring instead of using the javax validation library. org.springframework.boot spring-boot-starter-validation
Your tutorials is very helpful for me but I cannot see tables in my database what problems I have facing I don't know because I am beginners and I want to know how to solve this problem
really good :) when will be the next part 4? I am new to spring boot 2.. but it seems that i need to manually setup user registrations etc. Does spring ecosystem has something similar to Laravel or Rails where most stuffs are in place. I tried JHipster 6, quite bulky.
Hi, there is nothing official from Spring but there are some libraries like Okta, Auth0 which you can use. An open-source alternative for these would be Keycloak. Check them out :)
How did you avoid the CORs problem? I am locally running both the front end and the backend, but I get "Access to XMLHttpRequest at 'localhost:8080/api/auth/signup' from origin 'localhost:4200' has been blocked by CORS policy:" when I try to log in.
Use 'always' without quotes if you want to always initialize the datasource. docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/jdbc/DataSourceInitializationMode.html
Good Work. I have one problem with creating tables, It seems like the table is not created when I run the application. Note: I have created schema already
Hi Do you see any error, make sure you have the property Spring.jpa.hibernate.ddl-auto as created (or) updated www.github.com/SaiUpadhyayula/spring-reddit-clone/tree/master/src%2Fmain%2Fresources%2Fapplication.properties
hi could you elaborate what issue you are facing ? DB setup is straight forward, all the tables will be automatically created by hibernate at the time of application startup.
what is the database structure like ? and it keeps telling me that (Many To One' attribute type should not be 'User' ) in every entity that has a User table link to it. could you please help with that
I attached added the ER diagram for the DB Structure inside the blog post. programmingtechie.com/2019/09/30/build-a-full-stack-reddit-clone-with-spring-boot-and-angular-part-1/ You can find it under section - "Database Schema Diagram" I Hope it helps.
Im getting this error when i try to run it . [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.5.RELEASE:run (default-cli) on project repostit: Application finished with exit code: 1 -> [Help 1]
At 6:37 i want to add tag in Post Model like private List tags ; Like your's youtube-master. But i got the problem Could not determine type for: java.util.List, at table: post, for columns: [org.hibernate.mapping.Column(tags)] Please help me sir
Hi, I like Intellij more than VS Code 🙂 If possible I would have also moved the frontend part to Intellij (webstorm) but I don't have license for it. I use Intellij in my day to day work and I am so used to that controls and shortcuts 🙂
@@ProgrammingTechie Thanks for the reply! Also What's the Run/Debug Configuration? Mine just shows add configuration when I open the project so I can't run the project. Seeing the icon in the top right corner in the video I figured that it is maybe an Application Run/Debug configuration but can't seem to set it up correctly and couldn't find the appropriate setting online.
Fixed the configuration issue by deleting all the files and then starting fresh. IntelliJ asks when we first start the project if the project is eclipse or maven, I mistakenly clicked okay on eclipse without noticing which created this issue. Incase someone else might have the same issue.
it is not always mandatory, as we are extending the JpaRepository interface from Spring Data, Spring Framework will automatically detect the repository class and add the beans to the spring context.
Hello can you do a project with spring framework at backend and plain html and css at frontend? I haven't learned Angular so it is hard to follow along It would be great help!
Hi, Thanks for the input, I am right now not able to produce any videos for another 1-month minimum. After that, I am planning to do a Spring MVC Tutorial where we can build a Recipe Book application using Spring MVC and Thymeleaf Templates in the frontend. Please do subscribe to the channel to get notified for these videos :)
I followed this tutorial and in the end, when I launched "localhost:8080" , it is redirecting to "localhost:8080/login" and is showing the login page. I'm wondering from where does it arrive. Can you please tell me what's happening here?
This is expected, make sure that the tables are created successfully in the database and follow the next part. The login page you are seeing is the default security settings from Spring Security. In the next part we will change this configuration to make it fit for our application.
@@ProgrammingTechie I'm a newbie in Database field. Although I successfully created the schema as you suggested in MYSQL WORKBENCH. But I can't see the tables in the "spring-reddit-clone" schema, even after clicking on "Refresh All" in the context menu, which appears by right clicking on schema. Can you please suggest what should I do to see the tables? Also, I've used the exact same properties (except my own DB username and password) in application.properties file whch is present on your github link.
@@DeepanshuGabba If you are able to start the application after creating the classes inside the model and repository package and setting the application.properties, then you should see the tables created automatically inside the schema.
I used to have the following error : org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL ... Basically, Hibernate couldn't create any tables. In application.properties I changed spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect to spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
The tables are generated automatically at the time of app startup so there is no need of sql script. You just have to create the schema before starting the application
When I am sending localhost:8080/api/auth/signup , I am getting 500 Internal server error :( It's been a week I am struggling. Can anyone help me with that ? Anyone had the same issue ?
@@ProgrammingTechie When I am debugging signup method in controller by putting breakpoint in authService.signup(registerRequest); I am getting this message : com.mirjalolcode.springredditclone.exceptions.SpringRedditException: Exception occurred when sending mailtest1@gmail.com
@@GoogleUser-is9zj this is not complete information, can you paste the complete stacktrace in pastebin and send me the link ? Also send me the github link of your source code.
This is the best video I found on Internet. Thanks man. Please keep uploading such amazing videos.
Thank you, will do my best
I watched your spring blog tutorial. it was awesome and smooth. now I want to start watching and coding with this tutorial very interestingly.
Thank you, happy learning
the content and way of presenting is too good.
the channel is underrated and not reaching masses
keep up the good work
Thanks :)
You are right. I can learn and code step by step with his video.
Loved your videos thanks for sharing Lots of knowledge we can't find in other tutorial your tutorials are really worth it the time
Thank you :)
Thanks for the great tutorial. Your teaching style is awesome
Really good project and this guy have good programming skills and nice education. Thanks!
Thanks for the nice words, man :)
Wow very good contents, View Count and sub count for your channel are criminally low, all the best
Thanks for the uploading this tutorial...Keep uploading the more videos.
Sure I will 🙂
WOW ... please keep make tutorial like this ... it's amazing tutorial
Your tutorials are awesome. Do you have detailed video on unit testing using Mockito?
really good project! thank you!
Thank you :)
Hey guys, at czcams.com/video/7PsjGI-88sc/video.html the property spring.datasource.initialize property is Deprecated with latest Spring Boot Releases, so use the property spring.datasource.initialization-mode=always as a replacement for that property
This is excellent is so hard finding rich content in CZcams that guide intermediate learners, what is the best way to use these tutorials, is it by cloning both the front /backend? or watch your video and code along with you?
Im trying to figure out the best way to take advantage of this great opportunity and learn as much as I can , Big thank you
I have noticed that you have not impl class of service, does it affect us anyway if we implement using the interface?
Why do you use One To Many relationship which create third table?
The annotation @NotBlank is deprecated and I cannot get it working nor find alternatives. I've tried both imports: import javax.validation.constraints.NotBlank like you have and import org.hibernate.validator.constraints.NotBlank; The example SpringBoot version used is 2.1.9 and I am using 2.3.1. Please advise, thanks.
search for javax validation dependency in mvn repository. try thi s
javax.validation
validation-api
2.0.1.Final
and also look at this stackoverflow.com/questions/50017134/javax-validation-notblank-missing-validator
Teguh Pratama is correct, however it's better to use the dependency provided by Spring instead of using the javax validation library.
org.springframework.boot
spring-boot-starter-validation
Cannot resolve column 'userId' , Cannot resolve column 'id' in @JoinColumn. I tried everything, and there is no way to fix this. Any suggestion ?
Post your code in github, I'll take a look
@@walid373 Really appreciate that you are taking initiative to help others :)
Please also provide in your github repository for the springboot project guidance on how to set it up and run.
Thanks for the input, I will try to add this 👍
If you could do that today that would he a lifesaver. Thank you so much!!
Your tutorials is very helpful for me but I cannot see tables in my database what problems I have facing I don't know because I am beginners and I want to know how to solve this problem
really good :) when will be the next part 4?
I am new to spring boot 2.. but it seems that i need to manually setup user registrations etc. Does spring ecosystem has something similar to Laravel or Rails where most stuffs are in place. I tried JHipster 6, quite bulky.
Hi, there is nothing official from Spring but there are some libraries like Okta, Auth0 which you can use. An open-source alternative for these would be Keycloak. Check them out :)
Part 4 will be out soon in a couple of days, I am still recording the video.
When I sending request for sign up then show me error unauthorised
Do you use design patterns in job ? For example CQRS, DDD
We use domain driven design principles
How did you avoid the CORs problem? I am locally running both the front end and the backend, but I get "Access to XMLHttpRequest at 'localhost:8080/api/auth/signup' from origin 'localhost:4200' has been blocked by CORS policy:" when I try to log in.
Hello.
Thank you very much I learned a lot.
Wonderfull work -)
Thank you. Glad it was helpful!
@@ProgrammingTechie Yes it was thanks again ... waiting for the next about testing ... very useful :-)
u are the best good job
Sir how to create the jks file and how it is related to our code.
Also, could we not use boolean for vote type instead of enum.
Hey Nate, for sure we can, I just followed the approach which came to my mind when trying to write code for the tutorial. :)
This has been deprecated in Spring Boot 2.2.5 -> spring.datasource.initialize=true .. so what replacement should I use?
Hey thanks for pointing it out, will check and reply you soon
Use 'always' without quotes if you want to always initialize the datasource. docs.spring.io/spring-boot/docs/current/api/org/springframework/boot/jdbc/DataSourceInitializationMode.html
Good Work. I have one problem with creating tables, It seems like the table is not created when I run the application.
Note: I have created schema already
Hi
Do you see any error, make sure you have the property
Spring.jpa.hibernate.ddl-auto as created (or) updated
www.github.com/SaiUpadhyayula/spring-reddit-clone/tree/master/src%2Fmain%2Fresources%2Fapplication.properties
@@ProgrammingTechie Hi Thanks , it worked
Did you only create schema , or you added tables also?
Does still work on May 2022?
Im a lil lost on how to due the data base. any change you would a tutorial about that or may point in the right directiopn?
hi could you elaborate what issue you are facing ? DB setup is straight forward, all the tables will be automatically created by hibernate at the time of application startup.
@@ProgrammingTechie thank you for ur answer it took me a lil to realized that. First time working with Hibernate. Great tutorial!!
what is the database structure like ?
and it keeps telling me that (Many To One' attribute type should not be 'User' ) in every entity that has a User table link to it.
could you please help with that
I attached added the ER diagram for the DB Structure inside the blog post.
programmingtechie.com/2019/09/30/build-a-full-stack-reddit-clone-with-spring-boot-and-angular-part-1/
You can find it under section - "Database Schema Diagram"
I Hope it helps.
thank you so much
Im getting this error when i try to run it .
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.5.RELEASE:run (default-cli) on project repostit: Application finished with exit code: 1 -> [Help 1]
At 6:37 i want to add tag in Post Model like
private List tags ;
Like your's youtube-master. But i got the problem
Could not determine type for: java.util.List, at table: post, for columns: [org.hibernate.mapping.Column(tags)]
Please help me sir
i just add @ElementCollection on top and it working!!
Hello! why do you use two different IDEs? Why not create all of the project using VS Code?
Hi, I like Intellij more than VS Code 🙂
If possible I would have also moved the frontend part to Intellij (webstorm) but I don't have license for it.
I use Intellij in my day to day work and I am so used to that controls and shortcuts 🙂
@@ProgrammingTechie Thanks for the reply!
Also What's the Run/Debug Configuration? Mine just shows add configuration when I open the project so I can't run the project. Seeing the icon in the top right corner in the video I figured that it is maybe an Application Run/Debug configuration but can't seem to set it up correctly and couldn't find the appropriate setting online.
Fixed the configuration issue by deleting all the files and then starting fresh. IntelliJ asks when we first start the project if the project is eclipse or maven, I mistakenly clicked okay on eclipse without noticing which created this issue. Incase someone else might have the same issue.
why we did not use @repository annotation in repositories?
it is not always mandatory, as we are extending the JpaRepository interface from Spring Data, Spring Framework will automatically detect the repository class and add the beans to the spring context.
Hello can you do a project with spring framework at backend and plain html and css at frontend?
I haven't learned Angular so it is hard to follow along
It would be great help!
Hi, Thanks for the input, I am right now not able to produce any videos for another 1-month minimum.
After that, I am planning to do a Spring MVC Tutorial where we can build a Recipe Book application using Spring MVC and Thymeleaf Templates in the frontend.
Please do subscribe to the channel to get notified for these videos :)
I followed this tutorial and in the end, when I launched "localhost:8080" , it is redirecting to "localhost:8080/login" and is showing the login page. I'm wondering from where does it arrive. Can you please tell me what's happening here?
This is expected, make sure that the tables are created successfully in the database and follow the next part.
The login page you are seeing is the default security settings from Spring Security.
In the next part we will change this configuration to make it fit for our application.
@@ProgrammingTechie I'm a newbie in Database field. Although I successfully created the schema as you suggested in MYSQL WORKBENCH. But I can't see the tables in the "spring-reddit-clone" schema, even after clicking on "Refresh All" in the context menu, which appears by right clicking on schema. Can you please suggest what should I do to see the tables? Also, I've used the exact same properties (except my own DB username and password) in application.properties file whch is present on your github link.
I got the error. Location of Model and repository folder was incorrect
@@DeepanshuGabba If you are able to start the application after creating the classes inside the model and repository package and setting the application.properties, then you should see the tables created automatically inside the schema.
@@ProgrammingTechie yeah thanks
5:19 @NotBlank not working
I used to have the following error :
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL ...
Basically, Hibernate couldn't create any tables.
In application.properties I changed
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect
to
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
cumbaa pure io
Thanks a lot, you are the best, please keep going to make tutorial like this
Hey Thank you, I will try my best. Right now I am unable to produce any videos for min 1 month. Will start producing videos after this period :)
yeah, no problem, Im sure Spring and Angular is a big enough tutorial, and you spent a lot of time doing it. really appreciate to you..
Why don't we use @ManyToMany relationship for SubReddit and User? Thanks :v
Nice. Where can I find SQL script for database?
The tables are generated automatically at the time of app startup so there is no need of sql script. You just have to create the schema before starting the application
Where can I find the sql script?
Hi you don't need sql script, the tables will be created automatically when you start the application.
hey bro why we use @ManyToOne & OnetoMany relationship
Hard to answer this in a comment, you cab read this tutorial for more information on this: www.baeldung.com/hibernate-one-to-many
Is this Java 8 or other versions of Java?
It's java 8
Get rid of User.userId and make User.username the PK.
Please do help me
is this same from freecodecamp.org
Yes 🙂
Can i get the source code
Please check the first Link in the description section. You can find link to github inside the blog post
😭😭😭 i really hope that was with Django + angular
Oops :)
When I am sending localhost:8080/api/auth/signup , I am getting 500 Internal server error :( It's been a week I am struggling. Can anyone help me with that ? Anyone had the same issue ?
What's the error you see in the stack trace ? We cannot help you without any details 🙂
@@ProgrammingTechie {
"timestamp": "2021-03-24T15:41:05.512+00:00",
"status": 500,
"error": "Internal Server Error",
"message": "",
"path": "/api/auth/signup"
}
@@ProgrammingTechie When I am debugging signup method in controller by putting breakpoint in authService.signup(registerRequest); I am getting this message : com.mirjalolcode.springredditclone.exceptions.SpringRedditException: Exception occurred when sending mailtest1@gmail.com
@@GoogleUser-is9zj this is not complete information, can you paste the complete stacktrace in pastebin and send me the link ? Also send me the github link of your source code.
@@ProgrammingTechie Hey ! Thank you , I solved it by changing port from 25 to 2525!