Basic LTI – part II (warning geek code ahead)

I’m trying to setup a Basic LTI (bLTI) tool provider server in java. The reason for this is described in this post. I’ve chosen to use the java-servlet implementation at IMS-DEV.

This has proven to be a bit more difficult than expected. I am very proficient in all things Java, and as such expected it to be easier. I haven’t finished the process, but already overcome a few stumbling blocks and issues, that I thought others might learn from.

First of all, I haven’t been able to set up an environment in Eclipse. I’ve tried the usual ways (Importing the code, setting up a new project using the ant build.xml file and setting up a project from scratch), but after spending the better part of a day on this, I came to the realisation that it might be easier to spot the problems by “going commando” and do it old skool in the terminal, and this is where there are a few pointers that others should be aware of, and which is not documented in the code:

  • It is *VERY* important to set up *ALL* Java environment settings, so remember, JAVA_HOME, add JAVA_HOME\bin
  • Seemingly only Apache 5.5 is supported, as internal ant settings are using the file structure expected from this server. (I was trying with Glassfish and Apache 6.0, and this was most likely the issue experienced in Eclipse)
  • The README file explains that if checking out from the SVN, then the servlets should be compiled (btw I can’t see any other way of getting the code than this way, so…) following the steps in the README in the “classes” folder. The steps in that README file are written for the scenario where the java-servlet code is checked out into the Apache folder system (probably is unlikely in most cases)! So remember to change the javac command to: javac -cp “.;path_to_your_servlet-api.jar_in_you_Apache_folder” ProviderServlet.java

This solved the first problems for me, and I can now compile the servlet, next step is to get the server running.

— after some hours of work —

So this should have been easy, but there seems to be a problem.

I can easily ant the build:

ant -Dcatalina.home=”my_apache5.5_folder” compile

And it compiles and saves the ProviderServlet.war file in the webapps folder of Apache 5.5, but once I try to access the lms.jsp (or any other of the files) I just get 404! when http://localhost:8080/provider/lms.jsp

I’ve tried many different settings, and changing the URL, but I am kind of stuck on this, and might test one of the other languages to see if I can get a working server that way to learn from, and then come back to this.

There is also the java GAE version which might be worthwhile to use as a test case. It wouldn’t be as applicable for DEVELOP as the servlet version, but might be worthwhile for learning purposes.


This entry was posted in Plugin development and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>