Difference between Spring MVC and Spring Boot

Spring MVC is a complete HTTP oriented MVC framework managed by the Spring Framework and based in Servlets. It would be equivalent to JSF in the JavaEE stack. The most popular elements in it are classes annotated with @Controller, where you implement methods you can access using different HTTP requests. It has an equivalent @RestController to implement REST-based APIs. … Read more

Could not resolve placeholder in string value

In your configuration you have 2 PropertySourcesPlaceholderConfigurer instances. applicationContext.xml infraContext.xml By default a PlaceholderConfigurer is going to fail-fast, so if a placeholder cannot be resolved it will throw an exception. The instance from the applicationContext.xml file has no properties and as such will fail on all placeholders. Solution: Remove the one from applicationContext.xml as it doesn’t add anything it only breaks things.

intellij incorrectly saying no beans of type found for autowired repository

I had this same issue when creating a Spring Boot application using their @SpringBootApplication annotation. This annotation represents @Configuration, @EnableAutoConfiguration and @ComponentScan according to the spring reference. As expected, the new annotation worked properly and my application ran smoothly but, Intellij kept complaining about unfulfilled @Autowire dependencies. As soon as I changed back to using @Configuration, @EnableAutoConfiguration and @ComponentScan separately, the errors ceased. It seems Intellij 14.0.3 (and most likely, earlier versions too) is not yet … Read more

Spring Maven clean error – The requested profile “pom.xml” could not be activated because it does not exist

The warning message means that you somehow passed -P pom.xml to Maven which means “there is a profile called pom.xml; find it and activate it”. Check your environment and your settings.xml for this flag and also look at all <profile> elements inside the various XML files. Usually, mvn help:effective-pom is also useful to see what the real POM would look like. Now the error … Read more

Only using @JsonIgnore during serialization, but not deserialization

Exactly how to do this depends on the version of Jackson that you’re using. This changed around version 1.9, before that, you could do this by adding @JsonIgnore to the getter. Which you’ve tried: Add @JsonIgnore on the getter method only Do this, and also add a specific @JsonProperty annotation for your JSON “password” field name to the setter method for the … Read more

UnsatisfiedDependencyException: Error creating bean with name

The ClientRepository should be annotated with @Repository tag. With your current configuration Spring will not scan the class and have knowledge about it. At the moment of booting and wiring will not find the ClientRepository class. EDIT If adding the @Repository tag doesn’t help, then I think that the problem might be now with the ClientService and ClientServiceImpl. Try to annotate the ClientService (interface) with @Service. … Read more

UnsatisfiedDependencyException: Error creating bean with name

The ClientRepository should be annotated with @Repository tag. With your current configuration Spring will not scan the class and have knowledge about it. At the moment of booting and wiring will not find the ClientRepository class. EDIT If adding the @Repository tag doesn’t help, then I think that the problem might be now with the ClientService and ClientServiceImpl. Try to annotate the ClientService (interface) with @Service. … Read more