Skip to content
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

Undertow: ignore missing servlet class in web.xml #44063

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,14 @@ public ServletDeploymentManagerBuildItem build(List<ServletBuildItem> servlets,
//add servlets
if (webMetaData.getServlets() != null) {
for (ServletMetaData servlet : webMetaData.getServlets()) {
String servletClass = servlet.getServletClass();
if (servletClass == null) {
continue;
}
reflectiveClasses.accept(
ReflectiveClassBuildItem.builder(servlet.getServletClass()).build());
ReflectiveClassBuildItem.builder(servletClass).build());
RuntimeValue<ServletInfo> sref = recorder.registerServlet(deployment, servlet.getServletName(),
context.classProxy(servlet.getServletClass()),
context.classProxy(servletClass),
servlet.isAsyncSupported(),
servlet.getLoadOnStartupInt(),
bc.getValue(),
Expand All @@ -447,7 +451,7 @@ public ServletDeploymentManagerBuildItem build(List<ServletBuildItem> servlets,
if (webMetaData.getAnnotations() != null) {
for (AnnotationMetaData amd : webMetaData.getAnnotations()) {
final ServletSecurityMetaData ssmd = amd.getServletSecurity();
if (ssmd != null && amd.getClassName().equals(servlet.getServletClass())) {
if (ssmd != null && amd.getClassName().equals(servletClass)) {
// Process the @ServletSecurity into metadata
ServletSecurityInfo securityInfo = new ServletSecurityInfo();
securityInfo.setEmptyRoleSemantic(
Expand All @@ -471,7 +475,7 @@ public ServletDeploymentManagerBuildItem build(List<ServletBuildItem> servlets,
}

final MultipartConfigMetaData mcmd = amd.getMultipartConfig();
if (mcmd != null && amd.getClassName().equals(servlet.getServletClass())) {
if (mcmd != null && amd.getClassName().equals(servletClass)) {
servlet.setMultipartConfig(mcmd);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ WebMetadataBuildItem createWebMetadata(ApplicationArchivesBuildItem applicationA
}
if (metadata.getServlets() != null) {
for (ServletMetaData i : metadata.getServlets()) {
additionalBeans.add(i.getServletClass());
String servletClass = i.getServletClass();
if (servletClass != null) {
additionalBeans.add(servletClass);
}
}
}
if (metadata.getFilters() != null) {
Expand Down
Loading