Eclipse 3.7 (Indigo) + Tomcat7 ---无法使用所选类型创建服务器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8025841/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 20:40:01  来源:igfitidea点击:

Eclipse 3.7 (Indigo) + Tomcat7 --- Cannot create a server using the selected type

eclipsetomcat7eclipse-indigo

提问by user1031946

Setup:

设置:

  • Eclipse 3.7 + the WEB tools from the indigo update site
  • Tomcat7
  • Ubuntu
  • Eclipse 3.7 + 来自 indigo 更新站点的 WEB 工具
  • 雄猫7
  • Ubuntu

Problem:

问题:

When I try to add a new Tomcat 7 server in the server perspective in Eclipse I get the following error:

当我尝试在 Eclipse 的服务器透视图中添加新的 Tomcat 7 服务器时,出现以下错误:

"Cannot create a server using the selected type" 

How do I solve this?

我该如何解决这个问题?

回答by aleroot

This is a known issue.To resolve this error, try one or all of the following:

这是一个已知问题。要解决此错误,请尝试以下一种或所有方法:

  1. Go to Window–>Preferences–>Server–>Runtime Environmentsand fix the broken path/link for the server.
  2. Rename the org.eclipse.jst.server.tomcat.core.prefsto org.eclipse.jst.server.tomcat.core.prefs.bak(or you can delete this file). This file can be found at \workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings
  3. Rename the org.eclipse.wst.server.core.prefsto org.eclipse.wst.server.core.prefs.bak(or delete the file). This file also can be found at the same location as above.
  1. 转到Window–>Preferences–>Server–>Runtime Environments并修复服务器的损坏路径/链接。
  2. 重命名org.eclipse.jst.server.tomcat.core.prefsorg.eclipse.jst.server.tomcat.core.prefs.bak(或者您可以删除此文件)。这个文件可以在\workspace\.metadata\.plugins\org.eclipse.core.runtime\.settings
  3. 重命名org.eclipse.wst.server.core.prefsorg.eclipse.wst.server.core.prefs.bak(或删除文件)。该文件也可以在与上述相同的位置找到。

回答by Ali

A different resolution of the same problem that worked for me. I share it here it might be helpful for someone.

对我有用的同一问题的不同解决方案。我在这里分享它可能对某人有帮助。

I have - Eclipse Juno - Tomcat 7 - Windows 7

我有 - Eclipse Juno - Tomcat 7 - Windows 7

This is what I did

这就是我所做的

Eclipse > Window > Preferences > Installed JREs and I've got jre7 added and selected here. So I added jre6 by pressing Add button(If not installed or you ran a java update, just download and install jre6). And select jre6 instead of jre7.

Eclipse > Window > Preferences > Installed JREs,我在这里添加并选择了 jre7。所以我按添加按钮添加了 jre6(如果未安装或您运行了 java 更新,只需下载并安装 jre6)。并选择 jre6 而不是 jre7。

Now go to Eclipse > Window > Preferences > Server > Runtime Environment > Press Add and add Tomcat 7.

现在转到 Eclipse > Window > Preferences > Server > Runtime Environment > 按 Add 并添加 Tomcat 7。

You're done now.

你现在完成了。

回答by bitmill

After trying aleroot's solution without success, VonC's comment on the question was what fixed it for me. So follow the solution suggested hereif you hit a wall. Remember to remove the old Tomcat configuration from Runtime Environments afterwards.

在尝试了 aleroot 的解决方案但没有成功之后,VonC 对这个问题的评论是为我解决的问题。因此如果您碰壁,请遵循此处建议的解决方案。请记住之后从运行时环境中删除旧的 Tomcat 配置。

回答by Lucky

I had two tomcat 7 runtime configurations added to my Server's Runtime configurations tab. Deleted the duplicate one and fixed the path to the only tomcat 7 which was installed in my system under C:\Program Files\Apache Software Foundation\Tomcat 7.0and this solved my problem of adding a new server in the servers tab.

我在服务器的运行时配置选项卡中添加了两个 tomcat 7 运行时配置。删除了重复的一个并修复了安装在我系统中的唯一 tomcat 7 的路径C:\Program Files\Apache Software Foundation\Tomcat 7.0,这解决了我在服务器选项卡中添加新服务器的问题。

  1. Go to Window> Preferences> Server> Runtime Environmentsand update the server runtime environment path to change the broken path for the server by clicking Edit.
  1. 转至Window> Preferences> Server>Runtime Environments并更新服务器运行时环境路径以通过单击 更改服务器的损坏路径Edit

回答by School Boy

After trying all the working steps mentioned in the others answers, and even if did not work then,

在尝试了其他答案中提到的所有工作步骤之后,即使没有奏效,

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

更改 eclipse、workspace 和 tomcat 目录。[仅针对 Windows7 测试]

I know somebody might say that is not correct, but above step did work for me.

我知道有人可能会说这不正确,但上述步骤确实对我有用。

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

我花了4个小时才找到这个蛮力方法的解决方案。

回答by Cristi B.

Another way is to remove the Servers directory if was already created. That worked for me.

另一种方法是删除已经创建的 Servers 目录。那对我有用。

回答by CodeFinity

I removed the files mentioned above...still no luck. On a whim, I decided to download and install NetBeans. I was up and running with Postgres DB and Apache server running, etc. in just a few minutes! No extra downloads, etc.

我删除了上面提到的文件......仍然没有运气。一时兴起,我决定下载并安装 NetBeans。我在几分钟内就启动并运行了 Postgres DB 和 Apache 服务器,等等!没有额外的下载等。

Anyway, switching to Netbeans is what worked for me. Goodbye Eclipse.

无论如何,切换到 Netbeans 对我有用。再见日蚀。

回答by BishopZ

Neither of the above solutions worked for me. Neither of the files listed exist in that location or anywhere else on my machine. I tried backing up all the files in the .settings folder and restarting Eclipse, but still got the same error.

上述解决方案都不适合我。列出的文件都不存在于该位置或我机器上的任何其他位置。我尝试备份 .settings 文件夹中的所有文件并重新启动 Eclipse,但仍然出现相同的错误。

The only thing that worked was to reinstall Tomcat.

唯一有效的是重新安装Tomcat。

回答by Arune Prasaath.Je

The error occurs due to the server running in some other Java(TM) Platform.

该错误是由于服务器在其他一些 Java(TM) 平台上运行而发生的。

  1. Start Task manager->Processes->Select Java(TM)
  2. Click "End Processes".
  1. 启动任务管理器->进程->选择Java(TM)
  2. 单击“结束进程”。

After finishing this procedure you can add the server without any error.

完成此过程后,您可以添加服务器而不会出现任何错误。

回答by Marco Lackovic

If you have installed Tomcat 7 with apt-get in a Debian/Ubuntu system, the cleanest solution to this problem is to assign the user under which Eclipse is running to the tomcat7 group.

如果您在 Debian/Ubuntu 系统中使用 apt-get 安装了 Tomcat 7,则解决此问题的最干净的方法是将运行 Eclipse 的用户分配到tomcat7 组

If for example that user's username is pippothen you just need to run:

例如,如果该用户的用户名是,pippo那么您只需要运行:

sudo adduser pippo tomcat7

Note: you need to log out and log back in for the changes to take effect.

注意:您需要注销并重新登录才能使更改生效。