-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServletListener not running after upgrade to "jakarta" servlet packages #2298
Comments
Thanks @Toukite for the details provided here. We will take a look at this in more detail after the holiday break. Also, wanted to make sure you knew about Liquibase Forum -- it is turning into a pretty solid resource for users and contributors. |
So, it's going to take having a separate implementation of LiquibaseServletListener that uses
instead of
which will mean creating an alternative LiquibaseServletListener, LiquibaseStatusServlet, and ServletConfigurationValueProvider to use jakarta.servlet.* instead of javax.servlet. *. Since we need to support both, it will be a question of extracting base classes with the logic and then subclasses with the version-specific methods and implementations in it |
@Toukite would you be able to test the build from #2339 to see if it works for you? I don't use Tomcat 10 enough to have a great test environment for it. You can get the build artifacts from the "Checks" tab. You will have to change your listener class to:
|
Environment
Liquibase Version: 4.6.2
Liquibase Integration & Version: servlet
Liquibase Extension(s) & Version: N/A
Database Vendor & Version: N/A
Operating System Type & Version: N/A
Description
We have been using an adaptation of this https://github.com/liquibase/liquibase/blob/master/liquibase-core/src/main/java/liquibase/integration/servlet/LiquibaseServletListener.java with a tomcat 8 + jdk8 web application and it was working fine.
After migrating to tomcat 10 + jdk17, webapp has been adapted to follow the breaking changes (the fact that Java EE was migrated from Oracle to the Eclipse Foundation, and that is now called Jakarta EE, which implied a changed in the libraries of the project and a renaming of all javax.xxx imports to jakarta.xxx imports)
Unfortunately, this Liquibase servlet does not like the change.
Steps To Reproduce
List the steps to reproduce the behavior.
Just try to use the https://github.com/liquibase/liquibase/blob/master/liquibase-core/src/main/java/liquibase/integration/servlet/LiquibaseServletListener.java with tomcat 10 and jdk 17
Actual Behavior
Does not compile
And if we add javax.servlet-api-4.0.1.jar to the project so that this servlet can compile, then it is not executed at startup (no issue with the other listeners of the project which run the same way)
No change in web.xml regarding this:
Expected/Desired Behavior
We would like the LiquibaseServletListener to be able to run at startup using tomcat 10 + jdk17
The text was updated successfully, but these errors were encountered: