Eclipse 4.2(Juno)在Tomcat 7中无法创建使用所选类型的服务器 [英] Eclipse 4.2 (Juno) 'Cannot create a server using the selected type' in Tomcat 7

查看:300
本文介绍了Eclipse 4.2(Juno)在Tomcat 7中无法创建使用所选类型的服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了:




  • eclipse juno

  • java-6-openjdk-i386选择为Eclipse中的默认JRE)

  • java-7-openjdk-i386



当我尝试在Eclipse中添加一个新的服务器Tomcat7我得到这个消息



'无法使用所选类型



,我无法继续。没有问题添加Tomcat6服务器。



我读了这个问题,但它没有工作类似问题

解决方案

1。要修复错误'无法使用所选类型创建服务器,请运行以下命令:

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

2。一旦你这样做,另一个错误



'无法在/ usr / share / tomcat7 / conf加载Tomcat服务器配置。配置可能已损坏或不完整/usr/share/tomcat7/conf/catalina.policy(没有这样的文件或目录)'



所以要解决这个问题运行以下命令:

  cd / usr / share / tomcat7 
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

3。重新启动服务器和Eclipse



4。添加新服务器




  • 选择服务器类别下的服务器;

  • 创建新服务器向导;

  • 选择 Apache / Tomcat v7.0服务器,然后按下一步;

  • 输入 / usr / share / tomcat7 进入 Tomcat安装目录,然后按Next;

  • 在左侧窗格的可用下选择您的项目,按添加>将其移动到配置下的右窗格;按完成;



Eclipse需要启动服务器,要做到这一点,首先,停止在后台运行的一个。


sudo服务tomcat7停止


如果您不必在启动时自动启动,我们可以使用以下命令


sudo update-rc .d tomcat7 disable


如果在服务器启动期间收到警告,如:



警告:目录[/ usr / share / tomcat7 / common / classes]的问题存在:[false] isDirectory:[false],canRead:[false]
警告:目录[/ usr / share / tomcat7 / common]的问题存在:[false],isDirectory:[false],canRead:[false]
警告:目录[/ usr / share / tomcat7 / server / classes]存在:[false],isDirectory:[false],canRead:[false]
警告:目录[/ usr / share / tomcat7 / server]存在问题:[false] isD目录:[false],canRead:[false]
警告:目录[/ usr / share / tomcat7 / shared / classes]存在问题:[false],isDirectory:[false],canRead:[false]
警告:目录[/ usr / share / tomcat7 / shared]的问题存在:[false],isDirectory:[false],canRead:[false]
pre>

您可能还需要运行以下操作:

  cd / usr / share / tomcat7 
sudo ln -s / var / lib / tomcat7 / common common
sudo ln -s / var / lib / tomcat7 / server server
sudo ln -s / var / lib / tomcat7 / shared shared


I have installed:

  • eclipse juno
  • java-6-openjdk-i386 (selected as default JRE in Eclipse)
  • java-7-openjdk-i386

When I try to add a new server Tomcat7 in Eclipse I get this message

'Cannot create a server using the selected type'

and I can not continue. No problem adding Tomcat6 server.

I read this question but it didn't worked Similar Question

解决方案

1 . To fix the error 'Cannot create a server using the selected type' run the following:

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

2 . Once you do this, another error

'Could not load the Tomcat server configuration at /usr/share/tomcat7/conf. The configuration may be corrupt or incomplete /usr/share/tomcat7/conf/catalina.policy (No such file or directory)'

So to fix this run the following commands:

cd /usr/share/tomcat7
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

3 . Restart server and Eclipse

4 . Add new server

  • Choose the Servers under the Server category;
  • Create new server wizard;
  • Choose Apache / Tomcat v7.0 Server and press Next;
  • Enter /usr/share/tomcat7 into the Tomcat installation directory and press Next;
  • Select your project on the left pane under "Available" and press Add> to move it to the right pane under Configured; press Finish;

Eclipse need to start the server, and to do that, first, it has to stop the one running in background.

sudo service tomcat7 stop

If you don't have to automatically start at boot, we can use the following command

sudo update-rc.d tomcat7 disable

If, during server start, you receive warnings like:

WARNING: Problem with directory [/usr/share/tomcat7/common/classes], exists: [false], isDirectory: [false], canRead: [false]
WARNING: Problem with directory [/usr/share/tomcat7/common], exists: [false], isDirectory: [false], canRead: [false]
WARNING: Problem with directory [/usr/share/tomcat7/server/classes], exists: [false], isDirectory: [false], canRead: [false]
WARNING: Problem with directory [/usr/share/tomcat7/server], exists: [false], isDirectory: [false], canRead: [false]
WARNING: Problem with directory [/usr/share/tomcat7/shared/classes], exists: [false], isDirectory: [false], canRead: [false]
WARNING: Problem with directory [/usr/share/tomcat7/shared], exists: [false], isDirectory: [false], canRead: [false] 

You may also need to run the following:

cd /usr/share/tomcat7
sudo ln -s /var/lib/tomcat7/common common
sudo ln -s /var/lib/tomcat7/server server
sudo ln -s /var/lib/tomcat7/shared shared

这篇关于Eclipse 4.2(Juno)在Tomcat 7中无法创建使用所选类型的服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