[jboss-jira] [JBoss JIRA] (AS7-3892) Integration with SpringServletContainerInitializer incorrect

Martin Vanek (JIRA) jira-events at lists.jboss.org
Thu Feb 23 15:31:36 EST 2012


Martin Vanek created AS7-3892:
---------------------------------

             Summary: Integration with SpringServletContainerInitializer incorrect
                 Key: AS7-3892
                 URL: https://issues.jboss.org/browse/AS7-3892
             Project: Application Server 7
          Issue Type: Bug
          Components: Server, Web
    Affects Versions: 7.1.0.Final, 7.0.2.Final
            Reporter: Martin Vanek
            Assignee: Jason Greene


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));
    }
}
      



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list