Hi,

I would guess that there is a security policy in JBoss that prevents JBoss (and its integrated Tomcat) from writing outside some special directories (e.g. its working directory and the temp directory). There is surely a way to lessen this security restriction, but that is obviously a JBoss question. You should ask for more help in a JBoss forum/mailing list (or probably just reading the JBoss configuration documentation would help, too)


Christoph

Kam Lung Leung wrote:
Hi Jason,

Thank you for the information. It is a long paragraph. I checked the /SomeDirectory again, and it is the same name. I was able to create directory with the mkdir -p /SomeDirectory/firstSubdirectory/secondSubdirectory and manually created a file by this command "touch /SomeDirectory/firstSubdirectory/secondSubdirectory/newFile" . The Servlet was able to create directories under the /SomeDirectory directory. For example, the Servlet was able to create /SomeDirectory/firstSubdirectory/secondSubdirectory directories. But the Servlet can’t rename the file named oldFile under the /tmp directory to /SomeDirectory/firstSubdirectory/secondSubdirectory/newFile. The Servlet did created all directories under the /SomeDirectory by not able to move the oldFile to the that directory. The same code work fines what it run without the Jboss running in the same server.

Kam





---- Jason Bainbridge <[EMAIL PROTECTED]> wrote:

On 6/21/05, Kam Lung Leung <[EMAIL PROTECTED]> wrote:

Hi,

I have a servlet, Servlet-A, that rename a file from /tmp/oldFile to 
/someDirectory/newFile. The Servlet-A runs fine when it runs by itself in a Red Hat Linux 
7.2 server that has jakarta-tomcat-4.1.30 running. However, it false to rename the 
/tmp/oldFile to /someDirectory/newFile when the Servlet-A run (within the 
jakarta-tomcat-4.1.30) in a Red Hat Linux 7.2 server box that also has 
jboss-3.2.1_tomcat-4.1.24 running. I thought it may be privilege issue so I set the 
/someDirectory directory with "chmod –R 777" and run Tomcat as a root user. 
But, it is still false to rename the /tmp/oldFile file to the /someDirectory/newFile.

The strange thing is that the Servlet-A was able to write the oldFile to the 
/tmp directory but can not rename the oldFile to the /someDirectory directory 
that was allowed for writing for ALL user levels. Can this be Jboss prevented 
the rename operation. I used the canRead and canWrite to check allowable action 
by the File. It turns out that the Servlet-A can read and write the /tmp/ 
oldFile. But the Servlet-A can't read or write the /someDirectory/newFile.

The strangest thing is that when the Servlet-A runs in a Red Hat Linux 7.2 
server that has ONLY jakarta-tomcat-4.1.30 running, the condition of canRead 
and canwrite are the same. Meaning that the Servlet-A was able to read, and 
write the oldFile. But can't read, and write the newFile. However, the 
renameTo() method returned true and the Servlet-A was able to rename the 
/tmp/oldFile into /someDirectory/newFile.

It took me a few reads to even come close to following all that but is
it possibly that you are trying to copy a subdirectory within /tmp to
a subdirectory of /someDirectory that doesn't exist?


--
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]

Reply via email to