spring-boot No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available - spring-boot

Dears,
I am new to spring boot, I downloaded the getting started project from "https://spring.io/guides/gs/spring-boot/"
but when I tried to run it as it's I got the following exception
No qualifying bean of type 'org.springframework.test.web.servlet.MockMvc' available
please advise

Dears,
it seems there were some problem in my local maven repository
I cleaned my local maven spring repository and let the build to download it again and everything went fine

Related

minioConfig': Injection of autowired dependencies failed

i adding every possible dependency but i am still getting the dependency errror
I WANT TO CREATE A SPRINGBOOT API THAT UPLOADS A FILE IN MINIO SERVER, I AM NOT GETTING APPRORPRIATE DIRECTION

Spring Data DynamoDb Integration with Spring Boot(java.lang.AbstractMethodError: createPersistentProperty)

We were working on the Integration of the Dynamo Db with our Spring Boot Project (maven based project) so as to deploy it as a lambda project which can access data over dynamo db and render it to our static website .After configuring the repos and the POJOS for our project we did mvn clean install and found the following issue that occurred during the build .
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'MyInteractivesFunction': Unsatisfied dependency expressed through field 'MyClientDetailsRepository';
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'MyClientDetailsRepository': Invocation of init method failed;
nested exception is java.lang.AbstractMethodError: org.springframework.data.mapping.context.AbstractMappingContext.createPersistentProperty(Lorg/springframework/data/mapping/model/Property;Lorg/springframework/data/mapping/model/MutablePersistentEntity;Lorg/springframework/data/mapping/model/SimpleTypeHolder;)Lorg/springframework/data/mapping/PersistentProperty;
It seems that the issue was in mapping the POJO properties with the columns but we created another dummy project separately and it worked there. Need a solution for it.
After lots of searching and applying various ways we found what actually was the real cause of problem was jars incompatibility. Our Spring boot version was based on 2.0.3 and the spring data dynamodb version was 4.5.0 which dont work well with each other.Hence , we found a link that very sweetly describes the issue :
https://derjust.github.io/spring-data-dynamodb/ , So we changed the spring data dynamodb version to 5.0.4 and it worked like a charm we were able to retrieve results from Dynamo Db.

Spring MVC web application works fine on standalone tomcat but failed when deployed on cloud

I am running a maven based spring web application on my local tomcat 7.0 and it works fine but when I run it on cloud, it is failed with the BeanCreationException.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ServiceImpl': In
jection of autowired dependencies failed; nested exception is org.springframewor
k.beans.factory.BeanCreationException: Could not autowire field:xxx
The cloud also runs the webapplications on tomcat7. I am not sure what can be the other causes of error.Any one ever face this issue before? Thanks

Spring 4 submodule annotaions

I am using Spring 4.x for my latest project, no xml, only annotations. It was working fine till I decided to move part of my project into a submodule. I see the submodule jar in the lib folder of the project jar (used spring boot jar maven plugin to package).
The problem now is that Spring does not recognize the components in the submodule jar. The package names are the same for both the jars.
sample code
#EnableAutoConfiguration(exclude={JmsTemplateAutoConfiguration.class})
#ComponentScan("com.abc")
Structure
project.jar+
|-lib+
|-submodule.jar
Spring loads all the beans / components in the project for that package, but nothing from the embedded jar file.
Stacktrace excerpt:
No qualifying bean of type [com.abc.xxxx] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency....
What am I doing wrong here?
It's not a great idea to split packages across multiple jar files. I imagine it will work if you name the packages uniquely. Please raise an issue in github if you think it might be fixable in the class loader.

Spring + Hibernate Not able to address issue

i am using spring 3.2.4 (latest stable version) with hibernate
i have added all the dependencies but still i am getting the error which is below
java.lang.NoClassDefFoundError: org/springframework/transaction/interceptor/TransactionInterceptor
if i use maven
then i get too many errors like Failed to Autowired (in both service and DAO),
org.springframework.beans.factory.BeanCreationException:
java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider
please help me to solve problem for one of above. i want to create an application (spring + Hibernate) any of way (with maven or without maven)
The application is missing the hibernate-core-x.x.x.jar file. You will need to find the appropriate version of the jar.
Use FindJar: http://www.findjar.com/jar/org/hibernate/hibernate-core/3.3.2.GA/hibernate-core-3.3.2.GA.jar.html
The class java.lang.ClassNotFoundException: org.hibernate.cache.CacheProvider is included in version of Hibernate before version 4.0. I would update all of your libraries to use the 4.0 version.

Resources