Skip to content

Fix add javax servlet api#203

Merged
ninhomilton merged 3 commits intomainfrom
fix/add_javax_servlet_api
Apr 24, 2026
Merged

Fix add javax servlet api#203
ninhomilton merged 3 commits intomainfrom
fix/add_javax_servlet_api

Conversation

@ninhomilton
Copy link
Copy Markdown
Collaborator

@ninhomilton ninhomilton commented Apr 23, 2026

After migrating to Spring Boot 3.x + Java 21, applications that use hive-metastore 2.3.7 fail at runtime

hive-metastore 2.3.7 was compiled against the old javax.servlet API. Spring Boot 3 / Tomcat 10 migrated to the jakarta.servlet namespace (Jakarta EE 9), so javax.servlet.Filter is no longer on the classpath.

Solution:

  1. Add javax.servlet:javax.servlet-api:3.1.0 at runtime scope to all modules that have hive-metastore in their runtime classpath. The javax.* and jakarta.* namespaces are entirely separate packages and coexist safely — Spring Boot 3 uses jakarta.* for its own code while Hive's classloading finds javax.* from this dependency.
  2. Exclude tomcat:jasper-compiler and tomcat:jasper-runtime from hive-metastore in the modules where they are pulled in transitively (beekeeper-cleanup, beekeeper-scheduler). This prevents the ClassCastException caused by JspServlet implementing the old javax.servlet.Servlet interface.

miltortegon_expedia and others added 3 commits April 22, 2026 11:46
…eption on Java 21

hive-metastore 2.3.7 references javax.servlet.Filter internally when opening
the metastore client. Spring Boot 3.x migrated to Jakarta Servlet (jakarta.*)
and no longer provides javax.servlet on the classpath. The existing exclusions
removed javax.servlet transitive dependencies without providing a runtime shim,
causing ClassNotFoundException at startup.

Adding javax.servlet-api:3.1.0 at runtime scope in beekeeper-scheduler,
beekeeper-scheduler-apiary, and beekeeper-metadata-cleanup satisfies Hive's
classloading without interfering with Spring's Jakarta servlet stack.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…let ClassCastException

Adding javax.servlet-api:3.1.0 at runtime (for Hive classloading) allows the old
tomcat:jasper-runtime JspServlet to be loaded. Tomcat 10.x (Spring Boot 3.x) then
tries to cast it to jakarta.servlet.Servlet and fails with ClassCastException.

Excluding tomcat:jasper-compiler and tomcat:jasper-runtime from hive-metastore in
beekeeper-cleanup prevents the old Jasper from appearing on the classpath entirely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… Hive modules

beekeeper-scheduler: excludes tomcat:jasper-compiler and tomcat:jasper-runtime from
hive-metastore. Without these exclusions, beekeeper-scheduler-apiary (which depends on
beekeeper-scheduler) inherits old Jasper via the transitive chain. Old JspServlet
implements javax.servlet.Servlet, which Tomcat 10.x cannot cast to jakarta.servlet.Servlet.

beekeeper-path-cleanup: adds javax.servlet-api:3.1.0 at runtime scope. As a Spring Boot
web app using hive-metastore transitively via beekeeper-cleanup, it needs javax.servlet
on the classpath so HiveMetaStoreClient.open() can load javax.servlet.Filter at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ninhomilton ninhomilton merged commit be42b6e into main Apr 24, 2026
3 checks passed
@ninhomilton ninhomilton deleted the fix/add_javax_servlet_api branch April 24, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants