可能原因: tuckey.org 无法正常访问 ,urlrewrite 配置 网络 dtd 无法下载 。。
先把 urlrewrite 日志 配置好:
<filter>
<filter-name>UrlRewriteFilter</filter-name>
<filter-class>org.tuckey.web.filters.urlrewrite.UrlRewriteFilter</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>log4j</param-value>
</init-param>
</filter>
log4j 是使用 log4j 日志配置的 意思
#Created by JInto - www.guh-software.de
#Thu Feb 09 10:05:48 CST 2012
log4j.additivity.crawl=false
log4j.appender.crawllog=org.apache.log4j.DailyRollingFileAppender
log4j.appender.crawllog.Append=true
log4j.appender.crawllog.DatePattern='_'yyyy-MM-dd'.log' //根据名字 判断文件产生的时间。例是 每天产生一个日志文件
log4j.appender.crawllog.File=D:/apache-tomcat-6.0.26/fis_logs/crawl.out
log4j.appender.crawllog.Threshold=info
log4j.appender.crawllog.layout=org.apache.log4j.PatternLayout
log4j.appender.crawllog.layout.ConversionPattern=[%p]\t%d (%F\:%L) - %m%n
log4j.appender.log=org.apache.log4j.DailyRollingFileAppender
log4j.appender.log.Append=true
log4j.appender.log.DatePattern='_'yyyy-MM-dd'.log'
log4j.appender.log.File=D:/apache-tomcat-6.0.26/fis_logs/logs.out
log4j.appender.log.Threshold=debug
log4j.appender.log.layout=org.apache.log4j.PatternLayout
log4j.appender.log.layout.ConversionPattern=[%p]\t%d (%F\:%L) - %m%n
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.Threshold=debug
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%p]\t%d (%F\:%L) - %m%n
log4j.logger.com.opensymphony=error
log4j.logger.crawl=error,crawllog
log4j.logger.noModule=FATAL
log4j.logger.org.apache.struts2=error
log4j.rootLogger=error,log,stdout
重启多次 会发现有时报如下错误:
[ERROR] 2014-12-18 17:33:51,340 (Log.java:400) - Exception loading conf tuckey.org
java.net.UnknownHostException: tuckey.org
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at java.net.Socket.connect(Socket.java:478)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.http.HttpClient.<init>(HttpClient.jav
a:234)
at sun.net.www.http.HttpClient.New(HttpClient.java:306)
at sun.net.www.http.HttpClient.New(HttpClient.java:323)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:837)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:677)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1315)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1283)
at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:284)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1194)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1098)
at com.sun.org.apache.xerces.internal.impl.XMLDocu
g.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1560)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:139)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
Task(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:909)
at java.lang.Thread.run(Thread.java:662)
[ERROR] 2014-12-18 17:33:51,343 (Log.java:381) - Conf failed to load
mentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1003)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Conf
iguration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:121)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:285)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:153)
at org.tuckey.web.filters.urlrewrite.Conf.loadDom(Conf.java:206)
at org.tuckey.web.filters.urlrewrite.Conf.<init>(Conf.java:129)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.loadUrlRewriterLocal(UrlRewriteFilter.java:
282)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.loadUrlRewriter(UrlRewriteFilter.java:259)
at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.init(UrlRewriteFilter.java:250)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)
at or
解决:1. 系统配置了 访问白名单 ,而 tuckey.org 不在白名单
2. 架包为3.2 而 urlrewrite.xml 文件引入的docment dtd 为 其他版本