I am trying to write a SpringBoot application. But when I am trying to access it using Postman, it shows Status as 404 and gives a warning on console:
WARN 6616 --- [nio-8080-exec-1] o.g.jersey.internal.inject.Providers
: A provider com.cognizant.insurance.controller.RestServiceController registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.cognizant.insurance.controller.RestServiceController will be ignored.
My Rest Controller is:
@Component
@Provider
@Controller
@RequestMapping(value="/api", produces="application/json")
public class RestServiceController {
@Autowired
private CordaRPCService cordaRPCService;
@Value(value = "${node.PartyA.rpc.hostport}")
private String nodeRpcHostAndPort;
@Value(value = "${nodename}")
private String nodeName;
CordaRPCOps rpcService = null;
String inDateFormat = "dd/MM/yyyy";
PolicyState policy;
@RequestMapping(value="/createpolicy", method=RequestMethod.GET)
public String doTradeCreditPolicy() {
return "Hello";
}
My project Structure:
Main File:
package com.cognizant.insurance;
@SpringBootApplication
@EnableScheduling
@EnableCaching
@ComponentScan("com.cognizant.insurance")
public class Application extends SpringBootServletInitializer {
public static void main(final String[] args) {
new Application()
.configure(new SpringApplicationBuilder(Application.class))
.run(args);
}
}