Title: Message
Putting the file in \Tomcat\webapps\axis\WEB-INF\classes didn't work, but putting
it in the \Windows\System32 directiory did work. 
 
Here's my code.  Right now, I'm just hardcoding a file name.
 
  
    String dataFilename = "TollTransactionRecord.xml";
      LineNumberReader reader = null;
 
      try
      {
         reader = new LineNumberReader(new FileReader(filename));
         if (reader == null)
         {
            errString = "Unable to open the data source file '" + filename + "'.";
            m_logger.error(errString);
            throw new RemoteException(errString);
         }
      }
      catch (FileNotFoundException e)
      {
         errString = "Data source file '" + filename + "' does not exist or " +
                     "cannot be opened. Reason: " + e.toString();
         m_logger.info(errString);
         throw new RemoteException(errString);
      }
Thanks for your help,
Jan
-----Original Message-----
From: Ferruh Zamangoer [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 07, 2005 3:55 PM
To: [email protected]
Subject: AW: Web Service reading file from disk

You must put your file to the classes directory.

 

……. \Tomcat 4.1\webapps\axis\WEB-INF\classes

 

Can you show me your code how you want to access the file.


Regards

Ferruh

 

 


Von: Miller, Janet [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 7. Juli 2005 20:41
An: [email protected]
Betreff: Web Service reading file from disk

 

I am developing a test web service and I would like it to read a test input data file from disk.

I have successfully deployed my web service and have been able to access it via a client.

However, when I modify the code to read an input file, it cannot find the file and I get a

FileNotFoundException.  I've tried putting the input file in various places including Tomcat/common/libs

Tomcat/webapps, Tomcat/webapps/axis, Tomcat/webapps/axis/WEB-IN, Tomcat/webapps/axis/WEB-INF/classes,

Tomcat/webapps/axis/WEB-INF, ...

 

I'm using Tomcat 5.5.9 and Axis 1.2.1 on Windows 2000.  Does anyone know if it is possible

to do this and if so, where I need to put the file?  I'm not specifying a directory name in my code

when I try to open the file, but maybe I need to.

 

Thanks, Jan

 

Exception in thread "main" AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException

faultSubcode:

faultString: java.rmi.RemoteException: Data source file 'TollTransactionRecord.xml' does not exist or cannot be opened. Reason: java.io.FileNotFoundException: TollTransactionRecord.xml (The system cannot find the file specified)

faultActor:

faultNode:

faultDetail:

{http://xml.apache.org/axis/}hostname:W-ROCSOF035

Reply via email to