开发web项目时,你还困扰在,反复启动web容器的痛苦中么?也许会有人说,用调试模式。但是如果涉及到配置文件或者service类,还是不得不重启web容器吧,而且偶尔会出现抽风情况,没生效的情况(这时候会让你觉得到底是没生效?还是代码有问题?是不是很纠结)。

下面介绍下resin在开发web项目时的方便之处

  除非修改web.xml文件,其他的java文件修改,resin会自动刷新--类似于热部署 不再需要重启web容器就能得到最新代码环境---可谓为开发节约了大部分时间

  平时的开发中建议resin和tomcat并用。做eclipse详细调试的时候用tomcat(当然也可以用resin做这个功能),做web调试的时候用resin比较方便,下面详细说说eclipse中resin配置吧

对于Resin的调试模式网上介绍的相当的少,几乎没有什么帖子或者文章介绍Eclipse和Resin的整合,大多都是简单的写了Eclipse无插件方式启动Resin,关于调试模式的启动都是简单的几个命令就结束了,并没有像Tomcat那样顺手! 
  花了很长时间寻找一个整合方法,最终还是发现了:

当然了,能看到界面就说明 --> 这个肯定是用了插件的 后面介绍 Resin官方主推的插件 
  之前你需要一个对应的 Resin版本,下载地址:http://www.caucho.com/download/

插件安装:http://caucho.com/eclipse

能看到这段文字就说明这个网址没有问题,可以作为 Eclipse插件源进行更新 
打开Eclipse选择 Help -> Software Updates... 点击右边的 Add site... 
在弹出来的对话框中输入 http://caucho.com/eclipse (注意删了空格)

不知什么原因我更新后显示的名字就变样了,这个自己摸索下也能弄懂的 
添加站点后点开左边的树选择 Resin 然后右上角的 Install就会变亮(我的安装了所以暗着)

OK 后面就是联网下载更新插件了... (看到这里,如果你说你没有互联网,那我就什么都不说了,赶紧找榔头把电脑砸了吧...)

window - show view - servers 显示出来服务器框 
然后在 servers框中点右键 new 一个服务器这时候就会出现最上面第一张图片的Resin,选择你自己需要的版本... 这里只管 3和4 用2的... 2就2吧 没办法 2的人已经被埋没了... 哈哈!

Resin 3.1 以及 temporary directory deploy 都是先将项目打包war然后复制到项目的发布文件夹中(位于你项目的workspace下面的.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps 文件夹中)缺点,更换项目进行开发的时候原有的war文件不会被删除... 需要手动删除

另外一个(in space)就是不打包直接复制到发布目录中并将项目发布 (推荐)

安装的第二部需要选择jdk环境,这个自己选择了,或者选系统的 或者自己指定 
第三步需要指定你解压缩后的 Resin 文件夹(上面说的下载的文件,建议解压到D盘下比如 D:\Resin)

我原来有一个Tomcat的服务器,后面又尝试了2个不同的 Resin

这里就显示了3个启动服务器,当然需要使用哪个版本运行就先选择 然后点右边的绿色运行按钮!

=============================华丽分割线============================================

1、注意eclipse需要3.6以上版本才能支持。

2、对于resin 4.x配置后 启动会报错

'default' is an unknown server in the configuration file.

3、配置resin.xml文件

