Cant find a properties file - and shutdowns Tomcat

2002-12-13 Thread aps olute
1) Please help, the support class of my servlet is not able to find the file
town.xml. I have this file town.xml at taxi/town.xml, a copy at
taxi/WEB-INF/classes/town.xml I tried to pre-pend with / and no / with 
same results. A snippet of the log is below:

 81 2002-12-13 01:25:05 StandardContext[/taxi]: Starting filters
 82 2002-12-13 01:25:05  okay it found the file and it exist
 83 Making Javaville from file town.xml
 84 ERROR in opening file town.xml
 85 XmlTree creation failure:/town.xml (No such file or directory)
 86 java.io.FileNotFoundException: /town.xml (No such file or directory)
 87 at java.io.FileInputStream.open(Native Method) 

Code snippets, on my  servlet init() method I have
 18 static String configFileName = taxisocket.properties;
 19 static String DEFAULT_XML_FILE = town.xml;   
.
 50 String xmlfile = p.getProperty(xmlfile, DEFAULT_XML_FILE);
 51 System.out.println(Making Javaville from file  + xmlfile);
 52
 53 XmlTree xt = null;
 54 try {
 55 xt = new XmlTree(new File(xmlfile));
 56

on XmlTree.java:
 28 public XmlTree(File f) throws FileNotFoundException, IOException {
 29
 30 //open the file
 31 try {
 32 br = new BufferedReader(new FileReader(/+f));
 33 } catch (FileNotFoundException fnfe) {
 34 System.err.println(ERROR in opening file  + f);
 35 throw fnfe;
 36 }

2) Also if I modify the XmlTree to use the following code, TOMCAT just
shutdowns about a second after starting. Why would this code shutdowns Tomcat?
This compiles okay and I assume once the servlet calls this at the init(), it
shuts down Tomcat.

 33 // force to read a  File.
 34   InputStream is = getClass().getResourceAsStream(town.xml);
 38   br = new BufferedReader(new InputStreamReader(is));

aps

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Cant find a properties file - and shutdowns Tomcat

2002-12-13 Thread Jacob Kjome
Hello aps,

First, don't use File IO if it isn't necessary (and it isn't here).
Second, see:
http://marc.theaimsgroup.com/?l=tomcat-userm=103904964313189w=2

Jake

Friday, December 13, 2002, 11:26:08 AM, you wrote:

ao 1) Please help, the support class of my servlet is not able to find the file
ao town.xml. I have this file town.xml at taxi/town.xml, a copy at
ao taxi/WEB-INF/classes/town.xml I tried to pre-pend with / and no / with 
ao same results. A snippet of the log is below:

ao  81 2002-12-13 01:25:05 StandardContext[/taxi]: Starting filters
ao  82 2002-12-13 01:25:05  okay it found the file and it exist
ao  83 Making Javaville from file town.xml
ao  84 ERROR in opening file town.xml
ao  85 XmlTree creation failure:/town.xml (No such file or directory)
ao  86 java.io.FileNotFoundException: /town.xml (No such file or directory)
ao  87 at java.io.FileInputStream.open(Native Method) 

ao Code snippets, on my  servlet init() method I have
ao  18 static String configFileName = taxisocket.properties;
ao  19 static String DEFAULT_XML_FILE = town.xml;   
ao .
ao  50 String xmlfile = p.getProperty(xmlfile, DEFAULT_XML_FILE);
ao  51 System.out.println(Making Javaville from file  + xmlfile);
ao  52
ao  53 XmlTree xt = null;
ao  54 try {
ao  55 xt = new XmlTree(new File(xmlfile));
ao  56

ao on XmlTree.java:
ao  28 public XmlTree(File f) throws FileNotFoundException, IOException {
ao  29
ao  30 //open the file
ao  31 try {
ao  32 br = new BufferedReader(new FileReader(/+f));
ao  33 } catch (FileNotFoundException fnfe) {
ao  34 System.err.println(ERROR in opening file  + f);
ao  35 throw fnfe;
ao  36 }

ao 2) Also if I modify the XmlTree to use the following code, TOMCAT just
ao shutdowns about a second after starting. Why would this code shutdowns Tomcat?
ao This compiles okay and I assume once the servlet calls this at the init(), it
ao shuts down Tomcat.

ao  33 // force to read a  File.
ao  34   InputStream is = getClass().getResourceAsStream(town.xml);
ao  38   br = new BufferedReader(new InputStreamReader(is));

ao aps

ao __
ao Do you Yahoo!?
ao Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
ao http://mailplus.yahoo.com

ao --
ao To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
ao For additional commands, e-mail: mailto:[EMAIL PROTECTED]



-- 
Best regards,
 Jacobmailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Cant find a properties file - and shutdowns Tomcat

2002-12-13 Thread aps olute

  Thank you for the response.  However, I tried one of your solutions already
as posted on question #2. Any other ways? 


--- Jacob Kjome [EMAIL PROTECTED] wrote:
 Hello aps,
 
 First, don't use File IO if it isn't necessary (and it isn't here).
 Second, see:
 http://marc.theaimsgroup.com/?l=tomcat-userm=103904964313189w=2
 
 Jake
 
 Friday, December 13, 2002, 11:26:08 AM, you wrote:
 
 ao 1) Please help, the support class of my servlet is not able to find the
 file
 ao town.xml. I have this file town.xml at taxi/town.xml, a copy at
 ao taxi/WEB-INF/classes/town.xml I tried to pre-pend with / and no /
 with 
 ao same results. A snippet of the log is below:
 
 ao  81 2002-12-13 01:25:05 StandardContext[/taxi]: Starting filters
 ao  82 2002-12-13 01:25:05  okay it found the file and it exist
 ao  83 Making Javaville from file town.xml
 ao  84 ERROR in opening file town.xml
 ao  85 XmlTree creation failure:/town.xml (No such file or directory)
 ao  86 java.io.FileNotFoundException: /town.xml (No such file or
 directory)
 ao  87 at java.io.FileInputStream.open(Native Method) 
 
 ao Code snippets, on my  servlet init() method I have
 ao  18 static String configFileName = taxisocket.properties;
 ao  19 static String DEFAULT_XML_FILE = town.xml;   
 ao .
 ao  50 String xmlfile = p.getProperty(xmlfile,
 DEFAULT_XML_FILE);
 ao  51 System.out.println(Making Javaville from file  +
 xmlfile);
 ao  52
 ao  53 XmlTree xt = null;
 ao  54 try {
 ao  55 xt = new XmlTree(new File(xmlfile));
 ao  56
 
 ao on XmlTree.java:
 ao  28 public XmlTree(File f) throws FileNotFoundException,
 IOException {
 ao  29
 ao  30 //open the file
 ao  31 try {
 ao  32 br = new BufferedReader(new FileReader(/+f));
 ao  33 } catch (FileNotFoundException fnfe) {
 ao  34 System.err.println(ERROR in opening file  + f);
 ao  35 throw fnfe;
 ao  36 }
 
 ao 2) Also if I modify the XmlTree to use the following code, TOMCAT just
 ao shutdowns about a second after starting. Why would this code shutdowns
 Tomcat?
 ao This compiles okay and I assume once the servlet calls this at the
 init(), it
 ao shuts down Tomcat.
 
 ao  33 // force to read a  File.
 ao  34   InputStream is = getClass().getResourceAsStream(town.xml);
 ao  38   br = new BufferedReader(new InputStreamReader(is));
 
 ao aps
 
 ao __
 ao Do you Yahoo!?
 ao Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 ao http://mailplus.yahoo.com
 
 ao --
 ao To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 ao For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 -- 
 Best regards,
  Jacobmailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Cant find a properties file - and shutdowns Tomcat

2002-12-13 Thread aps olute

   Eddie, line is 13 is not even close to a taglib so the error from the log
is misleading. This is not the only time I have problems with the Digester. 
Can you kindly please tell me how to enable some kind of identification which
file the Digester is processing where it finds the error?  Having several
Struts related xml files, with similar names, its difficult to figure out which
xml file the Digester is processing without knowing which context.  Any
pointers is apreciated.


--- aps olute [EMAIL PROTECTED] wrote:
 1) Please help, the support class of my servlet is not able to find the file
 town.xml. I have this file town.xml at taxi/town.xml, a copy at
 taxi/WEB-INF/classes/town.xml I tried to pre-pend with / and no / with 
 same results. A snippet of the log is below:
 
  81 2002-12-13 01:25:05 StandardContext[/taxi]: Starting filters
  82 2002-12-13 01:25:05  okay it found the file and it exist
  83 Making Javaville from file town.xml
  84 ERROR in opening file town.xml
  85 XmlTree creation failure:/town.xml (No such file or directory)
  86 java.io.FileNotFoundException: /town.xml (No such file or directory)
  87 at java.io.FileInputStream.open(Native Method) 
 
 Code snippets, on my  servlet init() method I have
  18 static String configFileName = taxisocket.properties;
  19 static String DEFAULT_XML_FILE = town.xml;   
 .
  50 String xmlfile = p.getProperty(xmlfile, DEFAULT_XML_FILE);
  51 System.out.println(Making Javaville from file  + xmlfile);
  52
  53 XmlTree xt = null;
  54 try {
  55 xt = new XmlTree(new File(xmlfile));
  56
 
 on XmlTree.java:
  28 public XmlTree(File f) throws FileNotFoundException, IOException
 {
  29
  30 //open the file
  31 try {
  32 br = new BufferedReader(new FileReader(/+f));
  33 } catch (FileNotFoundException fnfe) {
  34 System.err.println(ERROR in opening file  + f);
  35 throw fnfe;
  36 }
 
 2) Also if I modify the XmlTree to use the following code, TOMCAT just
 shutdowns about a second after starting. Why would this code shutdowns
 Tomcat?
 This compiles okay and I assume once the servlet calls this at the init(), it
 shuts down Tomcat.
 
  33 // force to read a  File.
  34   InputStream is = getClass().getResourceAsStream(town.xml);
  38   br = new BufferedReader(new InputStreamReader(is));
 
 aps
 
 __
 Do you Yahoo!?
 Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]