Details
-
Bug
-
Resolution: Done
-
Major
-
7.0.2.Final, 7.1.0.Final
-
None
Description
Recently I have tried to install simple Spring 3.1 MVC application without web.xml to jboss 7.0.2. The context failed to load, only message indicating the something is wrong is from spring:
INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/test]] (MSC service thread 1-3) No Spring WebApplicationInitializer types detected on classpath.
I have tried to investigate the problem and it seems that problem is in class org.jboss.as.web.deployment.ServletContainerInitializerDeploymentProcessor. The reason is that spring uses interface WebApplicationInitializer in @HandlesTypes annotation and the method processHandlesType of class ServletContainerInitializerDeploymentProcessor scans only subclasses. I guess Spring guys did not nothing wrong in implementation of the ServletContainerInitializer so I think it is the problem of JBoss.
@HandlesTypes(WebApplicationInitializer.class)
public class SpringServletContainerInitializer implements ServletContainerInitializer {
....
}
I guess the processHandlesType method has to be changed something like this.
private Set<ClassInfo> processHandlesType(DotName typeName, Class<?> type, CompositeIndex index) throws DeploymentUnitProcessingException {
Set<ClassInfo> classes = new HashSet<ClassInfo>();
if (type.isAnnotation())
else
{ classes.addAll(index.getAllKnownSubclasses(typeName)); classes.addAll(index.getAllKnownImplementors(typeName)); }}