Mark,

That’s for input.. the initservlet is just a means to initialize the 
application. The writing of a log file is not to a directory within tomcat. It 
is a directory outside of the environment. This information (the directory 
location) is supplied via property file. Which I doubt is being loaded.

Sincerely,

Robert Jenkin
Surecomp Services, Inc.
2 Hudson Place, 4th Floor
Hoboken, NJ 07030
Skype: robert.jenkin
Office: 201 217 1437 | Direct: 201 716 1219 | Mobile: 908 251 0537
http://www.Surecomp.com


-----Original Message-----
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Friday, January 28, 2011 3:13 PM
To: Tomcat Users List
Subject: Re: deploying a war file and starting the application

On 28/01/2011 20:03, robert.jen...@surecomp.com wrote:
> Christopher,
> 
> Thanks for your assistance.
> 
> Here is my web.xml
> 
> <?xml version='1.0' encoding='UTF-8'?>
> <web-app xmlns="http://java.sun.com/xml/ns/javaee"; 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; version="2.5" 
> id="web-app_1">

That does not look quite right to me. I'd normally expect to see the
following:

<web-app xmlns="http://java.sun.com/xml/ns/javaee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                      http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";
  version="2.5">

Tomcat is usually pretty tolerant of that sort of thing but worth
checking anyway.

>   <display-name>allMATCHWeb</display-name>
>   <servlet>
>     <servlet-name>InitServlet</servlet-name>
>     <servlet-class>com.surecomp.allMATCH.client.InitServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
>   </servlet>
>   <servlet-mapping>
>     <servlet-name>InitServlet</servlet-name>
>     <url-pattern>/InitServlet</url-pattern>
>   </servlet-mapping>

That looks OK. Not the recommended way to do things, but it should work.

>   <welcome-file-list>
>     <welcome-file>/login.html</welcome-file>

As per the Servlet specification, welcome files should not have leading
'/' characters.

>   </welcome-file-list>
> </web-app>
> 
> 
> This is the InitServlet class declaration  
>       public class InitServlet extends javax.servlet.http.HttpServlet 
> implements javax.servlet.Servlet, Internationalizable 
>       
> This is the start of init() method
> 
>     public void init() throws ServletException {
>         synchronized (this) {
>               if (initialized || initializing) return;
>               initializing = true;
>         }
>               logger = new Logging();
>               contextPath = getServletContext().getRealPath("/");

getRealPath() is not guaranteed to return a file system path. Also
writing log files inside the web app is usually a bad idea since you
lose the logs when the app is undeployed.


Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


This mail was sent via Mail-SeCure System.

Reply via email to