Can't add server to a moved workspace

49,597

Solution 1

I had a similar problem, but my solution is a little simpler. The problem was causesd by renaming the original folder that was referenced by the server definition.

Go to Window/Preferences/Server/Runtime Environments, remove the broken reference. Then, click 'Add' to create a new reference, select the appropriate tomcat version, click next and you'll see the incorrect path reference. Fix it. Move on.

Solution 2

I had this same problem on Ubuntu 8.10 with Ganymede and Tomcat6. This appears to be some sort of bug with Eclipse. If you try and create a server, and it barfs, you can't create another tomcat6 server. To correct this problem, do the following:

  • close eclipse
  • go to the {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings directory and remove a file called org.eclipse.wst.server.core.prefs.
  • start eclipse
  • add your tomcat6 server in the server tab

kotfu

Solution 3

@id thanks for the solution but something is also hidden in org.eclipse.jst.server.tomcat.core.prefs

So in order to solve the problem

  • close eclipse
  • go to {workspace-directory}/.metadata/.plugins/org.eclipse.core.runtime/.settings
  • remove the files org.eclipse.wst.server.core.prefs and org.eclipse.jst.server.tomcat.core.prefs

Tomcat 5.5

I order to be able to use the tomcat5.5 server you need to have a writeable catalina.policy file as mentioned in

Tomcat 6

In order to be able to use the tomcat6 server the proper solution is to have a user instance of the tomcat6 server as described in

  • /usr/share/doc/tomcat6-common/RUNNING.txt.gz
  • RUNNING.txt (on the WEB)

My configuration is Debian/Sid, Eclipse 3.4.1. Ganymede

Solution 4

i finally got mine to work with the default Ubuntu 8.10 tomcat. (the debug command-line on eclipse is a wonderful thing) First i had to make a couple of symbolic links and then change the permissions to a file. (you might want to think twice about changing the permissions depending on your configuration, but if eclipse can't read the file it throws and exception and the gui won't let you continue)

sudo ln -s /etc/tomcat6 /usr/share/tomcat6/conf
sudo ln -s  /etc/tomcat6/policy.d/03catalina.policy /usr/share/tomcat6/conf/catalina.policy
sudo chmod a+r /usr/share/tomcat6/conf/tomcat-users.xml

Solution 5

The error view really is key. There is a lot of detail in there -- if necessary, right-click on the entries and copy their contents into your favorite text editor. One problem that can come up, for instance, is that if you have a server configuration already in place, and one of the configuration XML files is unparseable, the server can't be added. This happened to me this evening -- my <Context> element had a linebreak in it, so it was <C(linebreak)ontext>. This prevented Eclipse from recreating the server configuration.

Share:
49,597

Related videos on Youtube

Pankaj Sharma
Author by

Pankaj Sharma

Updated on December 22, 2020

Comments

  • Pankaj Sharma
    Pankaj Sharma over 3 years

    I have this workspace downloaded off the web and I try running it on a tomcat server from a fresh installation of Eclipse Ganymede. This particular project came with its own workspace.

    When I select Tomcat v6.0 I get a message

    Cannot create a server using the selected type

    Older tomcat versions are available, though.

    I guess I have to recreate some configuration setting. The question is which one? This seems to be some odd error as creating a new dynamic web project lets me configure tomcat for both of them

    • slashmais
      slashmais over 14 years
      this question truly saved me a lot of hazzle. (WoT - can't wait).
    • Marco Lackovic
      Marco Lackovic about 11 years
      Try assigning the group tomcat7 to your user's groups as explained here stackoverflow.com/a/15505124/334569
  • Schildmeijer
    Schildmeijer about 15 years
    in my case i had to delete org.eclipse.jst.server.tomcat.core, but thanks anyway (running ganymede on vista 32bit)
  • Stefan
    Stefan almost 13 years
    worked for me on 11.04 Natty Narwhal / Eclipse 3.6 Helios / default OpenJDK / Tomcat 6.0 24
  • Teemu Leisti
    Teemu Leisti over 12 years
    Thanks! That also worked for me, using Eclipse Galileo with Tomcat 6 and Java 6 on Ubuntu 10.10. I'd spent a couple of hours trying to figure this one out. In addition to doing the above, I had Tomcat configured as a service, and also had to stop it from the command line (sudo service tomcat6 stop) in order to prevent a port conflict error when starting up my project from Eclipse.
  • Xonatron
    Xonatron about 12 years
    This was exactly my problem too. I renamed my Tomcat 6.0.33 folder to something else, on purpose, to disable it, while trying to switch to Tomcat 6.0.35. And when I did that rename, I was unable to create a new Tomcat 6.0 server. The fix was to rename it back.
  • ResourceReaper
    ResourceReaper about 11 years
    +1 Absolutely the solution I was looking for. Thank you so much!