﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-kangkang的javablog-文章分类-Resin</title><link>http://www.blogjava.net/easyck/category/769.html</link><description>kangkang的javablog</description><language>zh-cn</language><lastBuildDate>Fri, 02 Mar 2007 06:51:24 GMT</lastBuildDate><pubDate>Fri, 02 Mar 2007 06:51:24 GMT</pubDate><ttl>60</ttl><item><title>resin3.0.10 入门 基本配置     选择自 Lizongbo 的 Blog </title><link>http://www.blogjava.net/easyck/articles/2076.html</link><dc:creator>康康</dc:creator><author>康康</author><pubDate>Mon, 14 Mar 2005 10:09:00 GMT</pubDate><guid>http://www.blogjava.net/easyck/articles/2076.html</guid><wfw:comment>http://www.blogjava.net/easyck/comments/2076.html</wfw:comment><comments>http://www.blogjava.net/easyck/articles/2076.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/easyck/comments/commentRss/2076.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/easyck/services/trackbacks/2076.html</trackback:ping><description><![CDATA[<SPAN id=ArticleContent1_ArticleContent1_lblContent> 
<DIV>（我使用的jdk为：jdk1.5.0_01,环境变量JAVA_HOME=D:\jdk1.5.0_01,</DIV>
<DIV>path=D:\jdk1.5.0_01\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;）</DIV>
<DIV>1.下载：<A href="http://www.caucho.com/download/resin-3.0.10.zip">http://www.caucho.com/download/resin-3.0.10.zip</A></DIV>
<DIV>解压到D:\resin-3.0.10</DIV>
<DIV>2.运行setup.exe。指定resin Home:D:\resin-3.0.10</DIV>
<DIV>3.运行httpd.exe.</DIV>
<DIV>4.修改端口为80：打开D:\resin-3.0.10\conf\resin.conf,</DIV>
<DIV>找到"8080"，修改为80，保存,重新启动resin。<BR>    <!-- The http port --><BR>    <http server-id="" host="*" port="80"/></DIV>
<DIV>5.发布webapp：   </DIV>
<DIV>在resin.conf的结尾处： <host id="" root-directory="."><BR>      <!--<BR>         - configures an explicit root web-app matching the<BR>         - webapp's ROOT<BR>        --><BR>      <web-app id='/' document-directory="webapps/ROOT"/><BR>    </host></DIV>
<DIV>修改为：</DIV>
<DIV> <host id="" root-directory="."><BR>      <!--<BR>         - configures an explicit root web-app matching the<BR>         - webapp's ROOT<BR>        --><BR>      <web-app id='/' document-directory="webapps/ROOT"/></DIV>
<DIV>      <web-app id='/lizongbo' document-directory="E:/lizongbo/oscachedemo/test"/><BR>    </host></DIV>
<DIV>重新启动resin，访问 <A href="http://localhost/test/">http://localhost/<FONT color=#000000>lizongbo</FONT>/</A> 就可以看到效果。</DIV>
<DIV>6.配置虚拟主机：</DIV>
<DIV>在文件结尾处</server>之前加上下面一段:</DIV>
<DIV> </DIV>
<DIV>    <host id="lizongbo.myresintest.com" root-directory="."><BR>      <web-app id='/' document-directory="webapps/ROOT"/><BR>      <web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test"/><BR>    </host></DIV>
<DIV>保存文件。</DIV>
<DIV>在c:\windows\system32\drivers\etc\host文件里加上下面一行：</DIV>
<DIV>lizongbo.myresintest.com   127.0.0.1 </DIV>
<DIV> </DIV>
<DIV>保存host文件。</DIV>
<DIV>重新启动resin，重新打开浏览器。输入<A href="http://lizongbo.myresintest.com/lizongbo/">http://<FONT color=#000000>lizongbo.myresintest.com</FONT>/lizongbo/</A></DIV>
<DIV>就可以看到虚拟主机配置成功。</DIV>
<DIV> </DIV>
<DIV>7.发布我的webapp的时候遇到了下面的错误信息。</DIV>
<DIV>org.xml.sax.SAXNotRecognizedException: <A href="http://xml.org/sax/features/validation">http://xml.org/sax/features/validation</A></DIV>
<DIV>查找资料<A href="http://www.google.com/search?hl=zh-CN&inlang=zh-CN&newwindow=1&q=resin+org.xml.sax.SAXNotRecognizedException&lr">http://www.google.com/search?hl=zh-CN&inlang=zh-CN&newwindow=1&q=resin+org.xml.sax.SAXNotRecognizedException&lr</A>=，（参考：<A href="http://www.slamb.org/svn/repos/projects/axamol/sax-pipeline/README">http://www.slamb.org/svn/repos/projects/axamol/sax-pipeline/README</A>）</DIV>
<DIV>需要新建一个 jaxp.properties， 内容如下：</DIV>
<DIV>javax.xml.parsers.SAXParserFactory: org.apache.xerces.jaxp.SAXParserFactoryImpl</DIV>
<DIV>保存文件到$JAVA_HOME/jre/lib/下面</DIV>
<DIV>接下来可能会出现下面的错误信息：</DIV>
<DIV>javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.SAX<BR>ParserFactoryImpl could not be instantiated: java.lang.NullPointerException</DIV>
<DIV>因此还需要把xercesImpl.jar复制到D:\jdk1.5.0_01\jre\lib\endorsed下面（没有这个目录就创建这个目录）</DIV>
<DIV>重新启动resin,我的webapp启动成功了。</DIV>
<DIV>访问 <A href="http://lizongbo.myresintest.com/mywebapp/">http://<FONT color=#000000>lizongbo.myresintest.com</FONT>/mywebapp/</A>，页面正常出现。</DIV>
<DIV>b.另外一种更简单的解决方法，不需要修改jdk的配置</DIV>
<DIV>((此方法没有测试过，请参考<A href="http://www-900.ibm.com/developerWorks/cn/webservices/ws-axisfaq/index.shtml">http://www-900.ibm.com/developerWorks/cn/webservices/ws-axisfaq/index.shtml</A>和<A href="http://www.caucho.com/quercus/faq/question.xtp?question_id=295">http://www.caucho.com/quercus/faq/question.xtp?question_id=295</A>))：</DIV>
<DIV>    <host id="lizongbo.myresintest.com" root-directory="."><BR>      <web-app id='/' document-directory="webapps/ROOT"/><BR>      <web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test"></DIV>
<DIV>      <system-property javax.xml.transform.TransformerFactory="org.apache.xalan.processor.TransformerFactoryImpl"/><BR><system-property javax.xml.parsers.DocumentBuilderFactory="org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/><BR><system-property javax.xml.parsers.SAXParserFactory="org.apache.xerces.jaxp.SAXParserFactoryImpl"/><BR><system-property org.xml.sax.driver="org.apache.xerces.parsers.SAXParser"/></DIV>
<DIV></web-app><BR>    </host></DIV>
<DIV> </DIV>
<DIV>8.resin支持二级域名。</DIV>
<DIV>同6，主机名和doc路径，都使用正则表达式。</DIV>
<DIV>(例子：<host url-regexp='^([^/]*).test.com' app-dir='web/$1'/>)<BR>    <host id="^(*).lizongbo.com" root-directory=".">      </DIV>
<DIV>        <!--<BR>         - configures an explicit root web-app matching the<BR>         - webapp's ROOT<BR>        --><BR>      <web-app id='/' document-directory="webapps/ROOT"/><BR>      <web-app id='/lizongbo' document-directory="E:/jb/oscachedemo/test"/><BR>    </host></DIV>
<DIV>再配合上泛域名解析，就非常方便了。</DIV>
<DIV>(在host文件里加上</DIV>
<DIV>127.0.0.1   aaa.lizongbo.com</DIV>
<DIV>127.0.0.1   bbb.lizongbo.com</DIV>
<DIV>然后访问这两个主机名，可以看见虚拟主机解析成功。</DIV>
<DIV>)</DIV>
<DIV>9.在Jbuilder2005中支持resin.</DIV>
<DIV>在 <A href="http://www.caucho.com/projects/index.xtp">http://www.caucho.com/projects/index.xtp</A> 下载 <A href="http://www.caucho.com/projects/jbuilder/resin-jbuilder-7.jar">http://www.caucho.com/projects/jbuilder/resin-jbuilder-7.jar</A></DIV>
<DIV>保存到 JBuilderHome/lib/ext下。</DIV>
<DIV>(Jb2005不支持)</DIV>
<DIV> </DIV>
<DIV>10.一个host配置参考：</DIV>
<DIV> </DIV>
<DIV> <host id='www.lizongbo.com'><BR>  <welcome-file-list>index.jsp, index.htm, index.html </welcome-file-list> <BR>  <error-log id='logs/lizongbo.com.log'/><BR>   <doc-dir>E:/jb/lizongbo/webapp</doc-dir><BR>   <web-app id='/'><BR>       <classpath id='WEB-INF/classes'<BR>                 source='WEB-INF/classes'<BR>                 compile='false'/><BR><servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/><BR><servlet-mapping url-pattern='*.jsp' servlet-name='jsp'/><BR><servlet-mapping url-pattern='*.html' servlet-name='jsp'/><BR><BR>    <BR>    <session-config><BR>   <session-max>4096</session-max><BR>   <session-timeout>30</session-timeout><BR>   <enable-cookies>true</enable-cookies><BR>   <enable-url-rewriting>true</enable-url-rewriting><BR>    </session-config><BR>   </web-app><BR> </host></DIV>
<DIV><BR>
<DIV>11.与IIS整合。</DIV>
<DIV>安装好(WinXP+SP2下的)IIS,运行D:\resin-3.0.10\setup.exe</DIV>
<DIV><IMG align=baseline alt="" border=0 hspace=0 src="http://blog.csdn.net/images/blog_csdn_net/lizongbo/94607/o_resin3010001.gif"></DIV>
<DIV>点Apply即可。</DIV>
<DIV>我的电脑-->右键-->管理-->Internet信息服务-->网站-->默认网站，</DIV>
<DIV>右键--〉属性-->ISAPI筛选器-->添加</DIV>
<DIV><FONT size=2>筛选器名称：Resin_3.0.10</FONT></DIV>
<DIV><FONT size=2>可执行文件：C:\Inetpub\scripts\isapi_srun.dll</FONT></DIV>
<DIV><BR><IMG align=baseline alt="" border=0 hspace=0 src="http://blog.csdn.net/images/blog_csdn_net/lizongbo/94607/o_resin3010002.gif"><BR><IMG align=baseline alt="" border=0 hspace=0 src="http://blog.csdn.net/images/blog_csdn_net/lizongbo/94607/o_resin3010004.gif"></DIV>
<DIV>确定，然后重新启动iis。再启动resin.此时就可以访问</DIV>
<DIV><A href="http://localhost/index.jsp">http://localhost/index.jsp</A>了</DIV>
<DIV>如果没有启动resin。</DIV>
<DIV>将得到下面的错误信息：</DIV>
<DIV>
<H1>Can't contact Servlet Runner at localhost:6802</H1></DIV></DIV></SPAN><img src ="http://www.blogjava.net/easyck/aggbug/2076.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/easyck/" target="_blank">康康</a> 2005-03-14 18:09 <a href="http://www.blogjava.net/easyck/articles/2076.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>