tonga
tonga

Reputation: 11961

Eclipse add Tomcat 7 blank server name

I was trying to add Tomcat 7 in my Eclipse in Ubuntu. When I click "Add new server" in Eclipse and select "Tomcat v7.0 Server", the field "Server Name" is blank and I cannot type in anything in that textbox as shown below:

Eclipse Add Tomcat Server

What I did before is I deleted a Tomcat 7 server from Eclipse and I was trying to reinstall Tomcat 7. But it doesn't allow me to type anything in that textbox and I cannot proceed to the "Next" button. My environment is Ubuntu Linux and Eclipse for JavaEE.

Upvotes: 264

Views: 109164

Answers (12)

Ahmad Ismail
Ahmad Ismail

Reputation: 13842

The easiest solution is to create a new workspace in eclipse/STS.

File -> Switch Workspace -> Others...

Upvotes: 1

kalabalik
kalabalik

Reputation: 3832

In Eclipse Neon.3 Release (4.6.3) on Ubuntu 17.04 with Tomcat 8.0 the problem persists. What helped me was the combination of deleting the prefs files:

rm ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.jst.server.tomcat.core.prefs    
rm ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.server.core.prefs

and linking to catalina.policy (somewhat differently than how @michael-brooks suggested for his configuration):

sudo ln -s /var/lib/tomcat8/policy/catalina.policy conf/catalina.policy

Upvotes: 0

Steve Chambers
Steve Chambers

Reputation: 39394

I had a similar issue except the "Server Name" field was disabled.

Found this was due to the Apache Tomcat v7.0 runtime environment pointing to the wrong folder. This was fixed by going to Window - Preferences - Server - Runtime Environments, clicking on the runtime environment entry and clicking "Edit..." and then modifying the Tomcat installation directory.

Upvotes: 17

kanaparthikiran
kanaparthikiran

Reputation: 523

Deleting/Moving files org.eclipse.jst.server.tomcat.core.prefs and org.eclipse.wst.server.core.prefs worked for me.

Upvotes: 0

silverzhao
silverzhao

Reputation: 61

I also had this problem today, and deleting files org.eclipse.jst.server.tomcat.core.prefs and org.eclipse.wst.server.core.prefs didn't work.

Finally I found it's permission issue:

By default <apache-tomcat-version>/conf/* can be read only by owner, after I made it readable for all, it works! So run this command:

chmod a+r <apache-tomcat-version>/conf/*

Here is the link where I found the root cause:

http://www.thecodingforums.com/threads/eclipse-cannot-create-tomcat-server.953960/#post-5058434

Upvotes: 2

Vinay
Vinay

Reputation: 197

I had same issue before: the server name was not appearing in server while configuring with eclipse

I tried all the solutions which are provided over here, but they didn't work for me.

I resolved it, by simply following these simple tips

Step1: Windows --> Preferences --> Server --> Run time Environments --> Add --> select the tomcat version which was unavailable before --> next --> browse the location of your server with same version

Step2: go to servers and select your server version --> next --> Finish

Issue resolved!!! :)

Upvotes: 8

Andrew
Andrew

Reputation: 1279

In my case, the tomcat directory was owned by root, and I was not running eclipse as root.

So I had to

sudo chown -R  $USER apache-tomcat-VERSION/

Upvotes: 1

School Boy
School Boy

Reputation: 1183

After trying @Philipp Claßen steps, even if did not work then,

Change eclipse, workspace and tomcat directory. [tested only for Windows7]

I know somebody might say that is not correct, but that did work for me after @Phillipp's steps not worked for me.

It took me 4 hours to find this brute force method solution.

Upvotes: 2

dsharew
dsharew

Reputation: 10665

so weird but this worked for me.

  1. close eclipse

  2. start eclipse as eclipse --clean

Upvotes: 3

Tushar
Tushar

Reputation: 1470

I faced the same issue, and I changed the workspace to new location, and it worked. I hope this helps :)

Upvotes: 7

Michael Brooks
Michael Brooks

Reputation: 489

I am running kepler in ubuntu and had the same problem getting eclipse to recognize the tomcat7 server. My path to install directory was fine and deleting/renaming the files only did not fix it either.

This is what worked for me:

run the following in terminal:

cd ~/workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/    
rm org.eclipse.jst.server.tomcat.core.prefs    
rm org.eclipse.wst.server.core.prefs
cd /usr/share/tomcat7
sudo service tomcat7 stop
sudo update-rc.d tomcat7 disable
sudo ln -s /var/lib/tomcat7/conf conf
sudo ln -s /etc/tomcat7/policy.d/03catalina.policy conf/catalina.policy
sudo ln -s /var/log/tomcat7 log
sudo chmod -R 777 /usr/share/tomcat7/conf
sudo ln -s /var/lib/tomcat7/common common
sudo ln -s /var/lib/tomcat7/server server
sudo ln -s /var/lib/tomcat7/shared shared

restart eclipse, delete tomcat7 server. Re-add server and everything then worked.

Here is the link I used. http://linux.mjnet.eu/post/1319/tomcat-7-ubuntu-13-04-and-eclipse-kepler-problem-to-run/

Upvotes: 23

Philipp Cla&#223;en
Philipp Cla&#223;en

Reputation: 43970

It is a bug in Eclipse. I had exactly the same problem, also on Ubuntu with Eclipse Java EE Juno.

Here is the workaround that worked for me:

  1. Close Eclipse
  2. In {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings delete the following two files:
    • org.eclipse.wst.server.core.prefs
    • org.eclipse.jst.server.tomcat.core.prefs
  3. Restart Eclipse

Source: eclipse.org Forum

Upvotes: 536

Related Questions