Tomcat中的虚拟目录不起作用

时间:2013-12-09 17:29:54

标签: windows tomcat virtual-directory

Tomcat虚拟目录不起作用。

嗨,我对Tomcat 7有这个问题,当引用是本地文件夹时它可以工作,但如果它是另一台计算机上的文件夹,则无法识别。

这是我正在使用的配置 < Context path =“/ POS”docBase =“\ SERVER1 \ temp \ pdfs”debug =“0”privileged =“true”>

引用的目录是共享的,如果我可以从浏览器中看到它,则具有读写权限。

Tomcat在Windows XP上运行,另一台计算机是Windows 2003

这是错误:

dic 09,2013 11:33:55 AM org.apache.catalina.core.StandardContext resourcesStart 严重:错误arrancandoRecursosestáticos java.lang.IllegalArgumentException:El Documento base \ SERVER1 \ temp \ pdfs no existe o no es un directorio legible     在org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)     at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4836)     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5016)     在org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)     在org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1247)     在org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:747)     在org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:222)     在javax.servlet.http.HttpServlet.service(HttpServlet.java:641)     在javax.servlet.http.HttpServlet.service(HttpServlet.java:722)     在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)     在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     在org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:187)     在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)     在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     在org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)     在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)     在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)     在org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)     在org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)     在org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)     在org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)     在org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)     在org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)     在org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405)     在org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:964)     at org.apache.coyote.AbstractProtocol $ AbstractConnectionHandler.process(AbstractProtocol.java:515)     at org.apache.tomcat.util.net.JIoEndpoint $ SocketProcessor.run(JIoEndpoint.java:304)     at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)     at java.util.concurrent.ThreadPoolExecutor $ Worker.run(Unknown Source)     在java.lang.Thread.run(未知来源)

感谢。

2 个答案:

答案 0 :(得分:1)

尝试将共享映射到本地驱动器(比如F:映射到\\\SERVER1\temp),然后在docbase中指定驱动器。例如

<Context path="/POS" docBase="F:/pdfs" debug="0" privileged="true">

答案 1 :(得分:0)

我找到了解决方案,我尝试了它并且效果很好:

打开控制面板 - &gt;管理工具 - &gt;服务。双击Tomcat服务。转到“登录”选项卡。选择“此帐户”,然后填写您的凭据。

http://www.coderanch.com/t/594397/Tomcat/Shared-folder-accessible-running-tomcat

感谢您的建议。