[XQZone General] xq tags and PDF document
Ron Hitchens
ron.hitchens at marklogic.com
Thu Aug 3 18:49:51 PDT 2006
I took a look at the source code for the JSP
tag library (http://xqzone.marklogic.com/svn/jsp/trunk/).
The cause of this exception is that your XQuery
evaluates to a binary() node (the PDF file). Sadly,
there doesn't seem to be a workaround for this in the
current version of the tag library.
The JSP tag library was written back before MarkLogic
Server supported binary() and there was a presumption
that all query results could be represented as text. This
exception is resulting because attempting to get a text
reader of the binary() node results in a null pointer.
The tag library could be smartened up to recognize
and pass through a binary() node (though you couldn't
use the simple form below, which does "asString()").
I don't have the bandwidth to update it now. But
it's open source and you (or someone else) could take
a crack at it. I'd be happy to advise if you want to
give it a try.
On Aug 2, 2006, at 12:43 PM, Ashish Joshi wrote:
>
>
> I loaded a PDF document in the Mark Logic Server. I can see the
> PDF file using the use-cases server as PDF document. When I try to
> access the document in the xq tags I run into error.
>
>
>
>
>
> <xq:execute>
> <xq:query>
> doc("c:\temp\a.pdf")
> </xq:query>
> </xq:execute>
>
>
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that
> prevented it from fulfilling this request.
>
> exception
>
> org.apache.jasper.JasperException
> org.apache.jasper.servlet.JspServletWrapper.service
> (JspServletWrapper.java:372)
> org.apache.jasper.servlet.JspServlet.serviceJspFile
> (JspServlet.java:292)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
> root cause
>
> java.lang.NullPointerException
> com.marklogic.xqrunner.xdbc.XdbcResultItem.writeTo
> (XdbcResultItem.java:216)
> com.marklogic.xqrunner.xdbc.XdbcResult.writeTo(XdbcResult.java:250)
> com.marklogic.jsptaglib.xquery.rt.ExecuteTag.outputResult
> (ExecuteTag.java:243)
> com.marklogic.jsptaglib.xquery.rt.ExecuteTag.doEndTag
> (ExecuteTag.java:218)
> org.apache.jsp.tutorial.example6_jsp._jspx_meth_xq_execute_0
> (example6_jsp.java:144)
> org.apache.jsp.tutorial.example6_jsp._jspService(example6_jsp.java:
> 75)
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> org.apache.jasper.servlet.JspServletWrapper.service
> (JspServletWrapper.java:324)
> org.apache.jasper.servlet.JspServlet.serviceJspFile
> (JspServlet.java:292)
> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>
>
> note The full stack trace of the root cause is available in the
> Apache Tomcat/5.0.28 logs.
>
> Thanks,
>
> --Ashish
>
>
> _______________________________________________
> General mailing list
> General at xqzone.marklogic.com
> http://xqzone.com/mailman/listinfo/general
---
Ron Hitchens {ron.hitchens at marklogic.com} 650-655-2351
More information about the General
mailing list