Announcement Announcement Module
Collapse

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
Configuring Tomcat for Web Support for DM 1.2.1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Configuring Tomcat for Web Support for DM 1.2.1

    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:

    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>
    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.

    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!
    Last edited by mikegillan; Nov 9th, 2010, 10:26 AM.
Working...
X