Skip to content
Advertisement

Tag: api

Why spring validator is not working in this Api?

I have written a basic simple API of students data and added few validations using Hibernate validator but everytime its returning 0 errors. Here’s the code: pom.xml student.java Controller.java I am testing it using postman,My request body: In every request,even if name is empty Its returning 0 errors. Can someone help? Thanks in advance. Answer you need to add starter

Cannot invoke findByEmail because “this.userRepository” is null error

I keep receiving a Cannot invoke “com.***.repositories.UserRepository.findByEmail(String)” because “this.userRepository” is null error everytime I try to process my /register method. I can’t figure out why the code is coming across as null. Controller – Axios call – My UserRepository – Answer Simply add @Autowired to your related fields you want to get Autowired by spring. Change your code from to

How to get access token from Spotify API? [java]

I am fairly new to programming with Java but am interested in creating a program that allows for connection to the Spotify API. I am using the Client Credential Flow authorization process but keep getting java.io.IOException: insufficient data written exception when trying to reach the access token. I cannot figure out what information I am missing to complete the request.

Advertisement