Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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

@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

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.

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

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...

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.

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.

I had had same problem until I went to tomcat6 configuration directory and added ownership to my user in addition to root:

cd /usr/share/tomcat6/conf

chown root:myusername ./*

chmod 777 ./*

You can choose some better chmod for security, 777 is just a quick brutal fix. I have Eclipse 3.5 (Galileo) + Fedora 12 + Tomcat 6 extracted from tar(which is why Eclipse could not access it). Eclipse had been complaining "Cannot create a server using the selected type".

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.

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

Changing the ownership to my user worked for me.

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.

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.

This Question is maybe old. But I just ran into this problem. My project was not recognized as a web project (no globe icon in Eclipse ).

Suppose you use maven plugin , it failed to convert to web project with command

mvn eclipse:eclipse -Dwtpversion=1.5

In package Explorer, right-click on the project / configure / Convert to Java Facets project/ Dynamic Web project in Eclipse Et Voilà

Check the .project file at the root before and after the convert. You will see new natures.

<natures>
    <nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
    <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
    <nature>org.eclipse.jdt.core.javanature</nature>
    <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
    <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>

Instead of deleting config settings files, just go to Preferences -> Server -> Runtime Environments and remove the "forgotten" environment....

Thanks a lot this answer working for me..

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top