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

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.

Related

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.

trouble with spring-hibernate3:jar:2.0.8 and struts2-core:jar:2.3.16 for different version of asm

I am working on a project for upgrade an application to spring 3.2.0.RELEASE, struts 2.3.16, and hibernate 3.6.5.Final.
in the pom.xml, I have dependency spring-hibernate3 2.0.8 version.
And, I found out this version need asm:asm-attrs:jar:1.5.3:compile,
but, struts need asm 3.3 and 3.3.1.
Currently, when I try to start the application use Tomcat 7.0, I have issue with different asm version conflict issue.
The errors are:
Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.(Z)V
I can't upgrade the hibernate to 4, I have to stay in 3.6.
So, I need introduce two version of asm, how to separate them and forbid them refer the wrong version of asm?

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.

How do I prevent Maven including certain dependencies in deployable war?

I'm migrating an application that uses Spring security 3.0 to Spring security 3.1.
I have been getting an error about incorrect schema being referenced:
SEVERE: Exception sending context initialized event to listener instance of class
org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration
problem: You must use a 3.0 schema with Spring Security 3.0.(2.0 or 3.1 versions are not
valid) Please update your schema declarations to the 3.0.3 schema (spring-security-
3.0.3.xsd).
Offending resource: ServletContext resource [/WEB-INF/security-context.xml]
When I look in /lib I see a number of jars that are 3.1 versions are duplicated as 3.0 versions. I suspect this is what is causing the error above.
When I look at the dependency tree of the pom.xml using the Eclipse Maven plugin, I can see where the earlier versions are being referenced (eg spring-security-acl depends on several 3.0 jars) but they are marked as 'omitted for conflict with...'. Does that not mean they should be omitted from the built war file?
I've tried explicitly naming 3.1 versions of those files at the root of my pom but the older versions still get included.
Offending resource: ServletContext resource
[/WEB-INF/security-context.xml]
Actually the message indicates that security-context.xml uses schema/declarations which are incompatible with spring-security-3.1. The message is requesting you to use a 3.0 version of the library instead. You may want to review and update it and retry.
I'm still not sure what was going on, but I tried creating a new project in Eclipse with the same pom and source files and now the project seems to behave itself.

Spring loaded hibernate connection in ireport

I have a Spring Web MVC project. And, I am trying to Create a Spring Loaded Hibernate Connection in IReport using the existing spring web mvc projects application context.
In IReport, In the Options window, in the ClassPath tab, I have added all the latest Spring jars used by the project. As well as the application context's folder.
But, I am getting the following error while testing the connection
Error Creating bean name 'mySessionFactory' defined in the class path resource spring-hibernate.xml: invocation of init method failed;nested exception is org.hibernate.MappingException: entity class not found.
Has anyone successfully connected using the Spring loaded Hibernate connection in Ireport?
IReport uses internally an outdated Version of Spring(I think it is 2.0.0) so if you have for example Annotated Spring and Hibernate, there is no Chance to get run, because Ireport has a heavy use of Reflections.
So if you try to us a CustomClassLoader, you will hit a wall, because IReport tries to load your also after you give it your Custom DataSource.

Resources