Page 1 of 1

war file fails to deploy

PostPosted: Mon Apr 12, 2021 5:45 pm
by pitc
I have installed TomCat 10.0.5 successfully on windows 10.
I exported my war file and it is successfully uploaded (after changing the size to more than the 50MB initial size) and deployed.
The attempt to start the war file fails due to:
12-Apr-2021 10:19:34.537 SEVERE [http-nio-8185-exec-5] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [com.servoy.j2db.server.servlets.WarClientServletContextListener]
java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

(this is from the log file: ...TomCat 10.0\logs\localhost.2021-04-12.log).
The class javax/servlet/ServletContextListener is found here:
...TomCat 10.0\lib\servlet-api.jar

So not sure why it cannot be found.
Tomcat detected the jre at: C:\Program Files\Java\jre1.8.0_281
Is this not compatible with the war propduced from Servoy 2021.03.3642?
Any other ideas to examine are much appreciated (and yes this is the first time attempting to set up Tomcat and export a war file!).
Tom

Re: war file fails to deploy

PostPosted: Tue Apr 13, 2021 11:57 pm
by pitc
Not sure if this causes the problem or not: in Servoy 2021.3.3643 when exporting a solution to a war there is a step that has a file chooser to get a context.xml file to include in the war file. Is it required to provide one?

Re: war file fails to deploy

PostPosted: Wed Apr 14, 2021 9:07 am
by jcompagner
no, that is not mandatory,

But your problem is Tomcat 10, that is completely different because of package renames (javax.servlet.Xxxxx -> jakarata.xxxxx)
if you want to use Tomcat 10 you need to use: https://github.com/apache/tomcat-jakartaee-migration

and first migrate the generated WAR
Or stick to Tomcat 9.x for the foreseeable future (that will also be alive and maintained for the coming years)

Re: war file fails to deploy

PostPosted: Wed Apr 14, 2021 4:06 pm
by pitc
Thanks Johan,
I had not realized the change in the JavaEE namespace to Jakarta.
I did try the migration tool and the war file deploys ok now.
However when run the Servoy app I get an unsigned application error.
I then downloaded and installed Tomcat 9, deployed same Servoy app and it runs without any unsigned application errors.
(For others I was using the svySecurityConsole as the test app. Now I get other errors like the dataservice not running - but that must be the way I attempted to create the war file).

Re: war file fails to deploy

PostPosted: Wed Apr 14, 2021 4:26 pm
by jcompagner
that could be a problem yes, because the migration tool adjusts the jar files inside the war,
so all the jar files that are signed are suddenly not signed anymore (or at least the signing is broken)

but for now just stick to Tomcat9 (Servlet spec 4.0)
because the only change in the spec of 5.0 is the package rename: https://jakarta.ee/specifications/servl ... ervlet-4-0

So as long as Tomcat 9 will be supported (or any other 4.0 container) there is no need to go to 10 because that doesn't bring anything.

Re: war file fails to deploy

PostPosted: Wed May 17, 2023 9:58 pm
by ryan1680098789
just wanted to confirm that as of 2023, is continuing use of Tomcat 9 the only real solution here? or are there plans to migrate to Tomcat 10?

Re: war file fails to deploy

PostPosted: Thu May 18, 2023 6:16 pm
by ROCLASI
Hi Ryan,

Just wondering. What do you need that is not in version 9?

Re: war file fails to deploy

PostPosted: Mon May 22, 2023 12:10 pm
by jcompagner
there are currently no plans to go to tomcat 10 (by default)
As i said above with the converter tool you should be able to work on tomcat 10 or higher

But the shipping version of Servoy will support Tomcat 9 for the time being.. (if we don't do that we right way break it and you need a tomcat 10 or other container for servlet spec 5.0 or higher)

All our code would be needed to move to the new packages, but also all of the 3rd party packages (which some still didn't)
Also very likely we then fully need to drop WebClient first.

But Tomcat 9 will be supported for a long time, and constantly updated.
You can see that in the release notes of tomcat 9 and 10/11, if there is a Tomcat 10 release you also see a Tomcat 9 release with pretty much the same fixes.
So the core of tomcat 9 and tomcat 10/11 is the same,