Tomcat returns 404 status - java

I was trying to change the user who runs the tomcat process.
In process of changing I have added new user and made tomcat run under him.
how now if i ping the tomcat, I get 404 error.
I am not sure how to proceed.
Can I check if tomcat has loaded all the classes ?
Can I check anything else to make sure tomcat loaded the servlets.
Is there anything else I can check to resolve this 404 error.
Thanks a lot

You didn't say what operating system you are using. Look in your tomcat logs directory and verify that tomcat actually started up. A lot of times the log will be called catalina.out. It should say "server starting up in X ms". Also, look at the running processes on your system. There should be a Java process running for Tomcat. You can also use netstat or dig on Linux to see if there is a process listening on a particular port. You can check what port Tomcat should be listening on by looking in the conf directory and looking at the Tomcat server configuration in the server.xml file.

Related

How to see tomcat console when tomcat started from services

This might be silly question but I really don't know it.
I have performed some changes in my web application in java/jsp.
Tested it in localhost in eclipse where I can see logs in console.
After that I have deployed the changes to beta server and its not
reflecting as in localhost hence want to see running logs through
tomcat console but Tomcat is already running and was started with
services utility of windows.
Is there any way to open console of running tomcat.
I do know that we can see tomcat logs as well, but running console
will be preferred for me as there are multiple projects are running on
same server.
You can check log file(s) in the tomcat-home/logs folder.
You can attach Eclipse to a running process if you have started the server with the right settings: see Attach debugger to application using Eclipse On windows, you can either delete and reinstall the services as in https://tomcat.apache.org/tomcat-7.0-doc/windows-service-howto.html or, you can add these parameters in the Windows registry for the Tomcat you are running: see http://www.tomcatexpert.com/knowledge-base/allocating-more-ram-tomcat-windows . I would be very careful with the registry hack unless you've hacked the registry before and are comfortable doing it.

glassfish is not accessible, even though domain started

I have had glassfish installed and running on my server for a few weeks now everything was working fine but today its behaving very weirdly,
I first tried to access the admin page but it wouldnt load, so i tried to stop the domain, when I ran asadmin stop-domain domain1, the command just sat there doing nothing, tried starting the domain again, it said the domain is already running.
so I restarted the server. Still had the same issue, then went to taskmanager and stopped the glassfish server from there, started the domain again from asadmin.
now on localhost:4848 it shows the page for glassfish server is loading but nothing happens beyond that, once it showed me the login page but after I entered the credentials it didn't go any further just kept loading, non of the applications on the server are also accessible.
I checked the logs and there is nothing abnormal there just shows the regular server loading logs. My firewall is also disabled.
At this point I am completely stumped about what else I could try.
one of the application page finally loaded after a long time it is showing gc overhead limit reached, so apparently i have a memory leak somewhere
Please check that your DNS is working properly. Check host localhost, host servername.example.com and whatever the IP address that is returned for that with host <ipaddr> to make sure you are getting proper DNS resolution for all three items.

Tomcat 7 ignoring my server.xml file (vhost)

I am running into a wall with the tomcat manuals.
I want to run two domains on the same server by using tomcat.
I was successfully changing the port 8080 to 80 in the server.xml
Then I wanted to configure the vhosts as its written on the apache tomcat page.
After spending days in it, I gave up and just moved the server.xml to an other place and saw that tomcat is not even taking care about that. Not even a single error in the log files.
Tomcat is installed at /etc/tomcat7 on an ubuntu server.
Other softwares are ip2ban and java8 - so nothing specially going on there.

eclipse port occupying error on startup

I am getting this error while starting eclipse. I am using eclipse on windows 7
"There is a process already using the admin port 4848 -- it probably is another instance of a GlassFish server.
Command start-domain failed."
I have searched and found that if i put mny hostname against 127.0.0.1 then this problem can be resolve but my problem is that i can't place my hostname in my host file due to our organization internal network security and i can't even edit this file.So i want that this glassfish server stops allocating 4848 port and starts working on another port.
Please help as i got stuck in this issue.
Thanks
The Eclipse plugin contributes its own Glassfish instance that runs only as long as Eclipse runs. Uninstalling your standalone copy is probably a good solution for you. If not, reconfigure the standalone copy to use a different admin port.
A simple Google search will cover that for you. Here's what I have found as the top hit.

problem with tomcat 6

I just started the tomcat and opened my browser and gave http://localhost:8080. But i found 404 error.
I tried running the same in eclipse i got the following error message.
Several ports (8005, 8080, 8009)
required by Tomcat v6.0 Server at
localhost are already in use. The
server may already be running in
another process, or a system process
may be using the port. To start this
server you will need to stop the other
process or change the port number(s).
What could be the problem?
I just started the tomcat and opened my browser and gave http://localhost:8080. But i found 404 error.
Tomcat runs fine, but there was nothing to serve on the given URL. There's no ROOT webapp anywhere or there's no welcome file. You need to either deploy a webapp or let the URL point to a valid resource.
I tried running the same in eclipse i got the following error message.
Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
A port can be used only once by only one application at time. This indicates that you haven't shutdown the first instance of Tomcat before you run the one in Eclipse which is apparently been configured to listen on same ports.
If you are using windows, probably tomcat is running as a service.
Control Panel -> Administrative Tools -> Services -> Find Apache Tomcat 6
Right Click and choose properties
Startup Type : change it to manual, and hit the stop button.
click, ok and close all windows.
You can now run tomcat from eclipse IDE without changing the ports.
Just go and kill the javaw process.

Categories

Resources