JBoss Community

Re: JSP Servlet Mapping

created by Shelley Baker in JBoss AS7 Development - View the full discussion

It appears that this problem was caused by the use of the "jsp" servlet-name which I was using for testing purposes. Most likely, the "jsp" servlet-name was already reserved by the container. After I changed it to something other than "jsp," everything worked as expected.

    <servlet>
        <servlet-name>jspTest</servlet-name>
        <jsp-file>/jsp.jspx</jsp-file>
    </servlet>
    <servlet-mapping>
        <servlet-name>jspTest</servlet-name>
        <url-pattern>/jsp</url-pattern>
    </servlet-mapping>

It was a little bit surprising that this worked on Tomcat though, since my understanding was that JBoss was built on Catalina. After testing it on geronimo-tomcat7-javaee6-3.0-M1, it failed with the same error, though, so there must be something different with Tomcat. Fortunately, deploying to geronimo-jetty7-javaee5-2.2.1 gave me a much more useful exception message "org.apache.geronimo.common.DeploymentException: jsp servlet already present" that lead me to test the use of a different servlet-name.

Reply to this message by going to Community

Start a new discussion in JBoss AS7 Development at Community