Problems with Tomcat 7

Asked

Viewed 1,279 times

3

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

http://localhost:8085

and

http://localhost:8085/examples

(examples that already comes 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, works normally, being the same settings.

1 answer

2


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

When Tomcat boots, it deploys all the configured applications one by one, creating the context of each one and then serving the requests.

However, if during the deploy from one of the applications an error occurs, its context is dropped and Tomcat continues its operations normally.

The most common causes of an application running locally but not on another server are:

  1. Difference in environment: database or other resources are not available are with access data modified.
  2. Incorrect configuration: may be missing some configuration. Check if the context.xml of its application has the correct data for the DataSources required. Also check if the application has file or directory dependencies (logs, properties, ...).
  3. Difference in WAR: It may be that the WAR used on the server does not have the same content that is being used in the development environment. In this case, check the version generation procedure.
  4. Difference from the Tomcat: check if there are different libs (jars) between your Tomcat installation and the one on the server, because it is missing or leaving classes and generating problems class loaders. Also check if something is missing from server.xml or in the context.xml general Tomcat. I’ve seen some applications that need specific settings on catalina.properties.

It is good to compare Tomcats files. It is also good to check if the system has any installation manual where you can describe the procedure for deploy in a Tomcat "new".

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

  • also knows if it can be some difference or permission in the issue of operating system? Because for free, I copied the complete folder of tomcat7 from my machine and pasted it on the server, so options 3 and 4 can be practically discarded. For Tomcat and War are the same. Soon I will do what you indicated me in option 2. Option 1, even a page that would not have access to database, would not bring error 404, or bring?

  • 1

    @Ericosouza Error 404 indicates that the page was not found, so the application is not started. The reason it is not started can be anyone, from a serious error in the application to the incorrectly typed URL. It might have something to do with system permission, especially if the application accesses some local resource. Don’t forget to see the log.

  • I could see here, in Tomcat’s log, he gives me this error: threads are going to be renewed over time to Try and avoid a probable memory Leak, is already a way.

  • 1

    @Ericosouza This is just one Warning, It’s not a mistake. Stop Tomcat, delete the log files, remove the other applications leaving only the one that is in trouble, restart Tomcat and then look at all the logs carefully to find problems.

  • 1

    @Ericosouza If you want you can put a link to the logs I take a look.

  • Thanks for the help @utluiz, if it’s no bother, I did as you told me, and here are the links of the logs: http://www.ericosouza.com/log/catalina.2015-01-06.txt http://www.ericosouza.com/log/host.2015-01-06.txt

Show 1 more comment

Browser other questions tagged

You are not signed in. Login or sign up in order to post.