jetty当一个轻量级应用服务器部署时候,对于war把不会像tomcat一样解压缩出来处理。(可能解压到临时目录)
而使用paoding分词器如果把字典放到classpath下面。
当使用的时候,分词器会查找而这个时候就会导致异常。
2009-11-24 17:54:18.269::WARN: /dblocal/create
net.paoding.analysis.exception.PaodingAnalysisException: dic home should not be a file, but a directory!
at net.paoding.analysis.knife.PaodingMaker.setDicHomeProperties(PaodingMaker.java:338)
at net.paoding.analysis.knife.PaodingMaker.getDicHome(PaodingMaker.java:261)
at net.paoding.analysis.knife.PaodingMaker.loadProperties(PaodingMaker.java:189)
at net.paoding.analysis.knife.PaodingMaker.loadProperties(PaodingMaker.java:228)
at net.paoding.analysis.knife.PaodingMaker.loadProperties(PaodingMaker.java:228)
at net.paoding.analysis.knife.PaodingMaker.getProperties(PaodingMaker.java:130)
at net.paoding.analysis.analyzer.PaodingAnalyzer.init(PaodingAnalyzer.java:70)
at net.paoding.analysis.analyzer.PaodingAnalyzer.<init>(PaodingAnalyzer.java:59)
at net.paoding.analysis.analyzer.PaodingAnalyzer.<init>(PaodingAnalyzer.java:52)
at com.uutuu.linesearch.service.IndexManager.chineseToken(IndexManager.java:360)
at com.uutuu.linesearch.service.IndexManager.addIndex(IndexManager.java:131)
at com.uutuu.linesearch.service.IndexManager.createIndex(IndexManager.java:74)
at com.uutuu.linesearch.controller.CreateIndex.execute(CreateIndex.java:43)
at com.uutuu.linesearch.controller.CreateIndex.doGet(CreateIndex.java:32)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:915)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:539)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
这个问题目前没发现根本解决办法,也许需要配置jetty,可是还不会。目前有几种替代办法:
1、把jetty内嵌在应用程序中
2、不要用war部署,直接解压出来
3、指定字典的路径不是classpath,而是外部的路径
jetty怎么写能把war包解压到当前目录 ?有知道的麻烦告诉我一声。