I have an older Java/JSP application that I have to update to Tomcat 10 by May 31, 2025. This change in Tomcat versions covers Java's recent javax -> jakarta
API namespace change in the packages included with Tomcat, so I have to update the application to use the jakarta
namespace instead of javax
.
This application imports a class WebContextFactory
(uk.ltd.getahead.dwr.WebContextFactory.class
) from a package called "DWR" ("Direct Web Remoting") that's contained in a JAR dwr.jar
that we don't have the source code for. This class invokes the javax
namespace, and thus I can't update my application without either amending the source code or (preferably) replacing it with a more up-to-date version of the package.
There does appear to be an updated version of the library on GitHub. However, when I attempt to build this source code into a JAR using the provided Ant buildfile, it results in an internal error due to its included jakarta.servlet.ServletConfig
class:
[javac] .../dwr-2024/core/api/main/java/org/directwebremoting/ServerContext.java:5: error: cannot access ServletConfig [javac] import jakarta.servlet.ServletConfig; [javac] ^ [javac] bad class file: .../dwr-2024/target/ant/lib/jakarta.servlet-api-6.1.0.jar(jakarta/servlet/ServletConfig.class) [javac] class file has wrong version 55.0, should be 52.0 [javac] Please remove or make sure it appears in the correct subdirectory of the classpath.
This file does not have source code within the dwr-2024
code repo, so I can't investigate further based on what I have.
The DWR project's GitHub page, linked above, doesn't allow issues to be posted. They have a Dojo page for users, and I've posted there, but it seems to be full-on dead at this point and I can't rely on getting help there in time to meet the May 31 deadline.
I have independently found the source code for jakarta.servlet.ServletConfig
, but I'm not certain I have the skill to amend it to work with dwr-2024
. Does anyone here a better way to either contact the DWR group for help, or another way to fix this code?