]
Steven Hawkins commented on TEIID-5610:
---------------------------------------
Actually this is similar to an issue with OData xml generation. Unfortunately 0xb cannot
be represented in xml. Only the printable control characters below 0x20 are allowed. A
character reference, such as , is still invalid. For our generation OData
there is setting to replace any such characters, so there would need to be something like
that here.
The ideal fix is to introduce more native json extraction logic - but there is no spec to
follow there. We'd probably want to emulate pg logic, but overall is quite a lot of
work. We could perhaps just introduce json_extract_path - would that work for you, or do
you need the full power of a path language available to xmltable?
XML parsing from web service error (TEIID30151)
-----------------------------------------------
Key: TEIID-5610
URL:
https://issues.jboss.org/browse/TEIID-5610
Project: Teiid
Issue Type: Bug
Components: VDB
Affects Versions: 10.2
Environment: Create teiid VDB containing 1 Oracle source and 1 REST service
source. Define REST service like this:
CREATE VIRTUAL PROCEDURE WS_PROCEDURE(SEARCH_INPUT varchar) RETURNS (
FILE_ID varchar,
FILE_NAME string
)
AS
SELECT
A.FILE_ID, A.FILE_NAME
FROM
(
EXEC MY_WS.INVOKEHTTP(
...
)
) AS F,
XMLTABLE(
'/myxml/response/docs' PASSING JSONTOXML('myxml', F.RESULT) COLUMNS
FILE_ID string PATH 'fileid',
FILE_NAME string PATH 'filename'
)
AS A;
CREATE VIEW WS_VIEW AS SELECT * FROM REST_WS.WS_PROCEDURE;
Reporter: Andreas Krück
Assignee: Steven Hawkins
Priority: Major
After TEIID-5294 has been fixed, we are still facing issues after an update to v10.2.
Error message "TEIID30151 Error building Source for context item" when calling
SQL statement on VDB connected to REST service:
09:15:44,117 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2475) Request
Thread Fk5ykF/8Bdl6.15 - processor blocked
09:15:44,539 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2478) Request
Thread Ri4uuB5w1vOK.35 with state PROCESSING
09:15:44,539 DEBUG [org.teiid.PROCESSOR] (Worker6_QueryProcessorQueue2479) Using stream
processing for evaluation of /myxml/response/docs
09:15:44,555 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2478)
QueryProcessor: closing processor
09:15:44,555 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2478)
QueryProcessor: closing processor
09:15:44,555 DEBUG [org.teiid.PROCESSOR] (Worker6_QueryProcessorQueue2480) Running task
for parent thread Worker15_QueryProcessorQueue2478
09:15:44,555 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2478) Request
Thread Ri4uuB5w1vOK.35 - processor blocked
09:15:45,211 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2481) Request
Thread Fk5ykF/8Bdl6.15 with state PROCESSING
09:15:45,211 DEBUG [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue2482) Using stream
processing for evaluation of /myxml/response/docs
09:15:45,211 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2481)
QueryProcessor: closing processor
09:15:45,211 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2481) Created
intermediate sort buffer 1570
09:15:45,211 DEBUG [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue2483) Running task
for parent thread Worker15_QueryProcessorQueue2481
09:15:45,211 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2481) Request
Thread Fk5ykF/8Bdl6.15 - processor blocked
09:15:45,367 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484) Request
Thread Fk5ykF/8Bdl6.15 with state PROCESSING
09:15:45,367 DEBUG [org.teiid.PROCESSOR] (Worker2_QueryProcessorQueue2485) Using stream
processing for evaluation of /myxml/response
09:15:45,367 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484)
QueryProcessor: closing processor
09:15:45,367 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484)
QueryProcessor: closing processor
09:15:45,367 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484)
QueryProcessor: closing processor
09:15:45,383 WARN [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484) TEIID30020
Processing exception for request Fk5ykF/8Bdl6.15 'TEIID30151 Error building Source for
context item.'. Originally TeiidProcessingException '0xb is not allowed in XML
content' nu.xom.Verifier.throwIllegalCharacterDataException(Unknown Source).:
org.teiid.core.TeiidProcessingException: TEIID30151 Error building Source for context
item.
at org.teiid.query.xquery.saxon.XQueryEvaluator.evaluateXQuery(XQueryEvaluator.java:174)
at org.teiid.query.processor.relational.XMLTableNode$1.run(XMLTableNode.java:266)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:277)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: nu.xom.ParsingException: 0xb is not allowed in XML content
at nu.xom.Builder.build(Unknown Source)
at nu.xom.Builder.build(Unknown Source)
at org.teiid.query.xquery.saxon.XQueryEvaluator.evaluateXQuery(XQueryEvaluator.java:168)
... 7 more
Caused by: nu.xom.IllegalCharacterDataException: 0xb is not allowed in XML content
at nu.xom.Verifier.throwIllegalCharacterDataException(Unknown Source)
at nu.xom.Verifier.checkPCDATA(Unknown Source)
at nu.xom.Text._setValue(Unknown Source)
at nu.xom.Text.<init>(Unknown Source)
at nu.xom.NodeFactory.makeText(Unknown Source)
at nux.xom.pool.XOMUtil$1.makeText(XOMUtil.java:92)
at
nux.xom.xquery.StreamingPathFilter$StreamingPathFilterNodeFactory.makeText(StreamingPathFilter.java:492)
at nu.xom.XOMHandler.flushText(Unknown Source)
at nu.xom.XOMHandler.endElement(Unknown Source)
at net.sf.saxon.event.ContentHandlerProxy.endElement(ContentHandlerProxy.java:414)
at
org.teiid.query.xquery.saxon.ContentHandlerProxyReceiver.endElement(StreamingUtils.java:258)
at net.sf.saxon.event.ProxyReceiver.endElement(ProxyReceiver.java:182)
at org.teiid.query.xquery.saxon.PathMapFilter.endElement(PathMapFilter.java:219)
at net.sf.saxon.pull.PullPushTee.copyEvent(PullPushTee.java:134)
at net.sf.saxon.pull.PullPushTee.next(PullPushTee.java:72)
at net.sf.saxon.pull.PullConsumer.consume(PullConsumer.java:42)
at net.sf.saxon.pull.PullPushCopier.copy(PullPushCopier.java:44)
at net.sf.saxon.event.Sender.sendPullSource(Sender.java:520)
at net.sf.saxon.event.Sender.send(Sender.java:182)
at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:4032)
at net.sf.saxon.Configuration.buildDocumentTree(Configuration.java:3970)
at org.teiid.query.xquery.saxon.SaxonReader.parse(StreamingUtils.java:176)
... 10 more
09:15:45,383 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484) Removing
tuplesource for the request Fk5ykF/8Bdl6.15
09:15:45,383 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484)
Fk5ykF/8Bdl6.15 Finished Processing
09:15:45,383 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2484)
org.teiid.core.TeiidProcessingException: TEIID30151 Error building Source for context
item. Sending error to client Fk5ykF/8Bdl6.15
09:15:45,430 DEBUG [org.teiid.PROCESSOR] (NIO6) closeQuery for requestID=Fk5ykF/8Bdl6.13
09:15:45,430 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2486) Request
Thread Fk5ykF/8Bdl6.13 with state CLOSE
09:15:45,430 DEBUG [org.teiid.PROCESSOR] (Worker15_QueryProcessorQueue2486) Removing
tuplesource for the request Fk5ykF/8Bdl6.13
09:15:45,430 DEBUG [org.teiid.PROCESSOR] (NIO6) closeQuery for requestID=Fk5ykF/8Bdl6.14