Problems with Tomcat 7

3

I have a Java web application, installed on a Windows Server. When starting tomcat, it works normally, and addresses like:

http://localhost:8085

and

http://localhost:8085/examples

(examples that already come with tomcat)

They work normally, but when I try to access my application:

http://localhost:8085/minha-aplicacao

I have the error 404 .

What makes me more confused is that in my development notebook, it works normally, being the same settings.

    
asked by anonymous 05.01.2015 / 17:09

1 answer

2

The Tomcat server can work normally, including several applications installed on it, but your application is not initialized.

When Tomcat initializes, it deploys all configured applications one by one, creating the context for each one to serve the requests.

However, if an error occurs during the deploy of an application, its context is discarded and Tomcat continues its operations normally.

The most common causes of an application that works locally, but not on another server are:

  • Environment Difference : Database or other features are not available or have modified access data.
  • Incorrect configuration : Some configuration may be missing. Make sure the context.xml of your application has the correct data for% required%. Also check if the application has dependencies on files or directories (logs, properties, ...).
  • Difference in WAR : The WAR used on the server may not have the same content that is being used in the development environment. In this case, check the version generation procedure.
  • Tomcat Difference : Check for different libs (jars) between your Tomcat aa installation that is on the server, missing or missing classes, and generating class loaders . Also check if you are missing something in DataSources or server.xml of Tomcat. I've seen some applications that needed specific settings in context.xml .
  • It's good to compare the Tomcat files. It is also good to check if the system has some installation manual where you can describe the deploy procedure on a "new" Tomcat.

    The main tip is to always start by analyzing the logs generated by Tomcat during the attempt to start the application. Almost always it will give the solution or at least a tip.

        
    05.01.2015 / 17:37