What is this dispatcher error?
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[200,3]
Message: Unexpected element '{http://java.sun.com/xml/ns/javaee}dispatcher' enco
untered
at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElemen
t(MetaDataElementParser.java:115)
at org.jboss.metadata.parser.servlet.ServletMappingMetaDataParser.parse(
ServletMappingMetaDataParser.java:77)
at org.jboss.metadata.parser.servlet.WebCommonMetaDataParser.parse(WebCo
mmonMetaDataParser.java:110)
at org.jboss.metadata.parser.servlet.WebMetaDataParser.parse(WebMetaData
Parser.java:184)
at org.jboss.metadata.parser.servlet.WebMetaDataParser.parse(WebMetaData
Parser.java:57)
at org.wildfly.extension.undertow.deployment.WebParsingDeploymentProcess
How do we fix it?
We need to use Spring security with urlrewrite, so this works by having those dispatcher tag. If we comment out the tag, jboss does not complain:
<servlet-mapping>
<servlet-name>CrudServlet</servlet-name>
<url-pattern>/ws/crud</url-pattern>
<!--
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>INCLUDE</dispatcher>
-->
</servlet-mapping>
How to make it work with both GAEJ and Wildfly?
Thanks so much!
The servlet spec only defines <dispatcher> tags inside <filter-mapping>, not in <servlet-mapping>.
CapeDwarf/WildFly is strict about this and throws the exception, GAEJ simply ignores it.