apache tomat7 not starting in browser? - java

Hi i'm using Apache Tomcat 7,with jdk 1.7 in windows 8. and i have installed tomcat successfully in windows 8,now i'm going hit URL in browser like"localhost:8080" it's work fine,after i open eclipse created web-application & i configured tomcat with that web-application,now i try to restart i'm getting error like!!
so for that,i have stopped tomcat in services(task-manger-service).now it will work fine(it get restarted in eclipse and works fine). when i hit URL in browser like"localhost:8080" i' getting error like ! and more i have added java_home,Catalina_home and also path.
can any one help me out it should work in both eclipse & browser?

First do
netstat -a -b -o
and see if ports that are configured in Eclipse Tomcat are free. If they are not free kill that process
taskkill /PID <pid>
Use /F flag if needed. You should get PID fro, netstat command. You should get Eclipse tomcat ports from Server tab of JavaEE perspective
Then start your tomcat.
PS : If you are getting 404 either you are entering incorrect URL or server is not up in the first place. In any case check the logs if you are getting 404.

Follow the below steps
Right click on your eclipse project
Select Refresh
Click the Run icon

It is not straight forward when you invoke Tomcat from within Eclipse. Please read the FAQ section at https://wiki.eclipse.org/WTP_Tomcat_FAQ
It explains how if you start Tomcat from within Eclipse, the binaries of original directories of Tomcat are used, but the web apps etc are stored separately in the Eclipse Workspace.

Related

Apache Tomcat will not start on Mac

I cannot get Apache Tomcat to start. I followed the instructions for installing Tomcat on the Mac found at https://www.dev2qa.com/how-to-install-tomcat-in-macos/.
After I type the command to start Tomcat, the response from the command line is that Tomcat has started.
However, when I go to the browser, the default page is not showing up. I further checked to see if the port was being used by using the command
lsof -nP -i4TCP:8080 | grep LISTEN
which showed that no program is using the port. I also read the 'RUNNING.txt' that instructed me on setting the environmental variables, which I did. Any suggestions on why Tomcat is not starting up.
I'm using jdk 1.8.0_202 and Apache Tomcat 9.0.14 that is running of Mac OS High Sierra.
BatChmod
After downloading a fresh version of Tomcat, I use the BatChmod app to alter the file permissions. Tomcat will not launch properly without altering the permissions.
I do not know the command-line equivalent, but here is a screenshot of the settings I have used for years successfully.
Plea for help
If anyone can write the equivalent as a shell script for macOS, please post!
Even better, explain how to wrap such a script as an AppleScript for drag-and-drop execution in Finder.
The problem turned out to be a permissions problem. When I installed Tomcat, I put the folder in the '/Library/Tomcat' directory. Even though the Tomcat files were changed to be executable, the user and group ownership remained the same. To get Tomcat to run, I moved the directory to 'Users/MyUserName/Tomcat'. Once I did that, the default Tomcat page ran.

Could not load the Tomcat server configuration

