views:

7646

answers:

17

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

A: 

What version of Eclipse? Europa? Ganymede?

What do you mean by workspace? An Eclipse workspace is not something you deploy, it holds your projects.

You will need to generate a WAR file (or the folder of files that would comprise the WAR file), a project would typically include an ANT or Maven build script to do this, or if the project used Eclipse's Dynamic Web Project type there might be a 'generate WAR' option somewhere. Without further details I can't help any more.

JeeBee
+1  A: 

Hum it can tricky. Bring the "server" view. If your project has already been deployed, remove it from the server to clean the binding between your project and the server.

Or you can right-click on your project in the project explorer and choose debug on the server. If you don't done it already, Eclipse should ask you to create a server runtime and here you can specify Tomcat 6 and specify the location of your server installation.

You can also see the "problems" view to see any problm in the project imported like the JDK etc...

Matthieu
A: 

Adding a new dynamic web project to the workspace seems to 'unlock' the feature.

Taveren
A: 

Hi, Taveren, I having exactly the same problem here, I've spent a whole afternoon investigating but found nothing useful. I have JDK6, Tomcat6 and Eclipse Ganymede on a Ubuntu64 8.04 machine. I tried the "adding new dynamic web project" with several different options but I didn see any difference. Are you sure it was the solution, or have you changed anything else?

+1  A: 

Look in the error view. If you tried to set one up once and failed, Eclipse seems to try and look there again later just before allowing you to create a new one. If you've deleted the folder or its not there any more, you need to replace it so that you can proceed.

A: 

I have got a same problem,centos5 + sun jdk6u10 + eclipse ganymede + tomcat 6(6.0.18) any other server is fine,but the tomcat 6 server cannot create a server using the selected type

A: 

I also have the same problem with Ubuntu 8.10 + sun-java6-jre + Eclipse Ganymede + Tomcat6. I can only manually define the Tomcat 5.0 server. Any help would be greatly appreciated!

+4  A: 

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

in my case i had to delete org.eclipse.jst.server.tomcat.core, but thanks anyway (running ganymede on vista 32bit)
Schildmeijer
+1  A: 

The only way I found to use the Tomcat 6 is changing the ownership of the Tomcat directory to my user. It seems that is not enough to have r/w permissions.

BTW, removing org.eclipse.wst.server.core.prefs erases you workspace configuration.

A: 

Changing the ownership to my user worked for me.

+1  A: 

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.

Jim Kiley
A: 

In my case, it was the corrupted Tomcat configuration files. Eclipse log was saying:

org.eclipse.core.runtime.CoreException: 
Could not load the Tomcat server configuration at 
C:\Program Files\Apache Software Foundation\apache-tomcat-6.0.14\conf. 
The configuration may be corrupt or incomplete.

Got a new Tomcat distribution, removed the old one and all good now.

Mantas K.
+1  A: 

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
A: 

Finally got this problem solved on my system.

1) got rid of the apt-gotten tomcats

2) installed a typical tomcat from bins at tomcat.apache.org

3) got rid of my openjdk

4) installed the sun jdk (apt-get)

5) removed my web projects in eclipse

6) noticed that when adding a web project you can set "Target Runtime" - I tried setting it to Tomcat 6 and it let me know there was a problem

Maybe none of the above mattered, but here's what might have mattered:

7) KICKER: Window -> Preferences -> Server - Runtime Environments. Removed any crappy runtime environments here, and added the path to my newly installed tomcat.

+3  A: 

@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

good answer - I needed it!
slashmais
+12  A: 

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.

Yes! This works!
Taveren
+1 It's a lifesaver!
luvieere
A: 

thank you a lot vortex7 it solved my problem.