Fwd: Gradebook 2.9.2 and java 8 issues

573 views
Skip to first unread message

Pushyami Gundala

unread,
Jun 10, 2015, 2:58:18 PM6/10/15
to saka...@apereo.org
HI, I am a developer at the University of Michigan and we have Sakai 2.9.X  running on Java7. Since Oracle announced that they are going to stop the public bug/security fixes to Java 7. We want to run the our Sakai 2.9.x  against Java 8.  So we patched the most of the Java 8 stuff mentioned in the SAK-25903 except for the DB/Pooling stuff. I have updated the sakai.jdk.version =1.8 and it compiles fine. Our sakai 2.9.x application launches fine and most of the modules are launching fine. 

But i see the Gradebook launch is failing. I see below error in the Gradebook UI

org.sakaiproject.portal.api.PortalHandlerException: java.lang.IllegalArgumentException: Unable to find registered context for tool with ID sakai.gradebook.tool
at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:894)
caused by: java.lang.IllegalArgumentException: Unable to find registered context for tool with ID sakai.gradebook.tool
at org.sakaiproject.tool.impl.ActiveToolComponent$MyActiveTool.forward(ActiveToolComponent.java:508)
at org.sakaiproject.portal.charon.SkinnableCharonPortal.forwardTool(SkinnableCharonPortal.java:1485)
at org.sakaiproject.portal.charon.handlers.ToolHandler.doTool(ToolHandler.java:213)
at org.sakaiproject.portal.charon.handlers.ToolHandler.doGet(ToolHandler.java:96)
at org.sakaiproject.portal.charon.SkinnableCharonPortal.doGet(SkinnableCharonPortal.java:894)

When tomcat is starting up i see below Exception in logs

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.




 
Regards,
Pushyami

Sam Ottenhoff

unread,
Jun 10, 2015, 3:05:52 PM6/10/15
to Pushyami Gundala, sakai-dev
 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?

I would try placing the file in shared/lib/

If the parent library is faulty, and there is no easy path to upgrade the library, then modifying the library can be the only sane path left. Modifying the class may be the fastest path for now while maintaining a fork of Spring will be the best from a deployment standpoint.

--Sam

Earle Nietzel

unread,
Jun 10, 2015, 4:11:52 PM6/10/15
to Pushyami Gundala, saka...@apereo.org
Have you tried building with java 7 and run with jdk 8?

Just because Oracle says its deprecated jdk 7 doesn't mean you can't still build with it and then run with jdk 8.



--
You received this message because you are subscribed to the Google Groups "Sakai Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sakai-dev+...@apereo.org.
To post to this group, send email to saka...@apereo.org.
Visit this group at http://groups.google.com/a/apereo.org/group/sakai-dev/.



--
earle,
asahi net int.

Matthew Jones

unread,
Jun 10, 2015, 5:24:37 PM6/10/15
to Earle Nietzel, Pushyami Gundala, saka...@apereo.org
I think the biggest problem with this is that Apache Axis has a hardcoded requirement for Java 7 or earlier, this was even a problem with Sakai 10 and why we still recommend Java 7 when running Sakai 10 at the moment. 


When Sakai 2.9 was released the recommended version was Java 1.6. ;) If that old Spring version is a problem, it might be tricky as that + hibernate was a big update.

Pushyami Gundala

unread,
Jun 11, 2015, 9:20:59 AM6/11/15
to saka...@apereo.org
Hi Earle, I Tried what you have suggested earlier. It's build fine on Java7 and even with java 8. it while running app (gradebook module) with Java 8 it shows the problem.

Regards,
Pushyami

On Wed, Jun 10, 2015 at 4:11 PM, Earle Nietzel <enie...@anisakai.com> wrote:

Leonardo Canessa

unread,
Jun 11, 2015, 9:34:10 AM6/11/15
to Pushyami Gundala, sakai-dev
Just throwing this out there...
Would setting up maven to set up the 1.8 JDK to compile for 1.7 be useful in this situation?

See the following posts:

Leonardo Canessa
Web Developer - E-Learning

Earle Nietzel

unread,
Jun 11, 2015, 9:56:08 AM6/11/15
to Leonardo Canessa, Pushyami Gundala, sakai-dev
This is exactly what ${sakai.jdk.version} is used for so you can set the byte code version that is output during compile.

You could try and add the environment variable to your startup 
java.version=1.7.0_80

So that spring thinks its 1.7 vs 1.8.

If that doesn't work then you will need to upgrade to 10. The community doesn't support running 2.9 with jdk 8. Since jdk 1.7 was just EOL in April I would just plan on upgrading sometime soon and continue running with jdk 7 its likely not going to cause an issue.


Matthew Jones

unread,
Jun 11, 2015, 10:03:31 AM6/11/15
to Earle Nietzel, Leonardo Canessa, Pushyami Gundala, sakai-dev
Well it sounds like it compiles fine but some libraries (like Spring) have issues where it just won't work at runtime with Java 8. Like I'm seeing this one where some features prior to spring 3.2.9 don't have Java 8 compatibility. [1] We upgraded 11 to the latest spring [1] 3.2.13 and I'm not even sure if Sakai 10 would 100% run under Java 8 if it needs this without the upgrade.

So the choice might be either also backporting the huge spring/hibernate upgrade (KNL-515 / KNL-517) or just upgrading to Sakai 10 and picking up this spring update.

Pushyami Gundala

unread,
Jun 12, 2015, 9:39:56 AM6/12/15
to Matthew Jones, Earle Nietzel, Leonardo Canessa, sakai-dev
Sam, I was able to modify the existing spring library and successful launch the gradebook. thanks for advice.

Matthew/earle/leonarda, Thanks for all you tips/insight with java 8 and sakai

Regards,
Pushyami
Reply all
Reply to author
Forward
0 new messages