eclipse中resin服务器的分离部署
javaWEB中许多同学习惯使用tomcat作为服务器,但有的公司也有使用resin作为服务器的习惯。现在就说说个人用resin在eclipse上实现分离部署的步骤吧。
首先,现在resin,和tomcat一样都是免安装版,大概20多m的样子。
第二步:在resin——conf目录下找到resin.xml,建议复制一个重新写,一个程序对应一个xml。
<web-app id="/项目名" root-directory="E:\..项目位置\WebRoot" />
<!-- define the servers in the cluster修改端口位置 -->
<server id="" address="127.0.0.1" port="6810"> </server>
<!-- -------------------------------------------------- --!>
<!-- 数据库配置database config added by hxm -->
<database>
<jndi-name>jdbc/payment</jndi-name>
<driver type="com.mysql.jdbc.Driver">
<url>jdbc:mysql://localhost:3306/payment?characterEncoding=gbk</url>
<user>root</user>
<password>123456</password>
</driver>
<prepared-statement-cache-size>8</prepared-statement-cache-size>
<max-connections>20</max-connections>
<max-idle-time>30s</max-idle-time>
</database>
主要就修改以上几个地方。
第三步,打开eclipse,导入程序后,Run–run configuration–java application–new application。此时先导入resin的jar包,在resin目录的lib下。
Main中: project :选择你要运行的程序。
Main Class: resin的启动类,com.caucho.server.resin.Resin(导入jar包后才会有。)
arguments中:program arguments:-conf “E:\resin路径\conf\resin_microweb_mian.xml” (resin中配置文件resin.xml)
vm arguments:-Djava.util.logging.manager=com.caucho.log.LogManagerImpl
然后就可以愉快的使用resin服务器运行自己的程序了。