View Single Post
  #1 (permalink)  
Old September 12th, 2005, 07:31 PM
crystal123 crystal123 is offline
Registered User
 
Join Date: Sep 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating Struts Plugin

Hi,

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");

to

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)
    ch04.WroxPlugin.init(WroxPlugin.java:49)
    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,
Crystal