Tomcat7下部署项目

来源:互联网 发布:网络远程教育多少钱 编辑:程序博客网 时间:2024/05/20 18:49

参考文章:http://blog.csdn.net/dcx903170332/article/details/49127723



一、Server Options设置

Server Options的第一个选项Serve modules without publishing

在默认情况下,当项目部署到tomcat中,该插件会把项目文件拷贝到上一个配置项Server Locations中的显示Server path的wtpwebapps目录下,即当前wrokspace所在目录下的。metadata子目录中,如我的wrokspace是D:\workspace,那么该目录是:D:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps。但如果选中上面的这个选项,则不会把项目文件发布到该目录下运行,而是:web资源目录是:web项目的WebContent,即maven web项目的src/main/webapp目录 ,class文件目录是:是当前配置的class文件的输出目录,即maven项目的target/classes目录

选择Publish module contexts to separate XML files。如果不选一般会报错。did not find a matching property。这一步的主要目的在于 :使本来     配置在conf/server.xml里的<context>元素,separate到/conf/Catalina/localhost/的目录下专门生成一个{context_name}.xml。 

modules auto reload by default意思是自动自加载

enable security 启用安全保护我们的应用

二、Publishing设置


 never publish automatically   从来不进行自动发布操作

Automatically publish when resources change  当资源发生改变时候自动发布

Automatically publish after a build event 在一个build事件后(具体时间在Publishing interval(in seconds)中设置)自动发布

如果项目比较大,可能启动时间较长,但是tomcat设置了超时时间,这个时候我们就需要把超时时间改长一些。在Timeouts更改。

 

设置4:在ports可以更改端口号。

 

       1.3错误:The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:

 

实际这是建议使用apache的apr。如果想使用apr的话, 实际操作很简单,下载 http://tomcat.heanet.ie/native/1.1.1/binaries/win32/tcnative-1.dll。将这个文件复制到C:\WINDOWS\system32\下面然后重新启动tomcat。

三、Modules下的Auto reloading enable

在eclipse中集成Tomcat来开发时,如果run as则勾选,debug as模式下,应该去掉勾选,否则,当修改了Java文件,项目会报错。

0 0
原创粉丝点击