You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Kam Lung Leung <kl...@advoicetech.com> on 2005/06/22 18:02:06 UTC

Better explained of my problem with renaming a file in Tomcat

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_200506222200_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_200506222200_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_200506222200_001.WAV
- file NOT renamed /alert_messages/2005/06/22/22/00/79_0_200506222200_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”;
drwxrwxrwx    3 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-x    2 tomcat   tomcat        4096 Jun 22 07:33 .
drwxr-xr-x    3 tomcat   tomcat        4096 Jun 22 07:33 ..

  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Jason Bainbridge <jb...@gmail.com>.
On 6/22/05, Kam Lung Leung <kl...@advoicetech.com> 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 - webmaster@kde.org
Personal Site - http://jasonbainbridge.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Kam Lung Leung <kl...@advoicetech.com>.
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     27391    444736   6% /tmp
/dev/sda7              1011928    217304    743220  23% /

Thank Jason for his help.

Kam

---- Kam Lung Leung <kl...@advoicetech.com> 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 <jb...@gmail.com> wrote:
> >
> > On 6/22/05, Kam Lung Leung <kl...@advoicetech.com> 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 - webmaster@kde.org
> > Personal Site - http://jasonbainbridge.com
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> > 
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


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

Posted by Kam Lung Leung <kl...@advoicetech.com>.
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 <jb...@gmail.com> wrote:
>
> On 6/22/05, Kam Lung Leung <kl...@advoicetech.com> 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 - webmaster@kde.org
> Personal Site - http://jasonbainbridge.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org