I have installed apache tomcat7 using sudo apt get in ubuntu. I have added apache tomcat 7 to eclipse using Windows > Preferences > Server > Runtime Environment.But when I'm starting the server from server view by right clicking the shown Tomcat v7.0 Server at localhost [Stopped,Republish]
It says:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0
Server at localhost-config. The configuration may be corrupt or
incomplete.
The path to tomcat7 that I've provided is /usr/share/tomcat7
I've just been encountering a very similar issue in Ubuntu while trying to get Eclipse Mars and Tomcat7 integrated because Eclipse was expecting the tomcat configuration files etc to be all in the same location, and with the necessary permissions to be able to change those files.
The following instructions from this blog article helped me in the end:
cd /usr/share/tomcat7
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /var/log/tomcat7 log
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo chmod -R a+rwx /usr/share/tomcat7/conf
I've just solved this exact problem on my Ubuntu 14.04 with Eclipse Mars 2.
This could happen when Eclipse is not finding Tomcat's configuration files where they are expected to be. This place is in
$eclipse_workspace_folder/$version_of_your_tomcat_server_at_localhost/
(by default if you didn't changed server's name). So you have to copy all the files under your $tomcat_installation_folder/conf/* to the workspace server's folder.
But it was easier to just remove the server from your server list and add it again. Eclipse will automatically recreate all these files again into the proper folders. Like in the picture below:
In my case I've downloaded tomcat-8.0.35 from the website, so the configuration files needed are in /opt/apache-tomcat-8.0.35/conf/ filesystem.
Just delete the desired server from the Servers view (Window -> Show View -> Servers) and then go to Window -> Preferences -> Server -> Runtime Environment -> Add and add the server again.
You can install tomcat7 in ~/tomcat7 instead of /usr/share/tomcat7.
Close Eclipse.
Delete org.eclipse.wst.server.core.prefs and org.eclipse.jst.server.tomcat.core.prefs in {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings.
Launch Eclipse.
Go to Window->Show View->Other... and choose the Servers.
Select Tomcat v7.0 Server from the server type and press Next.
Enter /home/user/tomcat7 (not /usr/share/tomcat7) into the "Tomcat installation directory" and press Download.
Wait a few minutes and press Finish.
tomcat7 worked correctly with Eclipse 4.4 on my Ubuntu 15.04 in this way.
I know it's an old question and it has been solved already but for me the Tomcat conf/tomcat-users.xml file was created with a different encoding from the rest of the configuration files. The first line of that file looked like this:
<?xml version='1.0' encoding='cp65001'?>
All I had to do to solve the issue was change that line for:
<?xml version="1.0" encoding="UTF-8"?>
And voila.
I have no idea what 'cp65001' means or why it was created like that.
Maybe this will help other users facing the same issue.
The application is trying to load /usr/share/tomcat7/conf/ which doesn't exist. Eclipse assumes conf is in the same directory as bin
In Ubuntu, conf is placed in /etc/tomcat7/ and there is a symbolic link in /var/lib/tomcat7/.
To solve this, you can either
Download package from Apache Tomcat, and place them in a specific directory, say /opt/ or
Create a symbolic link in /usr/share/tomcat7/ pointing to /etc/tomcat7/conf
A quick solution in eclipse to resolve when Tomcat could not load as per the following error:
Just refresh the Tomcat folder should do the trick. If it still does not work, delete all files in eclipse under the Tomcat folder, re-copy the server files then refresh the Tomcat folder. Tomcat should restart correctly after that.
I have Windows 8.1, Eclipse Neon, Tomcat 8.
The solution is to copy all the files from folder ".../Tomcatxxx/conf" to the ".../Workspace_directory/Servers" and try to launch server again.
You tried to start Tomcat and got the following error:
Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete
How to solve:
Close Eclipse
Copy all files from TOMCAT_7_HOME/conf to WORKSPACE_FOLDER/Servers/Tomcat v7.0 Server at localhost-config
Start Eclipse
Expand the Servers project, click on the Tomcat 7 project and hit F5
Start Tomcat from Eclipse
I know it's been a while since this question was posted, but I was just getting this exact error, and I have a really simple solution that MIGHT work for some. All I did was double click on the folder 'Servers', which then allowed me to start the server with no error message. Sometimes the solution is right in front of your eyes. This might work for some people like me who go straight to google without trying fix the issue themselves!
on Centos 7, this will do it, for Tomcat 7 :
(my tomcat install dir: opt/apache-tomcat-7.0.79)
mkdir /var/lib/tomcat7
cd /var/lib/tomcat7
sudo ln -s /opt/apache-tomcat-7.0.79/conf conf
mkdir /var/log/tomcat7
cd /var/log/tomcat7
sudo ln -s /opt/apache-tomcat-7.0.79/logs log
not sure the log link is necessary, the configuration is the critical one.
:
Had the same issue with Kepler (after trying to add a Tomcat 7 server).
Whilst adding the server I opted to install the Tomcat binary using the download/install feature inside Eclipse. I added the server without adding any apps. After the install I tried adding an app and got the error.
I immediately deleted the Tomcat 7 server from Eclipse then repeated the same steps to add Tomcat 7 back in (obviously skipping the download/install step as the binary was downloaded first time around).
After adding Tomcat 7 a second time I tried adding / publishing an app and it worked fine. Didn't bother with any further RCA, it started working and that was good enough for me.
I had the same problem in Eclipse Oxygen with Tomcat 8 in ubuntu 16.04 LTS.
Solution:
1. Give permission to entire tomcat folder (chmod 777 -R /Tomcat)
2. Delete and re-add the server in eclipse
3. Restart eclipse
4. Start the tomcat server. It will work..........
In the Servers tab of eclipse, go to the properties of the server and Switch location to latest downloaded tomcat version.
This resolved the issue for me.
Tomcat Server Properties
I solved this problem. DON'T USE THE .exe
Unistall Tomcat and download the .zip from Tomcat's web site. Then unpack and put it in C:\Program Files. Open Eclipse and set the server. it will work.

How do you know if Tomcat Server is installed on your PC

I am using Windows 7 OS.
I just installed jaspersoft server which installed Apache Tomcat and mysql as a bundle along with it.
I go to http://localhost:8080 and theres a message that says webpage is not available.
I am a beginner, and I would like to know if Tomcat is first installed on my computer. Can you tell
me how I can do that ? ( I would also like to know if it has to be started and on what
port it was installed.)
UPDATE
Heres something I did . i am really confused now . I found the location of the tomcat server. I found the server.xml file. The port in the server.xml file was listed as 8005. I also found start.bat which I ran. I now see that http://localhost:8080 works but http://localhost:8005 doesnt . Would you know why ?? The port 8005 should work because thats what was listed in the server.xml
The port 8005 is used as service port. You can send a shutdown command (a configurable password) to that port. It will not "speak" HTTP, so you cannot use your browser to connect.
The default port for delivering web-content is 8080.
But there may be other applications listen to that port. So your tomcat may not start, if the port is not available.
You asked "How do you know, if tomcat server is installed on your PC?". The answer to that question is: You can't
You can't determine, if it is installed, because it may be only extracted from a ZIP archive or packaged within another application (Like JBoss AS (I think)).
You can check in windows services if tomcat is installed it will be listed in windows services.
To check the windows service list of services installed on windows machine use
WINDOWS KEY + R and type services.msc
There you can find all the services related with Jasperreport server like Tomcat and MySQL with name starting Jasperreport server Tomcat and MySQL only if these services are installed and its need to be started by selecting the option.Then you can access it through browser using this link :-
http://localhost:8080
default port for tomcat is 8080.
In order to make
http://localhost:8080
work, tomcat has to be started first. You can check server.xml file in conf folder for the port information. You can search if tomcat is installed on your machine. Just go to start and then type tomcat. If it is installed it will give you the directory where it is installed. Then you can select that path and run it from command prompt. Example if tomcat is installed in C:\Programfile\tomcat. You need to set this path in command prompt,go to bin folder and startup. Example: C:\Programfile\tomcat\bin\startup. Else you can also run it by directly going to the path and run startup batch file.
In case of Windows(in my case XP):-
Check the directory where tomcat is installed.
Open the directory called \conf in it.
Then search file server.xml
Open that file and check what is the connector port for HTTP,whre you will found something like 8009,8080 etc.
Suppose it found 8009,use that port as "/localhost:8009/" in your web-browser with HTTP protocol.
Hope this will work !
For linux ubuntu 18.04:
Go to terminal and command:$ sudo systemctl status tomcat
Open your windows search bar, and search for the keyword Tomcat. If a shortcut file is found instead, you can open the source file location of the shortcut by right-clicking the shortcut file and selecting the Properties.

Websphere admin console not working

I have trouble opening the admin console for the websphere server. The server is up and running though, the application deployed and all. The only problem is with the console which gives a 404 error. Does anyone know how to fix this? Maybe reinstall/restore the console somehow?
Thanks.
You can try to reinstall the admin console :
Goto C:\[PATH TO PROFILE]\bin
Then run the Jython commands, first to cleanup, then to reinstall :
wsadmin -lang jython -f deployConsole.py remove
Wait till the admin-console is uninstalled.
Now reinstall of administrative console (isclite) will complete without errors (hopefully)
wsadmin -lang jython -f deployConsole.py install
Admin console should work now.
I had a similar problem. I was able to solve it by:
Deleting the existing profile
Creating a new profile
Running the WAS in RAD with that newly created profile
Profile management :-
Method :- RAD -> windows > prefereneces > server > websphere application server > selecting the websphere server 7.0 > click the run profile management tool button in the bottom section.
Check and make sure the DMGR is up and running on the primary node. Start --> Run --> Services.msc. Look for something that looks like "IBM WebSphere Application Server V6.1 - CellManager01" and ensure it is running. If not, browse to the installation location of Websphere "AppServer\profiles\Dmgr01\logs\dmgr" and look in the Systemout.log and the SystemErr.log for details. Also look in the "AppServer\profiles\Dmgr01\logs\ffdc" directory.
You can try this before trying to delete the new profile. I had this same problem where console was not coming up. I closed the RAD and re-opened it but didnt work. Go to Window --> Reset Perspective and then go to show view and get the console.
If still you cant see the console, go to customize perspective and click general and enable console.
If this doesnt work then only delete and recreate profile.

Trouble in starting my jetty server on a remote server

I have started a jetty server in my remote server. But I got problem accessing the default page. I followed the getting started steps and used the command java -jar start.jar to start the server. The port is set to 8080. When I use my Ip http://20.14.228.123:8080/ The site is never found. Do you guys have any clue of what I have done wrong? According to my terminal window it is running.
UPDATE:
sorry I ran wget localhost:8080 and connection failed it says. But I can go in to the default page though. I'm newbie in Java apps deployment, but I exported a war file on my computer and placed it under webapps in the jetty folder is that right procedure? because it don't runs. According to my web.xml in my webapp a servlet is mapped through /Push/GetContacts and when I enter the destination(http://localhost:8080/Push/GetContacts) in my web browser it don't show up?
FINAL:
Never mind I fixed it!
Can you try to run wget localhost:8080 from you server terminal? Just to check that port\ip not blocked somewhere on network layer? It must download html showed by jetty if it actually run...
Q: how do I get the jetty server to not shut down all the time after I close down the terminal?
A: start Jetty as service(process)

Categories