[jboss-jira] [JBoss JIRA] (AS7-3892) Integration with SpringServletContainerInitializer incorrect
Garry Dias (JIRA)
issues at jboss.org
Wed Jul 16 13:46:31 EDT 2014
[ https://issues.jboss.org/browse/AS7-3892?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12985740#comment-12985740 ]
Garry Dias commented on AS7-3892:
---------------------------------
A similar problem happens when I deploy my _WAR_ with empty _WEB-INF/lib_ directory in _JBoss 7.1.1.Final_.
My lib directory is empty because all my required libs (including _spring-web-3.2.9.jar_) are deployed in my custom module _JBOSS_HOME/modules/com/tests/commomlibs/main/_.
Debugging _ServletContainerInitializerDeploymentProcessor.processHandlesType_ method I detected that not a single class is added to _class_ variable and the method returns an empty Set for each _processHandlesType_ method invocation (during my app deployment via JBoss web console).
This problem does not happen when a web.xml is included in WEB-INF directory.
I have used this project to test https://github.com/rajendersaini/javaCfg.
My I open a new Issue? May I doing something wrong?
Thanks
> 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.0.2.Final, 7.1.0.Final
> Reporter: Martin Vanek
> Assignee: Jason Greene
> Fix For: 7.1.1.Final
>
>
> 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 was sent by Atlassian JIRA
(v6.2.6#6264)
More information about the jboss-jira
mailing list