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

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

Related

Jersey WAS9 not able to depoy

I am trying to deploy my web application on WAS9 with JDK 1.8 , however it gives a error of CDI
Below is the error
java.lang.RuntimeException: com.ibm.ws.naming.util.CannotBindObjectException: Object is not of any type which can be bound. Object type is com.sun.jersey.server.impl.cdi.CDIExtension.
at com.sun.jersey.server.impl.cdi.CDIExtension.initialize(CDIExtension.java:196)
I removed Jersey 1.X version from war , but still this error.
In my local it work good with tomcat and same other application runs good in WAS 8

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 boot application running locally but not on cloud foundry

I created a basic spring boot application (added in all the JAR files manually, as maven download is restricted in the intranet). When running the application locally, the application starts up (and is accessible on loaclhost:8080), but on deploying the jar file on PCF, i get the following error
Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean
Since the application is running locally, I am assuming that I added all the JAR files.
What is the issue here?

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

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

java.lang.NoClassDefFoundError on using spring security on google app engine

I am using Spring Core framework version 4.1.6.RELEASE and Spring Security version 4.0.0.RELEASE in my google app. But when I try to run it in local appservere I see following log
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChains': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: java.lang.reflect.Parameter is a restricted class. Please see the Google App Engine developer's guide for more details.
Then I checked that in which jdk version this java.lang.reflect.Parameter class was introduced and found that it is there since 1.8. But app engine supports java 1.7 only. How could I find the spring framework versions which are build on 1.7 JDK. Please suggest
You have to download the JDK7 and it will work. I had the same problem.

Resources