[jboss-dev-forums] [JBoss AS7 Development] - JSP Servlet Mapping
Shelley Baker
do-not-reply at jboss.com
Fri Aug 5 13:47:04 EDT 2011
Shelley Baker [http://community.jboss.org/people/shelleyb] created the discussion
"JSP Servlet Mapping"
To view the discussion, visit: http://community.jboss.org/message/619707#619707
--------------------------------------------------------------
When mapping a servlet to a jsp-file rather than a servlet-class on JBoss AS 7, the servlet is marked as unavailable due to the following exception: "javax.servlet.ServletException: No servlet class has been specified for servlet jsp."
12:29:36,992 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/jsp-test]] (MSC service thread 1-10) Servlet /jsp-test threw load() exception: javax.servlet.ServletException: No servlet class has been specified for servlet jsp
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1149) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3631) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3844) [jbossweb-7.0.0.CR4.jar:7.0.0.Final]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.0.Final.jar:7.0.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1765)
at org.jboss.msc.service.ServiceControllerImpl$ClearTCCLTask.run(ServiceControllerImpl.java:2291)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_26]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_26]
at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]
The servlet mapping is as follows in my 2.5 web deployment descriptor:
<servlet>
<servlet-name>jsp</servlet-name>
<jsp-file>/jsp.jspx</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>/jsp</url-pattern>
</servlet-mapping>
The servlet specification allows servlets to be mapped to +either+ a servlet-class or jsp-file, so the web.xml itself is valid. I'm wondering why the exception seems to indicate that a servlet class must be specified. Also note that this code deploys and runs correctly on Tomcat 7 and WAS 7. Is there something else that I need to configure to allow this servlet to load?
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619707#619707]
Start a new discussion in JBoss AS7 Development at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2225]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20110805/79248947/attachment.html
More information about the jboss-dev-forums
mailing list