Search code examples
eclipsewildfly

Eclipse STS WildFly deployment - Target runtimes disabled


We have a java web application deployed in a Tomcat 9 container and running successfully. We wanted to change the application deployment to Wildfly 27 application server. The direct deployment of app.war used in tomcat container to WildFly standalone folder showed deployment as failed.

So we did the following to create a deployment war by building source from IDE by using JBoss tools.

-Installed WildFly 27 -Imported application source code in Spring Tool Suite (STS) -Installed JBoss tools in STS -Added WildFly server in STS. With no projects added, I can start the server successfully.

In Project Properties, I have the following configuration:

Properties -> Java Build Path

Here I removed the previously existing Server Runtime[Tomcat] and added WildFly 27.0 Runtime.

enter image description here

Properties -> Java Compiler

enter image description here

Properties -> Server

Properties -> Project Facets In Runtimes tab, WildFly 27.0 Runtime is disabled.

enter image description here

Properties -> Targeted Runtimes Here also, WildFly 27.0 Runtime is disabled. So I can’t change from Tomcat to WildFly.

enter image description here

How can I select WildFly 27.0 Runtime for the project? The instruction says to uninstall certain Facets to activate disabled runtimes. Which facets to uninstall?

When I started the WildFly server with the application, it shows errors

java.lang.IllegalArgumentException: UT010009:  
class org.springframework.web.servlet.DispatcherServlet does not implement jakarta.servlet.Servlet

service jboss.deployment.unit."app.war".undertow-deployment.UndertowDeploymentInfoService: Failed to start service

Please help.


Solution

  • WildFly 27 is a Jakarta EE 10 server. You cannot run a Jakarta EE 8 based, javax namespace, in WildFly 27. You'd need to either upgrade your dependencies to be Jakarta EE 10 based and Spring 6 or use WildFly 26.