Java version to work with TiNG

Forum to discuss the new web client version of Servoy.

Java version to work with TiNG

Postby dfernandez » Thu Mar 23, 2023 7:54 pm

Hello!

I am trying to build my first TiNG solution in production but when uploading the war file on the Tomcat Server under Centos Linux, I allways receive an error related to the java version:
Caused by: java.lang.UnsupportedClassVersionError: com/servoy/j2db/log4j/LoggingServletContainerInitializer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0 (unable to load class com.servoy.j2db.log4j.LoggingServletContainerInitializer)

I have updated the java runtime to the last version I find in Centos (v11) and the same happens.

Regards
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm

Re: Java version to work with TiNG

Postby jcompagner » Fri Mar 24, 2023 10:29 am

This has nothing todo with TiNG but the servoy version you use
Servoy 2022.12 and on needs Java17 for developer and deployment.
So you need to have a java17

not sure what CentOS 11 is because i can only find that they released 8.5 or someting like that (they don't really show the versions like that anymore)
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Java version to work with TiNG

Postby rafig » Fri Mar 24, 2023 11:39 am

If your Java version is ok, it might be the wrong Tomcat version.
I was just trying to set up a new Ubuntu server and installed Tomcat 10 and had repeated errors, then saw a forum post saying to stick with Tomcat 9, so I downgraded to 9 and all ok now.
Servoy Certified Developer
Image
rafig
 
Posts: 704
Joined: Mon Dec 22, 2003 12:58 pm
Location: Watford, UK

Re: Java version to work with TiNG

Postby swingman » Fri Mar 24, 2023 12:06 pm

Hi, look at the bottom of your Tomcat manager console /manager/html. You will see the Java JVM Version.
In my case my Tomcat was running on Java 11, but I was trying to deploy a .war produced from Servoy 2022.12 which uses Java 17, so it failed.
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java version to work with TiNG

Postby dfernandez » Sat Mar 25, 2023 5:28 pm

Thank you jcompagner, rafig and swingman for your help!

That Centos has Apache Tomcat/7.0.76 and java 1.8.0_362-b08 as it shows under Tomcat Manager.

I tried to update java but nothing happened.

wars created with Servoy 2022.06 work fine but those created with 2022.12 fail.
dfernandez
 
Posts: 87
Joined: Wed Feb 29, 2012 4:04 pm

Re: Java version to work with TiNG

Postby swingman » Sat Mar 25, 2023 11:13 pm

Hi, I think you can have multiple Java versions installed. Tomcat will use the version it has been told to use, the setting will be in a configuration file.
So if you have Java 8 and 17 installed and Tomcat has been told to use 8, it will use 8.

My hoster sent me this message when they updated my server (Ubuntu 20.04):
Code: Select all
I've installed OpenJDK 17.0.6 on <servername> and have configured Tomcat to use it. I've also increased the manager upload limit from 50MiB to 2GiB and have increased the Apache max request body size to match, which should prevent any issues with the proxy while uploading the .war.

I've upgraded the Tomcat version from 9.0.43 to 9.0.58, which is the latest available version currently packaged for Ubuntu 20.04 (Focal).
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Java version to work with TiNG

Postby jcompagner » Sun Mar 26, 2023 3:26 pm

you really need to update stuff
And if centos doesn't give that by there standard repo's for the release you are using
you need to download them manually
because also the version of tomcat (7.x) is really old and should not be used anymore

you should be using one of the latest of Tomcat 9
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Java version to work with TiNG

Postby robert.edelmann » Mon Mar 27, 2023 11:01 am

jcompagner wrote:you really need to update stuff


Definitly, especially in production, where your customers data is your responsibility.

That said, you can check for automatically installed versions of java via:

Code: Select all
sudo update-alternatives --config java


This gives you al list of JVMs on the machine, and you can then switch to your prefered one.

At least on ubuntu, If this doesn't help for tomcat, you should check /etc/default/tomcat9 (or rather tomcat7 in your case) for this:

Code: Select all
# The home directory of the Java development kit (JDK). You need at least
# JDK version 8. If JAVA_HOME is not set, some common directories for
# OpenJDK and the Oracle JDK are tried.
#JAVA_HOME=/usr/lib/jvm/java-8-openjdk
JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/

# You may pass JVM startup parameters to Java here. If you run Tomcat with
# Java 8 instead of 9 or newer, add "-XX:+UseG1GC" to select a suitable GC.
# If unset, the default options will be: -Djava.awt.headless=true
JAVA_OPTS="-Djava.awt.headless=true"


But please make sure your server is updated, perhaps you have to switch tomcat to a new version in your package manager.
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 91
Joined: Wed Aug 14, 2013 6:12 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 9 guests