See below.

On Thu, 10 Oct 2002, FRASER, JORGE wrote:

> Date: Thu, 10 Oct 2002 15:54:37 -0500
> From: "FRASER, JORGE" <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: Problems configuring servlets...
>
> Hello all,
>
> We are in the process of trying to migrate our applications from Tomcat 3.1
> to 4.1. Our problem resides in the fact that we run the main app as the
> default context, Here's the context definition in 3.1:
>
>    <Context path="/"
>       docBase=/valnet"
>       debug="0"
>         reloadable="true">
>               <LogSetter name="tc_log"
>               path="logs/valnet.log"
>               verbosityLevel="DEBUG"
>               TimeStamps="true" />
>          <LogSetter name="valnet_servlet_log"
>            path="logs/valnet_servlet.log"
>            verbosityLevel="DEBUG"
>            servletLogger="true" />
>    </Context>
>
> Here's the definition in 4.1:
>
> <Context className="org.apache.catalina.core.StandardContext"
> crossContext="false" reloadable="true"
> mapperClass="org.apache.catalina.core.StandardContextMapper"
> useNaming="false" debug="0" swallowOutput="false" privileged="false"
> wrapperClass="org.apache.catalina.core.StandardWrapper" docBase="C:\Program
> Files\Apache Group\Tomcat 4.1\webapps\valnet" cookies="true" path=""
> cachingAllowed="true"
> charsetMapperClass="org.apache.catalina.util.CharsetMapper">
>         </Context>
>
> The problem that we are encountering is that when we port this to 4.1, the
> servlets cannot be accessed.
> We get a 404 error saying that the resource could not be found.
>
> We have the servlets define in web-xml under the WEB-INF directory similar
> to the following:
>
>     <servlet>
>        <servlet-name>Groups</servlet-name>
>        <servlet-class>WebApp.s_authentication.Groups</servlet-class>
>        <load-on-startup>999</load-on-startup>
>     </servlet>
>
> When the above servlet gets called it generates the following error:
>
> type Status report
> message /servlet/WebApp.s_authentication.s_authentication
> description The requested resource
> (/servlet/WebApp.s_authentication.s_authentication) is not available.
>

In version 4.1.12 of Tomcat, the invoker servlet (the one that handles
"/servlet/*" paths) got disabled by default for security related reasons.
Although you can re-enable it by uncommenting the appropriate
<servlet-mapping> in the default configuration file
($CATALINA_HOME/conf/web.xml), you are much better off creating explicit
mappings for each of your servlets in the web.xml file.  For example, a
mapping for the servlet you defined above, which maintains existing URLs,
would look like this:

  <servlet-mapping>
    <servlet-name>Group</servlet-name>
    <url-pattern>/servlet/s_authentication.Groups/*</url-pattern>
  </servlet-mapping>

Remember that the order of elements in web.xml is required to match the
DTD, so put all your servlet mapping elements *after* the servlet
elements.

(Of course, you can also use servlet mappings to map *any* legal URL to a
particular servlet, but doing the above is easiest in a conversion case.)

> Any help would be greatly appreciated...
>
> Jorge Fraser
> Valspar Corporation
> 1101 S. Third St.
> Minneapolis, MN 55415
> Phone: (612) 375-7309
> e-mail: [EMAIL PROTECTED]
>
> A nickel ain't worth a dime anymore.
> -Yoggi Berra
>

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to