<!--
- Resin 4.0 configuration file.
-->
<resin xmlns="http://caucho.com/ns/resin"
xmlns:resin="urn:java:com.caucho.resin"> <!-- property-based Resin configuration -->
<resin:properties path="${__DIR__}/resin.properties" optional="true"/>
<resin:properties path="cloud:/resin.properties"
optional="true" recover="true"/> <resin:if test="${properties_import_url}">
<resin:properties path="${properties_import_url}"
optional="true" recover="true"/>
</resin:if> <!-- Logging configuration for the JDK logging API -->
<log-handler name="" level="all" path="stdout:"
timestamp="[%y-%m-%d %H:%M:%S.%s]"
format=" {${thread}} ${log.message}"/> <!--
- Alternative pseudo-TTCC log format
-
- <log-handler name="" level="all" path="stdout:"
- timestamp="%y-%m-%d %H:%M:%S.%s"
- format=" [${thread}] ${log.level} ${log.shortName} - ${log.message}"/>
--> <!--
- level='info' for production
- 'fine' or 'finer' for development and troubleshooting
-->
<logger name="" level="${log_level?:'info'}"/> <logger name="com.caucho.java" level="config"/>
<logger name="com.caucho.loader" level="config"/> <!--
- Default configuration applied to all clusters, including
- HTTP, HTTPS, and /resin-admin configuration.
-->
<resin:import path="${__DIR__}/cluster-default.xml"/> <!--
- health configuration
-->
<resin:import path="${__DIR__}/health.xml"/> <!--
- Remote management requires at least one enabled admin user.
-->
<resin:AdminAuthenticator>
<user name="${admin_user}" password="${admin_password}"/> <resin:import path="${__DIR__}/admin-users.xml" optional="true"/>
<resin:import path="cloud:/admin-users.xml" optional="true" recover="true"/>
</resin:AdminAuthenticator> <!--
- For clustered systems, create a password in as cluster_system_key
-->
<cluster-system-key>${cluster_system_key}</cluster-system-key> <!--
- For production sites, change dependency-check-interval to something
- like 600s, so it only checks for updates every 10 minutes.
-->
<dependency-check-interval>${dependency_check_interval?:'2s'}</dependency-check-interval> <!-- For resin.properties dynamic cluster joining -->
<home-cluster>${home_cluster}</home-cluster>
<home-server>${home_server}</home-server>
<elastic-server>${elastic_server}</elastic-server>
<elastic-dns>${elastic_dns}</elastic-dns> <!--
- Configures the main application cluster. Load-balancing configurations
- will also have a web cluster.
-->
<cluster id="app">
<!-- define the servers in the cluster -->
<server-multi id-prefix="app-" address-list="${app_servers}" port="6800"/> <host-default>
<!-- creates the webapps directory for .war expansion -->
<web-app-deploy path="webapps"
expand-preserve-fileset="WEB-INF/work/**"
multiversion-routing="${webapp_multiversion_routing}"
path-suffix="${elastic_webapp?resin.id:''}"/>
</host-default> <!-- auto virtual host deployment in hosts/foo.example.com/webapps -->
<host-deploy path="hosts">
<host-default>
<resin:import path="host.xml" optional="true"/>
</host-default>
</host-deploy> <!-- the default host, matching any host name -->
<!-- <host id="" root-directory=".">
<web-app id="/" root-directory="webapps/ROOT"/> <resin:if test="${resin_doc}">
<web-app id="/resin-doc" root-directory="${resin.root}/doc/resin-doc"/>
</resin:if>
</host> --> <!-- *******************************Site Start******************************* --> <!--
<host id="test.com" root-directory="${resin.root}/webapps/test">
<host-alias>test.com</host-alias>
<web-app id="/"></web-app>
</host> -->
<host id="www.xxxx.com" root-directory="${resin.root}/webapps/xxx-demo">
<web-app id="/"></web-app>
</host> <!-- *******************************Site End******************************* --> </cluster> <cluster id="web">
<!-- define the servers in the cluster -->
<server-multi id-prefix="web-" address-list="${web_servers}" port="6810"/> <host id="" root-directory="web">
<web-app id="">
<resin:LoadBalance regexp="" cluster="app"/>
</web-app>
</host>
</cluster> <cluster id="memcached" xmlns:memcache="urn:java:com.caucho.memcached">
<!-- define the servers in the cluster -->
<server-multi id-prefix="memcached-" address-list="${memcached_servers}" port="6820">
<!-- listen for the memcache protocol -->
<listen port="${memcached_port?:11211}"
keepalive-timeout="600s" socket-timeout="600s">
<memcache:MemcachedProtocol/>
</listen>
</server-multi>
</cluster> </resin>

4、配置host文件

详细目录:C:\WINDOWS\system32\drivers\etc\hosts

在该文件后加

127.0.0.1       www.xxxx.com

5、直接可以在浏览器中输入

http://www.xxxx.com:8080/

