I'm not getting the list of Restaurants in my app

I completed all the modules until 4 and passed all the assessments, but I’m still not able to get the list of Restaurants in my app when I connect it to the server.
I tried to find out the issue by putting the breakpoint in the RestaurantController class from where we get the List and then ran the application in debug mode. I found out the error was that when I called the restaurantServiceImpl.findAllRestaurantsCloseBy() from the API response body by passing all the parameters I received from the HTTP request, from here things go haywire.
When I reach the file RestaurantServiceImpl the
@autowired
private RestaurantRepositoryService restaurantRepositoryService; is null and I’'m using this as a dependency to get all the restaurants.
I couldn’t find out why this happens.

hello @theIceman
please refer these links

And this particular answer to understand Autowired - Null pointer exception Module 3

Hint: explicitly creating new objects for which autowiring is provided.

How am I supposed to create object to the @autowired objects, like
@Autowired
private MongoTemplate mongoTemplate;
@Autowired
private Provider<ModelMapper> modelMapperProvider;

As I could see in the Mod-4 debrief they are used directly and we didn’t need to initialize the @autowired object.
Also in the link, it is being said that it won’t throw an error if we use the Autowired object, but in my case, it does throw an error because they are null.

@theIceman
let me give you a brief about what its in the links,

there are autowired objects of the some classes in some classes which means that you are injecting dependencies of that particular class in the current class.

Now, the tests expect you to explicity use that autowired object for every interaction in the current class,
please go through each and every class of your codebase and check are you initialising a object of a class of which the object is already been autowired?


How can I initialize any of these three objects as these provide the core functionality to the function?

you don’t need to initialise them ,
the autowired is used to inject the dependencies and hence all work will be done,
you have to use these instances of the classes only, avoid instantiating these classes again.

Like I said previously they were all null, just using the classes objects provided in @autowired were giving me error.
Hence I was not getting the list in my restaurants app.

hello @theIceman
when running the script ./setup_mong.sh and running the server by ./gradlew bootrun
response is coming, can you confirm by doing it from your end?

Yeah it is working in Postman but not in my phone app.
In this case I used the dummy implementation to get the results so just to check if we get the response and it did in postman but not in phone app.
In my RestaurantRepositoryServiceImpl.java i’m not getting any list from the mongoDb, because I’m not able to use the @autowired provided.