0

I'm trying to change the context path of a tomcat application. I've read this question and have tried to add a root.xml file as described in the accepted answer:

Add root.xml file in $CATALINA_BASE/conf/[enginename]/[hostname]/ and add this as :

<Context 
  docBase="/opt/mywebapps/<yourApp>" 
  path="" 
  reloadable="true" 
/>

For more detail you can use the Apache context configuration link : http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

But this doesn't work for me. What am I missing here?

Path to my webapp: C:\apache-tomcat\webapps\activiti-webapp-explorer2-5.18.0

Path to my root.xml file: C:\apache-tomcat\conf\Catalina\localhost\root.xml

Also, is creating root.xml file is still the preferred way of configuring a context path for a webapp? If there's a mode "correct" way of doing this, I would like to know about it.

EDIT:

There are two important things that I forgot to mention. The first one is that I'm using tomcat 7. The second one is that I also can't access my app by navigating to localhost:8080/activiti-webapp-explorer2-5.18.0

EDIT2:

Here's my C:\apache-tomcat\conf\Catalina\localhost\root.xml:

<Context path="activiti-explorer-2" docBase="C:\apache-tomcat\webapps\activiti-webapp-explorer2-5.18.0" reloadable="true">

Here's my C:\apache-tomcat\webapps\activiti-webapp-explorer2-5.18.0\WEB-INF\web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>Vaadin Web Application</display-name>
    <distributable />


    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>true</param-value>
    </context-param>

    <!-- To load the Spring context -->
    <listener>
        <listener-class>org.activiti.explorer.servlet.WebConfigurer</listener-class>
    </listener>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- To allow session-scoped beans in Spring -->
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>

    <filter>
        <filter-name>SecurityFilter</filter-name>
        <filter-class>waffle.servlet.NegotiateSecurityFilter</filter-class>
        <init-param>
            <param-name>principalFormat</param-name>
            <param-value>fqn</param-value>
        </init-param>
        <init-param>
            <param-name>roleFormat</param-name>
            <param-value>both</param-value>
        </init-param>
        <init-param>
            <param-name>allowGuestLogin</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>impersonate</param-name>
            <param-value>false</param-value>
        </init-param>
        <init-param>
            <param-name>securityFilterProviders</param-name>
            <param-value>waffle.servlet.spi.NegotiateSecurityFilterProvider waffle.servlet.spi.BasicSecurityFilterProvider</param-value>
        </init-param>
        <init-param>
            <param-name>waffle.servlet.spi.NegotiateSecurityFilterProvider/protocols</param-name>
            <param-value>Negotiate NTLM</param-value>
        </init-param>
    </filter>

    <filter-mapping>
        <filter-name>SecurityFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter>
        <filter-name>UIFilter</filter-name>
        <filter-class>org.activiti.explorer.filter.ExplorerFilter</filter-class>
    </filter>

    <filter>
        <filter-name>JSONPFilter</filter-name>
        <filter-class>org.activiti.explorer.servlet.JsonpCallbackFilter</filter-class>
    </filter>

    <filter-mapping>
        <filter-name>UIFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>JSONPFilter</filter-name>
        <url-pattern>/service/*</url-pattern>
    </filter-mapping>

    <servlet>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <servlet-class>org.activiti.explorer.servlet.ExplorerApplicationServlet</servlet-class>
        <init-param>
            <param-name>widgetset</param-name>
            <param-value>org.activiti.explorer.CustomWidgetset</param-value>
        </init-param>
    </servlet>

    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/ui/*</url-pattern>
    </servlet-mapping>

    <servlet-mapping>
        <servlet-name>Vaadin Application Servlet</servlet-name>
        <url-pattern>/VAADIN/*</url-pattern>
    </servlet-mapping>

    <!-- Session timeout on one day -->
    <session-config>
        <session-timeout>480</session-timeout>
    </session-config>



</web-app>

Thank you in advance.

Community
  • 1
  • 1
Aviran Katz
  • 741
  • 2
  • 8
  • 26

0 Answers0