Bart's picture

I deployed a simple hello world app with jsp and servlet class as a WAR file using the Tomcat /manager. I also modified the mod_jk.conf to map my application between tomcat and apache. So far so good. Then I get the message below:

javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: HelloWorld/Greeting : Unsupported major.minor version 51.0 (unable to load class HelloWorld.Greeting)

The problem is most certainly that my JDK/JRE/JVM is a newer version 1.7 than the TurnKey JVM 1.6. (seestackoverflow .)

So the question/guidance sought is this: 
Assuming that my assessment of the underlying problem is correct, there are at least two paths that I can follow:
1) Install lower version in my IDE to match runtime version;
2) Upgrade runtime version on Turnkey image to match my IDE version.

Which of the two makes sense? Are there alternative recommendations that anyone believes is more prudent?  Should I be reluctant to modify the image as deployed?

Thanks for your help.


Runtime Environment Details:

Tomcat on Apache - Java Servlet & JSP Platform powered by TurnKey Linux
Ver: 12.1
Linux/Unix, Debian 6.0.7 (Squeeze)
32-bit Amazon Machine Image (AMI)
JVM version 1.6.0_18-b18
Apache Tomcat/6.0.35

Development Environment Details:

IDE is Eclipse Helios
JAVA SE 7 Update 40 (build 1.7.0_40-b43)
Apache Tomcat 6.0.32

Jeremy Davis's picture

v13.0 has just been released (despite the fact that the devs haven't yet announced it) so perhaps test that first and see how things go there before you go too much further...

Bart's picture

Thanks Jeremy.  That is exactly what I am looking for.  I am new to turnkey.  What is the normal path that occurs when a new version is released?  Is it promoted to AWS Market Place?  Would I simply create a new instance and deploy on that and sunset the current instance?  Do I upgrade the current instance.  If I upgrade, how would I initiate that process?

Sorry for all the questions.   If there is documentation that describes this I will gladly read.


Jeremy Davis's picture

Major version increments of TKL mean a new base OS i.e. v11.x was based on Ubuntu Lucid, v12.x saw a switch to a Debian base (Squeeze) and v13.x is based on Debian Wheezy. Minor version updates generally just include bugfixes and OS level updates (although that pattern was broken with v12.1 which also included updated upstream software). So generally updating to a minor increment is not required if you maintain your server, it is more useful for those that choose to download and run locally (although as I said, v12.1 included upstream updates so some appliances that include software which is not provided via package management benefit from the updated base).

If you are using AWS then the recommended way to launch appliances is via the TKL Hub. New servers launched will default to the latest stable version. So if you were to launch a new appliance from the Hub now, you'll find that the default will be v13.0. If you don't wish to use the Hub then I am not 100% sure how things work from the AWS marketplace and AFAIK whilst the Hub and marketplace AMIs are essentially the same, they are not actually the same images. I just checked and it looks like v13.0 appliances are not yet available via the marketplace so the Hub may be your only option for TKL v13.0 on AWS for now...)

The recommended way to upgrade to a new major version is to use TKLBAM to migrate your data. Depending on what appliance you are using there may be some tweaks required in the upgrade process (due to newer versions of software, changes in DB layout, etc.) but for the more basic/stack/framework appliances (e.g. LAMP, Core, etc) no further work should be needed. If you have only just started (and/or you don't wish to use TKLBAM) then launching a new server and manually uploading your data is fine. Once you have completed that and confirmed 100% that everthing works as it should on your new server, you can retire the old one.

Theoretically you could upgrade your appliance as you would any Debian server but due to the fact that some of the preinstalled software is not installed via package management (e.g. Webshell aka Shell-in-a-box) it is not really the best way to go IMO.

There is a fair bit of documentation (available via Help >> Documentation) but TBH it is one area where TKL doesn't do quite as well as it could... Some of the info is a little out of date, incomplete and perhaps not organised quite as well as it could be (or missing completely)... I take partial responsibility for that (as the main forum mod) but it is a community editable wiki so I won't take full responsibility! :) So if there is stuff there that you think should be included that isn't and/or rewritten and/or updated don't be scared! :)

Bart's picture

Thanks Jeremy.  This is an excellent answer.  Very very much appreciated.

I will follow your suggestion to download from the HUB and build a new instance as I don't have any existing data to migrate.  And I see that the "Tomcat on Apache" appliance displays "Stable version: 13.0 (changelog)" near the top of the page.


Michael Cizmar's picture

I believe that your libraries have been built with Java 7 and the Turnkey Tomcat server is running with JDK6.  The latest build still is running with Java 6.

Add new comment