You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Rick Tessner <ri...@apache.org> on 2004/11/12 22:06:05 UTC

[cli] Problem / Question with context directory needing to be writable

Hi all,

Over in the Forrest world, we've stumbled across an issue with the 
Cocoon CLI. It appears that the CLI requires that the context directory 
(--contextDir option to the cocoon cli) be writable by the CLI process.
For reference, see http://issues.cocoondev.org//browse/FOR-356

The Use Case
------------
This applies to any Cocoon CLI based application that can be run as a 
servlet as well.  I'll just use Forrest as the example case.

Forrest is installed on a multiuser system with the intent that multiple 
users will be running the application.

The Problem
-----------
User runs "forrest run" which runs Forrest in a local servlet container 
(jetty) as a live application.  This works just fine.

User runs "forrest site" which uses the Cocoon CLI and is presented with 
a Cocoon error about the context directory not being readable/writable. 
  The context directory is certainly readable.  It is not writable tho.

The stack-trace is as follows:
ERROR   2004-11-11 18:32:20.353 [        ] (): Directory '.' is not 
readable/writable
Exception in thread "main" java.io.IOException: Directory '.' is not
readable/writable
         at
org.apache.cocoon.bean.CocoonWrapper.getDir(CocoonWrapper.java:253)
         at
org.apache.cocoon.bean.CocoonWrapper.initialize(CocoonWrapper.java:106)
         at
org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:98)
at org.apache.cocoon.Main.main(Main.java:320)

The Question
------------
Since the local servlet instance works fine with the context directory 
being non-writable, I'm wondering if there is some requirement that the 
context directory is writable when running the Cocoon CLI?

If the answer is "no, there is no requirement that the context directory 
is writable by the Cocoon CLI", I'll open an issue in bugzilla and 
provide a patch.  (I'm hoping this is the case since making the context 
directory for Cocoon writable to all users doesn't leave me with a warm 
fuzzy feeling. :)

-- 
Rick Tessner
rick@apache.org

Re: [cli] Problem / Question with context directory needing to be writable

