You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Piroumian, Konstantin" <KP...@flagship.ru> on 2001/10/25 17:48:33 UTC

[C2] Installation problems

Hi, C2ers!

As I've written already, I faced a problem installing Cocoon 2.0rc1 on IONA
App server. The WAR archive is not unpacked when application is running and
this results in problems during servlet initialization, particularly:
this.servletContext.getRealPath("/") returns 'null'.

Is there a reason that cocoon.xconf and sitemap.xmap (root) are placed in
the context root directory and not inside of the WEB-INF/? And why not use
getResource() instead of using real path to files? If C2 is running from an
archive then the real path cannot be used to load files.

Anybody knows a workaround for such situation?

Best regards,

Konstantin Piroumian
Sr. Software developer

Protek Flagship LLC
Phone: + 7 095 795 0520 (add. 1288)
Fax: + 7 095 795 0525
E-mail: kpiroumian@flagship.ru
http://www.protek.com






---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2] Installation problems

Posted by giacomo <gi...@apache.org>.
On Sat, 27 Oct 2001, Stefano Mazzocchi wrote:

> "Piroumian, Konstantin" wrote:
> >
> > Hi, C2ers!
> >
> > As I've written already, I faced a problem installing Cocoon 2.0rc1 on IONA
> > App server. The WAR archive is not unpacked when application is running and
> > this results in problems during servlet initialization, particularly:
> > this.servletContext.getRealPath("/") returns 'null'.
>
> Oh, gosh, didn't notice this in code but using getRealPath is wrong and
> should almost never be used!! (I once proposed to the Servlet JSR to
> deprecate all instances of that method, but it was rejected).
>
> getResource() is always the way to go since it allows the container to
> abstact the location of the resource even in environments were the
> webapps may be distributed in a load-balanced environment.
>
> Please, people, don't assume we will be running in a nice and simple
> tomcat container or the entire reason to make Cocoon a servlet API will
> fail.
>
> > Is there a reason that cocoon.xconf and sitemap.xmap (root) are placed in
> > the context root directory and not inside of the WEB-INF/?
>
> I agree that cocoon.xconf should be placed under WEB-INF. I propose to
> make that the default location, but as for sitemaps, I think the sitemap
> should be placed there since it's not a configuration but part of the
> resources Cocoon uses to operate.
>
> > And why not use getResource() instead of using real path to files?
>
> Yes, exactly.
>
> > If C2 is running from an
> > archive then the real path cannot be used to load files.
>
> And there are a ton of other cases.
>
> Also, it is wrong for a webapp to update something inside its resource
> space (as we do with cocoon.log files). The "work" directories for
> webapps were created exactly for this.
>
> Also, it should be possible for cocoon to log on the servlet log and not
> on external files in order to automate log processing (some people might
> have a syslog-connected servlet container and might want to centralize
> log analysis there).

Cocoon logs on the servlet log automatically (at least wit the current
logkit management configuration) in case of log entries with priority
error and up. There is no problem changing the location of logfiles in
the logkit.xconf file.

Giacomo


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [C2] Installation problems

Posted by Stefano Mazzocchi <st...@apache.org>.
"Piroumian, Konstantin" wrote:
> 
> Hi, C2ers!
> 
> As I've written already, I faced a problem installing Cocoon 2.0rc1 on IONA
> App server. The WAR archive is not unpacked when application is running and
> this results in problems during servlet initialization, particularly:
> this.servletContext.getRealPath("/") returns 'null'.

Oh, gosh, didn't notice this in code but using getRealPath is wrong and
should almost never be used!! (I once proposed to the Servlet JSR to
deprecate all instances of that method, but it was rejected).

getResource() is always the way to go since it allows the container to
abstact the location of the resource even in environments were the
webapps may be distributed in a load-balanced environment.

Please, people, don't assume we will be running in a nice and simple
tomcat container or the entire reason to make Cocoon a servlet API will
fail.

> Is there a reason that cocoon.xconf and sitemap.xmap (root) are placed in
> the context root directory and not inside of the WEB-INF/?

I agree that cocoon.xconf should be placed under WEB-INF. I propose to
make that the default location, but as for sitemaps, I think the sitemap
should be placed there since it's not a configuration but part of the
resources Cocoon uses to operate.

> And why not use getResource() instead of using real path to files?

Yes, exactly.

> If C2 is running from an
> archive then the real path cannot be used to load files.

And there are a ton of other cases.
 
Also, it is wrong for a webapp to update something inside its resource
space (as we do with cocoon.log files). The "work" directories for
webapps were created exactly for this.

Also, it should be possible for cocoon to log on the servlet log and not
on external files in order to automate log processing (some people might
have a syslog-connected servlet container and might want to centralize
log analysis there).

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org