You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-dev@incubator.apache.org by Siarhei Berdachuk <be...@gmail.com> on 2006/11/16 22:37:54 UTC

Problems running Trinidad in Tomcat with file permission restrictions for writing

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 like trinidad components, but can not use them on my hosting for new 
projects :(
May be somebody have solution for how resolve this problem.

Thank you,
Siarhei Berdachuk
http://www.berdaflex.com


Re: Problems running Trinidad in Tomcat with file permission restrictions for writing

Posted by Adam Winer <aw...@gmail.com>.
Craig,

IIRC, Trinidad is in fact writing to exactly those temporary
directories already, as per the servlet spec.  And using
our ResourceServlet to pull from those directories.  The
issue isn't that - it's that GoDaddy is refusing to allow
any File writing, even into those legit temporary directories.
Which is lame of them.  But likely impossible to change.

What Trinidad should do is store that .css file into memory,
instead of the file system.  We used to store a bunch of
generated images on the file system, so using memory
for all would be quite a pain, but that isn't the case anymore.
It'd be a bit slower at startup - when restarting the server, you have
to regenerate the file - but for that matter, we have bugs caused
by failing to regenerate the .css file in some circumstances.

-- Adam




-- Adam


On 11/20/06, Craig McClanahan <cr...@apache.org> wrote:
>
> On 11/16/06, Siarhei Berdachuk <be...@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
>
>

Re: Problems running Trinidad in Tomcat with file permission restrictions for writing

Posted by Craig McClanahan <cr...@apache.org>.
On 11/16/06, Siarhei Berdachuk <be...@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

Re: Problems running Trinidad in Tomcat with file permission restrictions for writing

Posted by Siarhei Berdachuk <be...@gmail.com>.
Hello Simon


> Hello,
>
> My guess would be with the skin engine. Trinidad generates the final CSS
> file at runtime. I cannot think of a fix for that if that's the issue, 
> maybe
> you could open a specific folder for Java writing access?
>
>
> ~ Simon
>

Seems, that it is impossible. I checked godaddy's support help and can 
not find possibility for changing write access to specific folder.

There is other article with detailed description for using this hosting 
for J2EE applications:
http://www.oisv.com/articles/development/gojava_lessons_on_writing_java_applications_for_godaddy_shared_hosting
Sorry, but I have not permission to reproduce this article in public area :(
You have to register to OISV before reading it (it is free and there are 
a lot of interesting materials)

Thank you,
  Siarhei Berdachuk
  berdachuk@berdaflex.com
  http://www.berdaflex.com




Re: Problems running Trinidad in Tomcat with file permission restrictions for writing

Posted by Simon Lessard <si...@gmail.com>.
Hello,

My guess would be with the skin engine. Trinidad generates the final CSS
file at runtime. I cannot think of a fix for that if that's the issue, maybe
you could open a specific folder for Java writing access?


~ Simon

On 11/20/06, Siarhei Berdachuk <be...@gmail.com> wrote:
>
> Hi Stefan
>
> > Without an actual error message its really hard to tell what could
> > solve the described issue. You have a stacktrace or something? "doesnt
> > work" is not enough.
>
> I'.m created trinidad demo build from source code 2006.11.19
> and deployed this demo to:
> http://www.berdaflex.com/trinidad_demo/faces/index.jspx
>
> When I open this page I see index.jspx, but without CSS.
> After pushing any link on this page I got only one error in log file:
> [Mon Nov 20 14:43:51 2006] [error] [client 87.252.229.237] File does not
> exist:
>
> /var/chroot/home/content/b/e/r/berdachuk/html/trinidad_demo/adf/jsLibs/Common11-
> m7.js
>
> I'm tryed deploy this demo on local Tomcat 5.0.28 (Windows XP)
> and it is works fine.
>
> I hope, that this can help resolve problem.
>
> Thank you,
>   Siarhei Berdachuk
>
>

Re: Problems running Trinidad in Tomcat with file permission restrictions for writing

Posted by Siarhei Berdachuk <be...@gmail.com>.
Hi Stefan

> Without an actual error message its really hard to tell what could
> solve the described issue. You have a stacktrace or something? "doesnt
> work" is not enough.

I'.m created trinidad demo build from source code 2006.11.19
and deployed this demo to:
http://www.berdaflex.com/trinidad_demo/faces/index.jspx

When I open this page I see index.jspx, but without CSS.
After pushing any link on this page I got only one error in log file:
[Mon Nov 20 14:43:51 2006] [error] [client 87.252.229.237] File does not 
exist: 
/var/chroot/home/content/b/e/r/berdachuk/html/trinidad_demo/adf/jsLibs/Common11-m7.js

I'm tryed deploy this demo on local Tomcat 5.0.28 (Windows XP)
and it is works fine.

I hope, that this can help resolve problem.

Thank you,
  Siarhei Berdachuk


Re: Problems running Trinidad in Tomcat with file permission restrictions for writing

Posted by Stefan Podkowinski <sp...@gmail.com>.
Hello Siarhei --

Without an actual error message its really hard to tell what could
solve the described issue. You have a stacktrace or something? "doesnt
work" is not enough.

On 11/16/06, Siarhei Berdachuk <be...@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 like trinidad components, but can not use them on my hosting for new
> projects :(
> May be somebody have solution for how resolve this problem.
>
> Thank you,
> Siarhei Berdachuk
> http://www.berdaflex.com
>
>
>