p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Jakarta Struts (http://p2p.wrox.com/forumdisplay.php?f=117)
-   -   Creating Struts Plugin (http://p2p.wrox.com/showthread.php?t=33340)

crystal123 September 12th, 2005 07:31 PM

Creating Struts Plugin

I am working on an example from chapter 4 of the "Professional Jakarta Struts" book ISBN 0-7645-4437-3, pages 84-86. The problem I have is getting the WroxPlugin (implementing Plugin) to read a property file called props.txt.

I revised the code:
File file = new File("PATH TO PROPERTIES FILE");


File file = new File("props.txt");
where props.txt has the content name=crystal

When I deployed and ran this web app, I have the following exception:

javax.servlet.ServletException: ch04\props.txt (The system cannot find the path specified)
    org.apache.struts.action.ActionServlet.initModuleP lugIns(ActionServlet.java:1158)
    org.apache.struts.action.ActionServlet.init(Action Servlet.java:473)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:261)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
    org.apache.coyote.tomcat5.CoyoteAdapter.service(Co yoteAdapter.java:160)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:799)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.processConnection(Http11Protocol.jav a:705)
    org.apache.tomcat.util.net.TcpWorkerThread.runIt(P oolTcpEndpoint.java:577)
    org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:683)
    java.lang.Thread.run(Unknown Source)

...I assume it had to do with the placement of the props.txt which I was not sure where to put it, so I put it in every sub directory in this web app. Yet, I still have the same error. I really stuck now, please help me. Any suggestion is appreciated.

Thank you,

jfarrell November 21st, 2005 05:58 PM


Try setting the path from the root of C:\\(path of file) also could be C:/. You might want to check that the properties to the file is not set to archive preventing you from reading it.

All times are GMT -4. The time now is 02:39 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.