atom feed7 messages in org.apache.incubator.adffaces-devRe: Problems running Trinidad in Tomc...
FromSent OnAttachments
Siarhei BerdachukNov 16, 2006 2:37 pm 
Stefan PodkowinskiNov 17, 2006 12:40 pm 
Siarhei BerdachukNov 20, 2006 1:53 pm 
Simon LessardNov 20, 2006 5:04 pm 
Craig McClanahanNov 20, 2006 5:18 pm 
Siarhei BerdachukNov 21, 2006 12:21 am 
Adam WinerNov 26, 2006 3:17 pm 
Subject:Re: Problems running Trinidad in Tomcat with file permission restrictions for writing
From:Craig McClanahan (crai@apache.org)
Date:Nov 20, 2006 5:18:53 pm
List:org.apache.incubator.adffaces-dev

On 11/16/06, Siarhei Berdachuk <berd@gmail.com> wrote:

Hello

I have same problems on the my web hosting (Godaddy). There is file permission restrictions for writing from java.

I'm build trinidad examples from sources, they works fine on my local host (Windows XP, Tomcat 5.0.28, j2sdk 1.5.0_7) but when I try deploy them to godaddy java enabled Linux hosting (Linux, Tomcat 5.0.27, 1.5.0_06-b05), this examples not works. Hosting server configuration: http://www.lostcd.com/jsp-examples/snp/sysinfo.jsp

Then I'm deployd Tomcat jsp examles there and they are works fine: http://www.lostcd.com/jsp-examples/index.html

I found article: http://www.oisv.com/articles/web_design/godaddy_gotchas/ where described about some file permission restrictions for writing and possible problem in Log4j. Part from it: "In retrospect, this is fairly obvious since all users on the shared server run under the same Java virtual machine instance. Tomcat and Java just do not have the fine-grained ability to assigned directory-based permissions in such as configuration."

I cannot see the above article without a login, but *if* GoDaddy is using the Java security manager to enforce restrictions (which certainly makes sense in a shared JVM environment), it is actually possible to be fine grained about file access permissions, but it is pretty tedious.

I like trinidad components, but can not use them on my hosting for new

projects :( May be somebody have solution for how resolve this problem.

I have not looked at the Trinidad source code yet, but one option (if it's not being done already) is for the file writing to be done into a temporary directory that the servlet spec requires be made available (and writable) to each individual webapp. Trinidad can get access to this as follows:

FacesContext context = FacesContext.getCurrentInstance(); File tempDirectory = (File) context.getExternalContext ().getApplicationMap().get ("javax.servlet.context.tempdir"); // tempDirectory is a java.io.File object representing a writable temporary directory // that the webapp can be used to create scratch files

It might still take some additional mechanisms to cause this file to ultimately be delivered to the client (since it's not in the webapp's resource space), but this should get the library around file write restrictions.

Thank you,

Siarhei Berdachuk http://www.berdaflex.com

Craig