tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: deploying a war file and starting the application
Date Fri, 28 Jan 2011 20:03:39 GMT

Thanks for your assistance.

Here is my web.xml

<?xml version='1.0' encoding='UTF-8'?>
<web-app xmlns="" xmlns:xsi=""
version="2.5" id="web-app_1">

This is the InitServlet class declaration  
	public class InitServlet extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet,
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("/");
		contextPath = getPathWithSeparator(contextPath);
		oLoaderStatic = new LoaderStatic();
        try {
            String sLogging = Configuration.getLogging(); 
        	Date date = new Date();
        	SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd");
        	logger.LogSetup(Configuration.getLoggingLocation().concat("//allMATCHWeb_" + formatter.format(date)
+ ".log"),sLogging);
        	logger.log("Configuration loaded from the file: ["+Configuration.getPropertiesLocation()+"]");
        } catch (Throwable th) {
            System.out.println("Error initializing logger.");
            try {
	        	logger.log("Error initializing logger.",th);
            catch (Throwable t) {}

Again, thanks for any insight or assistance...

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

-----Original Message-----
From: Christopher Schultz [] 
Sent: Friday, January 28, 2011 2:54 PM
To: Tomcat Users List
Subject: Re: deploying a war file and starting the application

Hash: SHA1


On 1/28/2011 1:09 PM, wrote:
> I have downloaded and configured Tomcat 7. All appears to be working.

Glad to hear it!

> I have deployed a war file that currently works with WebSphere 7 and
> WebLogic 11g.
> The first issue I had was with url-pattern. It appears that Tomcat
> requires they start with a slash (/). I made the change and I no longer
> receive any errors while starting Tomcat.

This is a spec requirement, not a Tomcat requirement. Other containers
may be more lenient.

> The following image shows the startup window and that my war is being
> deployed. Within the webapps directory a directory containing my webapp
> is created.

Images are stripped from posts to the list. Can you post it somewhere
online and give us a link? Or, just copy/paste any relevant content from
your screen?

> My initial servlet is called InitServlet and it is marked as
> load-on-startup (please see following image) .


> I have two questions
> 1)      If I type http://localhost:7080/allMATCHWeb in to a browser
> shouldn’t see this login.html page? I don’t… however I can access it by
>  http://localhost:7080/allMATCHWeb/login.html

You'll have to provide your web.xml for us to know when you need
authentication challenges. Are you using container-managed authentication?

> 2)      The load-on-start InitServlet class is not being executed as I
> have no logs generated or any other startup items handled, any ideas?

Again, including web.xml should help. Note that using an "InitServlet"
hasn't been recommended since the addition of the ServletContextListener
interface a long time ago.

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

This mail was sent via Mail-SeCure System.
View raw message