0

I am working on an existing code base, which is using Hibernate and Spring. I have written a Controller class, but when I am trying to see the JSON response in the browser, I get a 404 - Page Not Found exception. However, the other existing Controller classes are working in the same manner, but am not able to figure out why ? Sorry, am very new to Spring, and am sure must be missing something silly.

LearningToDesign
  • 75
  • 1
  • 3
  • 10

2 Answers2

1

Seems like your controller method is defined as package-private. Change the controller method to public.

Koby
  • 605
  • 5
  • 11
0

You seem to be using JAX-RS annotations with Spring. Apparently you can't do that. @RequestMapping and @RestController are the recommended annotations for what you want to do. Check the Spring guides for a good example.

Community
  • 1
  • 1
Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82