INFO: Deploying web application archive /Users/pushyami/tomcat/tomcat7_ctoolsT/webapps/sakai-gradebook-tool.war
2015-05-28 09:46:37,764 ERROR localhost-startStop-1 org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/spring-beans.xml]; nested exception is java.lang.IllegalStateException: AnnotationTransactionAttributeSource is only available on Java 1.5 and higher
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
By Looking at the error i came across this
stackoverrFlow thread that this is happening because of Spring version we are using
<sakai.spring.version>2.5.6.SEC03</sakai.spring.version> is first checking( while loading the application) for java version and this particular spring version don't have check for java 8 and default to java 4 and hence it has loading issues. The solution suggested upgrade to Spring 3.2.9 (Or some thing). we are afraid that if we upgrade then we have to upgrade to Hibernate version as well. We did not won't to go that route yet.
By looking at the answers in stackoverflow i figured that we need add the check shown below. I Understand that loading of application does not ensure application will run fine under Spring 2.5.x and java 8
if( JAVA =1.8)
continue; // Something like that
What i have tried?
1) My gradebook compiles fine on java 1.7/java 1.8, but when running on java 1.8 it show the errors( mentioned above) . i tried reset the version of java during tomcat start up like -Djava.version=1.7.0_67 to JAVA_OPTS -No success
2) All the logic that version checking of java in spring jar's is happening in JdkVersion.java. In the Stackoverflow thread once user(~Dmitry ) mentioned that he added JdkVersion.java to his application and made application look at his file instead of spring.jar. I tried similar approach by creating the file in /sakai-gradebook-tool but no success. I am not sure if this is the right place to put, Please guide me where to put it to make this work. can somebody enlighten is this is good or bad idea?
Kindly suggest any other approaches.
Sorry for the long email.