cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shenoy, nitin" <nshe...@telegea.com>
Subject RE: ServletConfig.getRealPath
Date Tue, 29 Jan 2002 15:10:30 GMT
<snip>

Piroumian wrote

Why do you need to access jars in /lib directly? Any servlet container has
to provide access to jars in WEB-INF/lib and there is no need to access them
directly. 

</snip>

Yes. I dont need to access them directly and I do understand the servlet
container provides access to those files. CocoonServlet tries to build a
classpath. org.apache.cocoon.components.language.CompiledProgrammingLanguage
(and its super classes) use this classpath to compile the auto-generated
code for sitemap.

The way CocoonServlet tries to build the classpath is by using
SeveltContext.getResource which gives a URL to the resource. But, that URL
is of zip: protocol under Weblogic wereas under Tomcat, the same URL is of
file: format. Therefore, cocoon works in war format under Tomcat but not
under Weblogic (and Silverstream).

<snip>

Piroumian wrote

Does Cocoon use a special classloader? If yes - then the problem is in it.

</snip>

No, the classloader can be changed to use the standard classloader (which I
did) and everything still works. 

Cocoon in a war format fails when sitemap is being compiled because the
compiler user -classpath option and the classpath cannot be constructed for
files in a war format.

Regards,
Nitin

-----Original Message-----
From: Piroumian, Konstantin [mailto:KPiroumian@flagship.ru]
Sent: Tuesday, January 29, 2002 3:01 AM
To: cocoon-dev@xml.apache.org
Subject: Re: ServletConfig.getRealPath


> After spending quite some time trying to get rid of getRealPath (or work
> around it), I came across these problems.
>
> 1) In war format, under Weblogic 6.1, library jars under WEB-INF/lib arent
> accessible directly the file system. The URI to a war file is similar to
>
zip:D:/bea/wlserver6.1/config/mydomain/applications/.wlnotdelete/wl_comp5101
> 8.war!/

Why do you need to access jars in /lib directly? Any servlet container has
to provide access to jars in WEB-INF/lib and there is no need to access them
directly.

>
> That doesnt help much because only Weblogic knows how to interpret its
> implementation of the zip: URI.

It doesn't violate the specification. To get direct access to webapp
resources you should use getResource() and getResourceAsStream() which will
hide all the implementation details, such as the access protocol or so.

>
> 2) Creation of Sitemap fails because all the libraries are in the war file
> and inaccessible (atleast via File API).

Does Cocoon use a special classloader? If yes - then the problem is in it.

Regards,
   Konstantin Piroumian

>
> I am out of ideas w.r.t Cocooon working in a war file. Please advice.
>
> Nitin
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>

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

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


Mime
View raw message