java ee eclipse 配置 ssh框架

mvnDebug tomcat:run 这条命令主要用来远程测试,它会监听远程测试用的8000端口,在eclipse里打开远程测试后,它就会跑起来了,设断点,调试,一切都是这么简单。java

0、若是是maven项目,先利用mvn eclipse:eclipse 将maven项目转换为eclipse项目,而后导入eclipse;最好在eclipse里安装tomcat的plugin (也可不装,不影响使用)。web

一、若是一个工程不能有错误,找不到javax.servlet.*之类的,在工程的proterty里面选择 targeted runtime。tomcat

二、若是部署到本地tomcat时出现"Loading descriptor for project has encountered a problem" 等错误:服务器

  Install: JST Server UI, JST Web UI, JST Server Adapters, JST Server Adapters Extension, WST Server Adapters.app

  (You may also need Eclipse Java EE Developer tools, Eclipse Java Web Developer tools, Java Server Faces tools or JSF tools, Eclipse faceted Project Framework and Eclipse faceted Project Framework JDT Enablement)eclipse

三、添加Server服务器时,选择configure runtime enviroments 把服务器的 runtime enviroment所有删除。添加成功后,选择use tomcat installation。webapp

四、若在eclipse启动的tomcat没法进入localhost:8080页面,则可能须要这样修改:maven

 http://stackoverflow.com/questions/8520267/localhost8080-gives-404-the-requested-resource-is-not-availableide

Doubleclick the Tomcat server entry in the Servers tab, you'll get the server configuration. At the left column, under Server Locations, select Use Tomcat installation (note, when it is grayed out, read the section leading text! ;) ). This way Eclipse will take full control over Tomcat, this way you'll also be able to access the default Tomcat homepage with the Tomcat Manager when running from inside Eclipse. I only don't see how that's useful while developing using Eclipse.测试

eclipse中server location灰色,如何修改?

选择window ----show view---services能够看到服务的面板, 若要更改,先把tomcat下的全部項目移除。并右击,clean...以后方可设置。。。启动后将又变为黑色。

4.一、    server options 的选项的意义:  通常状况下勾选上 publish module contexts to separate XML files, 省得eclipse 修改了 tomcat 的 server.xml 文件。

接下来看看图中几个参数的含义:

 (1)serve modules without publishing:
让tomcat直接使用WebContent下的东西
省去publish到<workspace>\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
勾上它会将tmp0\wtpwebapps下相关的resources删除,
同时会修改Servers/Tomcat v6.0 Server at localhost-config/servers.xml中的serveModulesWithoutPublish=true
以及tmp0/conf/server.xml中的<Context>配置

(2)publish module contexts to separate XML files

勾选 上后会修改Servers/Tomcat v6.0 Server at localhost-config/servers.xml中的saveSeparateContextFiles=true

同时将tmp0/conf/server.xml中关于该app的<Context>元素

移动到tmp0/conf/Catalina/localhost/appName.xml中..

将用于开发的localhost当成实际应用的server的话(也就是使用开发的tomcat来发布应用),则必须将 conf/Catalina/localhost/appName.xml 删除,否则发布不会成功。

 

五、若是部署后出现http 404 什么的状况,能够先考虑看看是不是deployment assembly的问题,即部署参数设置不对的问题。

http://josh-persistence.iteye.com/blog/1926808

可能的缘由主要有2个:

1. 该项目不是web项目,因此不存在Deployment Assembly 属性。在Eclipse中,怎样将一个非web project变成一个web project?

 1)右键项目,选择Project Facets,点击Convert to faceted from

 

2) 配置Project Facets

 

更改Dynamic Web Module的Version为2.5。(3.0为Java7的)。

若是提示错误,可能须要在Java Compiler设置Compiler compliance level 为1.6。或者须要在此窗口的Java的Version改为1.6。


 

 

3) 配置 Modify Faceted Project

点击Further configuration available…,弹出Modify Faceted Project窗口

此处是设置web.xml文件的路径,咱们输入src/main/webapp。

Generate web.xml deployment descriptor自动生成web.xml文件,可选可不选。

 

2. 通过1的project转换后,应该可以看到Deployment Assembly出现了,但若是还么出现,颇有可能在Eclipse中Deployment Assembly被disable了,那么咱们须要作的就是将Deployment Assembly选项enable。

在项目所在的工做区间有一个.project文件,打开该文件增长以下这一行用于enable Deployment Assembly属性。

<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>

以下面的.project file.

Xml代码   收藏代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <projectDescription>  
  3.     <name>shortbread</name>  
  4.     <comment></comment>  
  5.     <projects>  
  6.     </projects>  
  7.     <buildSpec>  
  8.         <buildCommand>  
  9.             <name>org.eclipse.jdt.core.javabuilder</name>  
  10.             <arguments>  
  11.             </arguments>  
  12.         </buildCommand>  
  13.         <buildCommand>  
  14.             <name>org.eclipse.wst.common.project.facet.core.builder</name>  
  15.             <arguments>  
  16.             </arguments>  
  17.         </buildCommand>  
  18.         <buildCommand>  
  19.             <name>com.google.gdt.eclipse.core.webAppProjectValidator</name>  
  20.             <arguments>  
  21.             </arguments>  
  22.         </buildCommand>  
  23.         <buildCommand>  
  24.             <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>  
  25.             <arguments>  
  26.             </arguments>  
  27.         </buildCommand>  
  28.         <buildCommand>  
  29.             <name>org.eclipse.m2e.core.maven2Builder</name>  
  30.             <arguments>  
  31.             </arguments>  
  32.         </buildCommand>  
  33.     </buildSpec>  
  34.     <natures>  
  35.         <nature>org.eclipse.jdt.core.javanature</nature>  
  36.         <nature>org.eclipse.m2e.core.maven2Nature</nature>  
  37.         <nature>org.eclipse.wst.common.project.facet.core.nature</nature>  
  38.         <nature>com.google.gwt.eclipse.core.gwtNature</nature>  
  39.       <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>  
  40.     </natures>  
  41. </projectDescription>  

 而后重启Eclipse, 就可在Project的properties中看到Deployment Assembly选项了。

 

 

 

附:设置部署程序集(Web Deployment Assembly)

 

 

 

此处列表是,部署项目时,文件发布的路径。

1,咱们删除test的两项,由于test是测试使用,并不须要部署。

2,设置将Maven的jar包发布到lib下。

Add -> Java Build Path Entries -> Maven Dependencies -> Finish

设置完成效果图


相关文章
相关标签/搜索