Better explained of my problem with renaming a file in Tomcat

2005-06-22 Thread Kam Lung Leung
Hi,

I have a servlet, RenameFile, that receives audio file via HTTP Post and
writes it to /tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav.
Then it creates directories under /alert_messages directory based on the
timing parameters that it get. Finally, it renames the 
/tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav file to  
/alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV. RenameFile runs
fine when it runs by itself (ONLY one Tomcat, jakarta-tomcat-4.1.30, is 
running). However, RenameFile fails to rename the 
/tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav to
/alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV when it runs 
in a Linux box that jboss-3.2.1_tomcat-4.1.24 is also running. In this box,
TWO versions of Tomcat are running at the same time. I set the
/alert_messages directory with “chmod –R 777” and run jakarta-tomcat-4.1.30
as tomcat user. RenameFile fails the rename operation. But, it creates the
/alert_messages/2005/06/22/22/00/ directories.

It seem like RenameFile can create directory but can’t create file in the
/alert_messages directory when both version of tomcats are running at the
same time. Can it be due to both the jakarta-tomcat-4.1.30 and the 
jboss-3.2.1_tomcat-4.1.24 versions are running at the same time in one
Linux box?  Can this be Jboss prevented the operation?


Any help in this issue is greatly appreciated.



Debug listing from the RenameFile;
- originalFilename: recording.0002002B-0C0022BB-0001.1.20050622.073208.wav
- file.toString(): /tmp/recording.0002002B-0C0022BB-0001.1.20050622.073208.wav
- file.getName(): recording.0002002B-0C0022BB-0001.1.20050622.073208.wav
- file.length(): 122986
- file /alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV
- file NOT renamed /alert_messages/2005/06/22/22/00/79_0_20050600_001.WAV

File Listing in the /tmp directory create by RenameFile;
-rw-r--r--1 tomcat   tomcat  122986 Jun 22 07:33 
recording.0002002B-0C0022BB-0001.1.20050622.073208.wav

Directoy Listing in the / directory with “ls –la”;
drwxrwxrwx3 tomcat   tomcat   4096 Jun 22 07:28 alert_messages

Directory created by the RenameFile with “ls -la 
/alert_messages/2005/06/22/22/00”;
drwxr-xr-x2 tomcat   tomcat4096 Jun 22 07:33 .
drwxr-xr-x3 tomcat   tomcat4096 Jun 22 07:33 ..



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



Re: Better explained of my problem with renaming a file in Tomcat

2005-06-22 Thread Jason Bainbridge
On 6/22/05, Kam Lung Leung [EMAIL PROTECTED] wrote:
 Hi,
 
 I have a servlet, RenameFile, that receives audio file via HTTP Post 

I should have read your post better and realized there was no Java
method for RenameFile as that is what I wrongly assumed... How exactly
are you ceating the directories and trying to move the file?

Are both servers running the same servlet and doing similar things?


-- 
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

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



Re: Better explained of my problem with renaming a file in Tomcat

2005-06-22 Thread Kam Lung Leung
Hi Jason,

Thank very much for helping me to solve this issue. Only the 
jakarta-tomcat-4.1.30 contains servlet named RenameFile. The other version of 
tomcat ( jboss-3.2.1_tomcat-4.1.24) is embedded in the Jboss. This version of 
tomcat does not contais the servlet named RenameFile. A color coded of the java 
class that does the renaming of the file is listed in the following site:
 http://forum.java.sun.com/thread.jspa?threadID=638498

Thank again for your help.

 Jason Bainbridge [EMAIL PROTECTED] wrote:

 On 6/22/05, Kam Lung Leung [EMAIL PROTECTED] wrote:
  Hi,
  
  I have a servlet, RenameFile, that receives audio file via HTTP Post 
 
 I should have read your post better and realized there was no Java
 method for RenameFile as that is what I wrongly assumed... How exactly
 are you ceating the directories and trying to move the file?
 
 Are both servers running the same servlet and doing similar things?
 
 
 -- 
 Jason Bainbridge
 http://kde.org - [EMAIL PROTECTED]
 Personal Site - http://jasonbainbridge.com
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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



Re: Better explained of my problem with renaming a file in Tomcat

2005-06-22 Thread Kam Lung Leung
Hi,

Thank to stdunbar for pointing out the problem that I was having. It turns out 
that the /tmp and the /alert_messages ware mounted on two different nodes in 
the file system. After changing the directory for writing the temporary audio 
file to be the same as the /alert_messages directory. The problem goes away.

/dev/sda11  497829 27391444736   6% /tmp
/dev/sda7  1011928217304743220  23% /

Thank Jason for his help.

Kam

 Kam Lung Leung [EMAIL PROTECTED] wrote:

 Hi Jason,
 
 Thank very much for helping me to solve this issue. Only the 
 jakarta-tomcat-4.1.30 contains servlet named RenameFile. The other version of 
 tomcat ( jboss-3.2.1_tomcat-4.1.24) is embedded in the Jboss. This version of 
 tomcat does not contais the servlet named RenameFile. A color coded of the 
 java class that does the renaming of the file is listed in the following site:
  http://forum.java.sun.com/thread.jspa?threadID=638498
 
 Thank again for your help.
 
  Jason Bainbridge [EMAIL PROTECTED] wrote:
 
  On 6/22/05, Kam Lung Leung [EMAIL PROTECTED] wrote:
   Hi,
   
   I have a servlet, RenameFile, that receives audio file via HTTP Post 
  
  I should have read your post better and realized there was no Java
  method for RenameFile as that is what I wrongly assumed... How exactly
  are you ceating the directories and trying to move the file?
  
  Are both servers running the same servlet and doing similar things?
  
  
  -- 
  Jason Bainbridge
  http://kde.org - [EMAIL PROTECTED]
  Personal Site - http://jasonbainbridge.com
  
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

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