503 Service Unavailable error Apache Tomcat - java

I try to deploy my Java project Apache Tomcat server but sometimes it gets down and returns me this page
Tomcat is installed on the Digitalocean's Ubuntu 14.04 and droplet's properties are 512Mb/1CPU, 20GB SSD Disk, 1000 GB transfer. I took the lowest option for test purposes. The site is visited by nobody except me and from the graphs I observe that the server is not overloaded at all. Most of the time everything works fine until suddenly the server returns 503. After I restart it keeps working fine again till the next 503 error in several days. I'd like to know what could cause this error: my mistake on configuring the server or maybe problems on server side?

That mean tomcat is not running. You can use the alias command to up the tomcat service or just go in the current directory and start the service.
Example: # tomcatup
/opt/tomcat8/bin/startup.sh

Related

JVM crash during Weblogic Server Start and huge error log

I am using Weblogic 10.3.6 and deployed few applications. I always do a clean stop start with the server. Suddenly one day when I am starting my server, it goes until 97% and then the JVM is getting crashed, and JAVA process stops and the server is unable to start from then. I tried to investigate from the WLS log file but it has nothing much except the JVM crash report. Also I saw there are many error logs which were mainly related to one of my application (like dispatcher servlet, struts2 error .. fileNotFound error etc).
Is it due to the huge application error getting piled up which is causing the JVM restart ? I have removed all the temp and cache. Restarted my machine but still unbale to start the weblogic server. Is there any way to start it ? I am not willing to delete the domain and create it again because there are so many configurations present.
I have removed the erroneous application from the list of deployed application from file config.xml inside domain_name/config folder. Then gave a server start and my WLS started fine. The issue was due to the faulty application. Thanks I did not have to delete the entire domain. But I could not establish as why there was a JVM crash and how shall I handle it from next time.

Unable to start tomcat 8 on ubuntu 16.0.4 TLS

I have written an application on REST API's and deployed that on tomcat 8.0.36. When I start the application from eclipse it gives me a timeout message after 45 seconds "Server Tomcat v8.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor."
I have done all the troubleshooting stuff:
1) Deleted the server from the server perspective and re-added the server and tried to re-deploy it
2) get the same message as above.
3) I have tried by launching the tomcat without the application deployed it starts .
Regards
Vilas
To increase the tomcat boot time, you must follow the following steps:
Launch Eclipse
On Servers view, double click on you tomcat server configuration
Find the option Timeouts, this is in the top right of editor
Increase the time, for example 120.

Tomcat restarts with errors (exit 143), runs and then fails after time

This is my first time asking a question on Stack Overflow. I recently configured an Ubuntu 16.04 virtual private server to host a web application. I run ngnix on a Tomcat server that reads and writes to a MySQL database. The application runs fine except for the fact that Tomcat restarts itself once in a while which results in a 500 error that stems from a "broken-pipe" when anyone tries to login (i.e. make a connection to the database).
I will post an image of the 500 next time it happens. I went into my vps and looked at my Tomcat restart message. This is what I see: Tomcat status message.
I also did a little diving into the Tomcat logs and this is a log file that corresponds with that restart time: Tomcat log file
I did some research to try and solve this myself, but with no success. I believe that the exit=143 is the process being terminated by another program or the system itself. I also have done some moving of the mysql-connector-java.jar. I read that it should be located in the Tomcat/lib directory and not in the WEB-INF of the web application. Perhaps I need to configure other settings.
Any help or any direction would be much appreciated. I've fought this issue for a week with having learned much, but accomplished little.
Thanks
Look at the timeline. It starts at 19:49:23.766 in the Tomcat log with this message:
A valid shutdown command was received via the shutdown port. Stopping the Server instance.
Exit code 143 is a result of that shutdown and doesn't indicate anything.
The question you need answered is: Who send that shutdown command, and why?
On a side note: The earlier messages indicates that Tomcat lost connection to the database, and that you didn't configure a validation query. You should always configure that, since database connections in the connection pool will go stale, and that needs to be detected.
Theory: Do you have some monitoring service running that tests your application being up? Does that monitoring detect a timed-out database connection, classify that as a hung webapp and auto-restart Tomcat?
While I don't think I am able to see to the core of the problem you have with your overall setup given the small excerpt of your log files, one thing strikes the eye. In the Tomcat log, there is the line
A valid shutdown command was received via the shutdown port. Stopping the server instance.
This explains why the server was restarted. Someone (some external process, a malicious attacker, script, or whatever. Could be anything depending on the setup of your server) sent a shutdown command to Tomcat's shutdown port (8005 by default) which made the Tomcat shut down.
Refer to OWASP's recommendations for securing a Tomcat server instance for fixing this possible security whole.
Regarding the ostensible Hibernate problems you have, I don't get enough information from your logs to make a useful statement. But you can leave the MySQL jar in Tomcat/lib, since this is not the root cause of your problem.

Ubuntu tomcat 8 server CPU 100% prolem

I am working with a ubuntu web server, where I have tomcat 8 and running a web application on tomcat. Recently I have faced some problem with cpu uses 100%. When I restart the tomcat server it is running good, but after one day or a few hour again same problem arise ( 100% cpu use) and that problem make my site slow. When I see the process list with htop command then i see so many process like
/opt/java8/jre/bin/java -Djava.util.logging.config.file=/opt/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoader
The website is a live eCommerce website and average user in every moment is around 100.
The server is a aws ec2 server where a tomcat and a java application inside the tomcat is running. The database (MySql) is in an another aws RDS server.
What can i do in this situation? Please help.

difficulty setting up apache tomcat

I am trying to install, run and do something with tomcat for the first time.
apache-tomcat-7.0.16-windows-x86
I am running windows 7/firefox 4.0.
My first step is to run tomcat and be able to see some welcome screen on
http://localhost:8080/
I get the error that:
Firefox can't establish a connection to the server at localhost:8080.
I connect to internet by using a data card, if this info is needed at all.
I have also downloaded/installed JDK,struts in the system, but I think the above step doesn't need or clash with these things.
try with
http://127.0.0.1:8080/
http://www.coreservlets.com/Apache-Tomcat-Tutorial/

Categories