Eclipse中配置resin 4.x的更多相关文章

  1. Maven学习(一) -- 安装Maven及Eclipse中配置Maven

    标签(空格分隔): 学习笔记 本文环境:Windows7, JDK1.7.0_76 安装及配置Maven环境变量 需要电脑中已经有Java环境 在控制台中输入:echo %JAVA_HOME%看是否能 ...

  2. 在Eclipse中配置Tomcat时,出现Cannot create a server using the selected type错误

    在eclipse中配置Tomcat时,出现Cannot create a server using the selected type错误 原因:Tomcat被删除或者是重新安装,并且安装目录改变了. ...

  3. 在Eclipse中配置Tomcat 创建和运行Servlet/JSP

    在Eclipse中配置Tomcat 创建和运行Servlet/JSP 步骤一:在Eclipse中配置Tomcat(注意下载Eclipse IDE for Java EE Developers) (1) ...

  4. 【Java Web】Eclipse中配置Marven环境

    1  Marven简介 Apache Maven,是一个软件(特别是Java软件)项目管理及自动构建工具,由Apache软件基金会所提供.基于项目对象模型(缩写:POM)概念,Maven利用一个中央信 ...

  5. eclipse中配置c++开发环境 Eclipse + CDT + MinGW

    转自eclipse中配置c++开发环境 Eclipse + CDT + MinGW 基本框架:Eclipse + CDT + MinGW 背景知识: CDT:CDT 是完全用 Java 实现的开放源码 ...

  6. 如何在Eclipse中配置Tomcat(免安装版)

    如何在Eclipse中配置Tomcat(免安装版) 2013-10-09 23:19wgelgrsh | 分类:JAVA相关 | 浏览642次 分享到:   2013-10-10 17:10提问者采纳 ...

  7. Eclipse中配置weka,以及添加算法

    Eclipse中配置weka 1 找到weka的安装位置,寻找weka的压缩文件weka-src.jar,将压缩文件解压,解压出的文件夹weka-src. 2 打开Eclipse,新建Java pro ...

  8. 如何在Eclipse中配置python开发环境

    考虑到网上关于Eclipse中配置Python开发环境的文章千篇一律,故写此文以总结. 本文主要内容是:三种Pydev配置方法和一种PyDev卸载方法. 本文的前提是你已经安装了Eclipse和pyt ...

  9. eclipse中配置spring环境

    初识Spring框架 1.简单使用 eclipse中配置Spring环境,如果是初学的话,只需要在eclipse中引入几个jar包就可以用了, 在普通java project项目目录下,建一个lib文 ...

随机推荐

  1. Android Shell命令dumpsys

    dumpsys命令可以显示手机中所有应用程序的信息,并且也会给出现在手机的状态. 直接执行adb shell dumpsys KEY 会显示以下所有信息. KEY的可选名称 SurfaceFlinge ...

  2. python2和Python3异同总结

    1. python3 异常不再接收逗号(,)作为参数: ## python3 中这样可以正常运行 try: print("在这里执行的代码,有异常进入except") except ...

  3. C/C++中的volatile关键字

    volatile提醒编译器它后面所定义的变量随时都有可能改变,因此编译后的程序每次需要存储或读取这个变量的时候,都会直接从变量地址中读取数据. 如果没有volatile关键字,则编译器可能优化读取和存 ...

  4. python-zip方法

    zip 返回一个将多个可迭代对象组合成一个元组序列的迭代器. 1.  循环多个list的数据: letters = ['a', 'b', 'c'] nums = [1, 2, 3] for lette ...

  5. SVN四部曲之SVN设置详解深入

    想知道不同的设置是干什么用的,你只需将鼠标指针在编辑框/选项框上停留一秒钟...一个帮助提示气泡就会弹出来. 常规设置 图 4.68. 设置对话框,常规设置页面 这个对话框允许你指定自己喜欢的语言,同 ...

  6. (原创)C++11改进我们的程序之简化我们的程序(四)

    这次要讲的是:c++11统一初始化.统一begin()/end()和for-loop循环如何简化我们的程序 初始化列表 c++11之前有各种各样的初始化语法,有时候初始化的时候还挺麻烦,比较典型的如v ...

  7. linux命令(52):usermod 修改账户信息,groupmod

    usermod: usermod [options] user_name usermod 命令修改系统帐户文件来反映通过命令行指定的变化 选项(options) -a|--append  ##把用户追 ...

  8. vs2015配置OpenGL开发环境

    先吐槽下,不知道微软怎么整的,从win7开始,OpenGL的头文件更改到windows SDK中,不安装就不能用. 更搞笑的是,在win10下,vs2015安装还报win sdk安装失败,这典型的自己 ...

  9. python版本坑:md5例子(python2与python3中md5区别)

    对于一些字符,python2和python3的md5加密出来是不一样的. Python2 和Python3MD5加密 # python2.7 pwd = "xxx" + chr(1 ...

  10. Sql server在另一台服务器,在Visual Studio 中没问题,IIS中 提示“在与 SQL Server 建立连接时出现与网络相关的或特定于实例的错误。。。。”

    可能问题一: 确切的说是在IIS 7.5中有这问题 就是在visual studio中都用的好好的,但是加载到IIS上的时候竟然报错“ 在与 SQL Server 建立连接时出现与网络相关的或特定于实 ...