Posted by Rick Tessner <ri...@apache.org>.
Upayavira wrote:
> Says:
> 
> if (!(d.canRead() && d.canWrite())) {
>            log.error("Directory '" + d + "' is not readable/writable");
>            throw new IOException("Directory '" + d + "' is not 
> readable/writable");
>        }
> 
> Hmm. This has been in the CLI since Cocoon 2.0. I've no idea why it is 
> there. Assuming that everything still works after removing the 
> d.canWrite(), I'm quite happy with it being removed.

Patch for this can be found in bugzilla:

   http://issues.apache.org/bugzilla/show_bug.cgi?id=32214

-- 
Rick Tessner
rick@apache.org

RE: [cli] Problem / Question with context directory needing to be writable

Posted by Carsten Ziegeler <cz...@apache.org>.
David Crossley wrote: 
> 
> Sylvain Wallez wrote:
> > Upayavira wrote:
> > 
> >> Says:
> >>
> >> if (!(d.canRead() && d.canWrite())) {
> >>            log.error("Directory '" + d + "' is not 
> readable/writable");
> >>            throw new IOException("Directory '" + d + "' is not 
> >> readable/writable");
> >>        }
> >>
> >> Hmm. This has been in the CLI since Cocoon 2.0. I've no 
> idea why it 
> >> is there. Assuming that everything still works after removing the 
> >> d.canWrite(), I'm quite happy with it being removed.
> > 
> > +1.
> > 
> > If Carsten agrees, it would be good for this bug fix to go 
> in 2.1.6 so 
> > that Forrest can close the issue with a released version of Cocoon.
> 
> Forrest uses cocoon-2.2 at the moment, so no need to do it 
> solely for us.
> 
If it is a bug fix, let's apply it for the release.

Carsten


Re: [cli] Problem / Question with context directory needing to be writable

Posted by David Crossley <cr...@apache.org>.
Sylvain Wallez wrote:
> Upayavira wrote:
> 
>> Says:
>>
>> if (!(d.canRead() && d.canWrite())) {
>>            log.error("Directory '" + d + "' is not readable/writable");
>>            throw new IOException("Directory '" + d + "' is not 
>> readable/writable");
>>        }
>>
>> Hmm. This has been in the CLI since Cocoon 2.0. I've no idea why it is 
>> there. Assuming that everything still works after removing the 
>> d.canWrite(), I'm quite happy with it being removed.
> 
> +1.
> 
> If Carsten agrees, it would be good for this bug fix to go in 2.1.6 so 
> that Forrest can close the issue with a released version of Cocoon.

Forrest uses cocoon-2.2 at the moment, so no need to
do it solely for us.

--David


Re: [cli] Problem / Question with context directory needing to be writable

Posted by Sylvain Wallez <sy...@apache.org>.
Upayavira wrote:

> Says:
>
> if (!(d.canRead() && d.canWrite())) {
>            log.error("Directory '" + d + "' is not readable/writable");
>            throw new IOException("Directory '" + d + "' is not 
> readable/writable");
>        }
>
> Hmm. This has been in the CLI since Cocoon 2.0. I've no idea why it is 
> there. Assuming that everything still works after removing the 
> d.canWrite(), I'm quite happy with it being removed.


+1.

If Carsten agrees, it would be good for this bug fix to go in 2.1.6 so 
that Forrest can close the issue with a released version of Cocoon.

Sylvain


> Rick Tessner wrote:
>
>>  Hi all,
>>
>>  Over in the Forrest world, we've stumbled across an issue with the
>>  Cocoon CLI. It appears that the CLI requires that the context
>>  directory (--contextDir option to the cocoon cli) be writable by the
>>  CLI process. For reference, see
>>  http://issues.cocoondev.org//browse/FOR-356
>>
>>  The Use Case ------------ This applies to any Cocoon CLI based
>>  application that can be run as a servlet as well. I'll just use
>>  Forrest as the example case.
>>
>>  Forrest is installed on a multiuser system with the intent that
>>  multiple users will be running the application.
>>
>>  The Problem ----------- User runs "forrest run" which runs Forrest in
>>  a local servlet container (jetty) as a live application. This works
>>  just fine.
>>
>>  User runs "forrest site" which uses the Cocoon CLI and is presented
>>  with a Cocoon error about the context directory not being
>>  readable/writable. The context directory is certainly readable. It
>>  is not writable tho.
>>
>>  The stack-trace is as follows: ERROR 2004-11-11 18:32:20.353 [
>>  ] (): Directory '.' is not readable/writable Exception in thread
>>  "main" java.io.IOException: Directory '.' is not readable/writable at
>>  org.apache.cocoon.bean.CocoonWrapper.getDir(CocoonWrapper.java:253)
>>  at
>>  org.apache.cocoon.bean.CocoonWrapper.initialize(CocoonWrapper.java:106)
>>  at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:98)
>>  at org.apache.cocoon.Main.main(Main.java:320)
>>
>>  The Question ------------ Since the local servlet instance works fine
>>  with the context directory being non-writable, I'm wondering if there
>>  is some requirement that the context directory is writable when
>>  running the Cocoon CLI?
>>
>>  If the answer is "no, there is no requirement that the context
>>  directory is writable by the Cocoon CLI", I'll open an issue in
>>  bugzilla and provide a patch. (I'm hoping this is the case since
>>  making the context directory for Cocoon writable to all users doesn't
>>  leave me with a warm fuzzy feeling. :)
>
-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: [cli] Problem / Question with context directory needing to be writable

Posted by Upayavira <uv...@upaya.co.uk>.
Says:

if (!(d.canRead() && d.canWrite())) {
            log.error("Directory '" + d + "' is not readable/writable");
            throw new IOException("Directory '" + d + "' is not 
readable/writable");
        }

Hmm. This has been in the CLI since Cocoon 2.0. I've no idea why it is 
there. Assuming that everything still works after removing the 
d.canWrite(), I'm quite happy with it being removed.

Regards, Upayavira

Rick Tessner wrote:

>  Hi all,
>
>  Over in the Forrest world, we've stumbled across an issue with the
>  Cocoon CLI. It appears that the CLI requires that the context
>  directory (--contextDir option to the cocoon cli) be writable by the
>  CLI process. For reference, see
>  http://issues.cocoondev.org//browse/FOR-356
>
>  The Use Case ------------ This applies to any Cocoon CLI based
>  application that can be run as a servlet as well. I'll just use
>  Forrest as the example case.
>
>  Forrest is installed on a multiuser system with the intent that
>  multiple users will be running the application.
>
>  The Problem ----------- User runs "forrest run" which runs Forrest in
>  a local servlet container (jetty) as a live application. This works
>  just fine.
>
>  User runs "forrest site" which uses the Cocoon CLI and is presented
>  with a Cocoon error about the context directory not being
>  readable/writable. The context directory is certainly readable. It
>  is not writable tho.
>
>  The stack-trace is as follows: ERROR 2004-11-11 18:32:20.353 [
>  ] (): Directory '.' is not readable/writable Exception in thread
>  "main" java.io.IOException: Directory '.' is not readable/writable at
>  org.apache.cocoon.bean.CocoonWrapper.getDir(CocoonWrapper.java:253)
>  at
>  org.apache.cocoon.bean.CocoonWrapper.initialize(CocoonWrapper.java:106)
>  at org.apache.cocoon.bean.CocoonBean.initialize(CocoonBean.java:98)
>  at org.apache.cocoon.Main.main(Main.java:320)
>
>  The Question ------------ Since the local servlet instance works fine
>  with the context directory being non-writable, I'm wondering if there
>  is some requirement that the context directory is writable when
>  running the Cocoon CLI?
>
>  If the answer is "no, there is no requirement that the context
>  directory is writable by the Cocoon CLI", I'll open an issue in
>  bugzilla and provide a patch. (I'm hoping this is the case since
>  making the context directory for Cocoon writable to all users doesn't
>  leave me with a warm fuzzy feeling. :)
>