Hello, I'm working to configure Tomcat (6.0.24) for web support on Apache Felix (FUSE ServiceMix 4.3) using Spring DM Web (1.2.1) as described in the Spring DM reference docs, Chapter 9. Web Support.
I've been able to get Tomcat installed and running, the Spring DM Web and Spring DM Web Extender installed and resolved respectively, and have deployed a war file (the simple-web-app which is provided with version 1.2.1 of Spring OSGi). When I access the two servlets in the war tomcat finds the servlets and correctly delegates the requests, so everything works fine. However, when I attempt to access the welcome page (index.html) or one of the JSPs, I get a Tomcat 404 error page. Stepping through the Tomcat source, I found that when attempting to map the request to the Tomcat DefaultServlet, the context.defaultWrapper (should be a pointer to the Tomcat DefaultServlet) is null. I believe this means that the default servlet is not being initialized correctly.
I tried including a default web.xml (the same one provided with default Tomcat installations in $CATALINA_BASE/conf/web.xml) via a fragment attached to the tomcat activator as described in 9.6.1.1, however this did not work (result was the same).
To get the configuration to work, I had to add the following sections to the web.xml file in the simple-web-app:
Am I missing something, or perhaps the catalina.start.osgi-1.0.0.jar bundle is not correctly initializing the server? I'm worried that by defining the default servlet in individual applications' WEB-INF/web.xml will make it impossible to deploy more than one app. Any suggestions would be most appreciated.Code:<servlet> <servlet-name>default</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>false</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>jsp</servlet-name> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>fork</param-name> <param-value>false</param-value> </init-param> <init-param> <param-name>xpoweredBy</param-name> <param-value>false</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> [snip...] <!-- The mapping for the default servlet --> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <!-- The mapping for the JSP servlet --> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jspx</url-pattern> </servlet-mapping>
Thank you!
Mike Gillan
*Edit: I used resources (list of dependencies, etc.) posted in this stackoverflow post to get my setup working in case anyone finds this thread attempting the same. HTH!![]()


