You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Dafang Zhang <da...@wcom.com> on 2001/02/15 22:01:32 UTC
C1.8.2 XInclude Processor failed on URL, but fine with local file uri
Hi,
I'm using XInclude processor in either xsp page or non-xsp xml:
1. Fine with file uri, even relative path:
<xinclude:include xinclude:parse="xml"
xinclude:href="../../../usr/bar/foo.xml"/>
2. Failed on a URL (it _IS_ a valid url):
<xinclude:include xinclude:parse="xml"
xinclude:href="http://hostname/foo.xml"/>
After tracking down to the source code, the included_document variable in
line 396 is null:
line 396: result =
document.importNode(included_document.getDocumentElement(),true);
java.lang.NullPointerException
at
org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludeProcessorWork
er.processXIncludeElement(XIncludeProcessor.java:396)
at
org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludeProcessorWork
er.process(XIncludeProcessor.java:227)
at
org.apache.cocoon.processor.xinclude.XIncludeProcessor.process(XIncludeProce
ssor.java:139)
at org.apache.cocoon.Engine.handle(Engine.java:384)
at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.livesoftware.jrun.JRun.runServlet(JRun.java:321)
at com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric.java:116)
at
com.livesoftware.jrun.service.web.JRunWebServiceHandler.handleOutput(JRunWeb
ServiceHandler.java:266)
at
com.livesoftware.jrun.service.web.JRunWebServiceHandler.handleRequest(JRunWe
bServiceHandler.java:234)
at
com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadConfigHandler.ja
va:96)
Thanks.
Dafang
RE: C1.8.2 XInclude Processor failed on URL,
but fine with local file uri
Posted by Dafang Zhang <da...@wcom.com>.
Hi,
Never mind. I found the reason myself.
For those interested, here is the reason -- the url (http://host/foo.xml)
provided in xinclude:href is under the same webserver, therefore, it's
handled by cocoon. The output from cocoon is not a XML doc, since there's
no any stylesheet attached to the foo.xml. This causes
XIncludeProcessor.java
line 384: included_document = parser.parse(input, false);
to be null.
After I put the foo.xml in another not _cocoonized_ web site, everything
went just perfect. :)
By the way, the similar thing happens when using util:include-uri.
Cheers.
Dafang
> -----Original Message-----
> From: Dafang Zhang [mailto:dafang.zhang@wcom.com]
> Sent: Thursday, February 15, 2001 3:02 PM
> To: cocoon-users@xml.apache.org
> Subject: C1.8.2 XInclude Processor failed on URL, but fine with local
> file uri
>
>
> Hi,
>
> I'm using XInclude processor in either xsp page or non-xsp xml:
>
> 1. Fine with file uri, even relative path:
> <xinclude:include xinclude:parse="xml"
> xinclude:href="../../../usr/bar/foo.xml"/>
>
> 2. Failed on a URL (it _IS_ a valid url):
> <xinclude:include xinclude:parse="xml"
> xinclude:href="http://hostname/foo.xml"/>
>
> After tracking down to the source code, the included_document
> variable in
> line 396 is null:
>
> line 396: result =
> document.importNode(included_document.getDocumentElement(),true);
>
> java.lang.NullPointerException
> at
> org.apache.cocoon.processor.xinclude.XIncludeProcessor$XInclud
eProcessorWork
> er.processXIncludeElement(XIncludeProcessor.java:396)
> at
> org.apache.cocoon.processor.xinclude.XIncludeProcessor$XInclud
eProcessorWork
> er.process(XIncludeProcessor.java:227)
> at
> org.apache.cocoon.processor.xinclude.XIncludeProcessor.process
> (XIncludeProce
> ssor.java:139)
> at org.apache.cocoon.Engine.handle(Engine.java:384)
> at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
> at com.livesoftware.jrun.JRun.runServlet(JRun.java:321)
> at
> com.livesoftware.jrun.JRunGeneric.handleConnection(JRunGeneric
.java:116)
> at
> com.livesoftware.jrun.service.web.JRunWebServiceHandler.handle
> Output(JRunWeb
> ServiceHandler.java:266)
> at
> com.livesoftware.jrun.service.web.JRunWebServiceHandler.handle
> Request(JRunWe
> bServiceHandler.java:234)
> at
> com.livesoftware.jrun.service.ThreadConfigHandler.run(ThreadCo
nfigHandler.ja
> va:96)
>
>
> Thanks.
> Dafang
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>