[
https://issues.apache.org/jira/browse/DERBY-3870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12630674#action_12630674
]
Aleksander Slominski commented on DERBY-3870:
---------------------------------------------
hi,
i was able to fix the problem :) i am attaching ZIP file that contains the fix
and simple test that can be built with ant after lib directory is created and
populated with derby / xerces/ xalan / serializer jars (see README.txt has
details).
> What JDK and XML parser are you using?
mostly JDK 1.5 and relatively new xerces/xalan version - i could not find
exactly which one by looking into jar file of xerces but xalan from MANIFEST.MF
is 2.7.1
i tested with db-derby-10.4.1.3-bin and db-derby-10.4.2.0-bin and also built
from SVN db-derby-snapshot-10.5.0.0-694562 - for all the the same error happens
> What sort of errors are in your derby.log file? Can you attach it?
this is typical exception - i am attaching derby log file
2008-09-11 21:25:55.453 GMT Thread[DRDAConnThread_7,5,main] (XID = 82480),
(SESSIONID = 1), (DATABASE = sample), (DRDAID =
NF000001.GD9D-449232841661851773{2}), Failed Statement is: INSERT INTO
USER1.PSTORE values(?,?, XMLPARSE(document CAST (? AS CLOB) preserve
whitespace)) with 3 parameters begin parameter #1: 1_0 :end parameter begin
parameter #2: 1abcde0 :end parameter begin parameter #3: CLOB(826) :end
parameter
ERROR 2200M: Invalid XML DOCUMENT: FWK005 parse may not be called while parsing.
at org.apache.derby.iapi.error.StandardException.newException(Unknown
Source)
at org.apache.derby.iapi.types.XML.XMLParse(Unknown Source)
at org.apache.derby.impl.sql.execute.SqlXmlExecutor.XMLParse(Unknown
Source)
at
org.apache.derby.exe.acc851401ax011cx534ex27f7x00003f5c9d400.e0(Unknown Source)
at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown
Source)
at
org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown Source)
at
org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown
Source)
at
org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown
Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown
Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
Source)
at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
at
org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(Unknown Source)
at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
Source)
at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
Caused by: org.xml.sax.SAXException: FWK005 parse may not be called while
parsing.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.derby.iapi.types.SqlXmlUtil$1.run(Unknown Source)
at
java.security.AccessController.doPrivileged(AccessController.java:246)
at org.apache.derby.iapi.types.SqlXmlUtil.serializeToString(Unknown
Source)
... 17 more
============= begin nested exception, level (1) ===========
org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at org.apache.derby.iapi.types.SqlXmlUtil$1.run(Unknown Source)
at
java.security.AccessController.doPrivileged(AccessController.java:246)
at org.apache.derby.iapi.types.SqlXmlUtil.serializeToString(Unknown
Source)
at org.apache.derby.iapi.types.XML.XMLParse(Unknown Source)
at org.apache.derby.impl.sql.execute.SqlXmlExecutor.XMLParse(Unknown
Source)
at
org.apache.derby.exe.acc851401ax011cx534ex27f7x00003f5c9d400.e0(Unknown Source)
at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown
Source)
at
org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown Source)
at
org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown
Source)
at
org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown
Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown
Source)
at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown
Source)
at org.apache.derby.impl.drda.DRDAStatement.execute(Unknown Source)
at
org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTTobjects(Unknown Source)
at org.apache.derby.impl.drda.DRDAConnThread.parseEXCSQLSTT(Unknown
Source)
at org.apache.derby.impl.drda.DRDAConnThread.processCommands(Unknown
Source)
at org.apache.derby.impl.drda.DRDAConnThread.run(Unknown Source)
> Also, can you try extracting as much information as possible from
> the client-side exception by using the techniques described at
> http://wiki.apache.org/db-derby/UnwindExceptionChain
> then posting that information?
here it is:
server:
[java] preparing tables
[java] conn being returned is:[EMAIL PROTECTED]
0b96
[java] tables preparation ended
[java] preparing XML to String
[java] preparing workers
[java] conn being returned is:[EMAIL PROTECTED]
06680
[java] conn being returned is:[EMAIL PROTECTED]
046c
[java] starting 2 threads
[java] all insert threads started
[java]
[java] ----- SQLException -----
[java] SQLState: 2200M
[java] Error Code: -1
[java] Message: Invalid XML DOCUMENT: FWK005 parse may not be called w
hile parsing.
[java]
[java] ----- SQLException -----
[java] SQLState: XJ001
[java] Error Code: 99999
[java] Message: Java exception: 'FWK005 parse may not be called while
parsing.: org.xml.sax.SAXException'.
[java] Exception in thread "Thread-1" java.lang.RuntimeException: inserting
0 failed:null rawXML=<?xml version="1.0" encoding="UTF-8"?>
[java] <fn:filenetEvent pstore:class="custom" pstore:id="61"
[java] xmlns:fn="http://foo.var"
[java] xmlns:pstore="http://bar.var" >
[java] <pstore:appID>1abcde0</pstore:appID>
[java] <fn:documentID>5EE285D7-AF83-4B62-A2B5-BBB91FE2ADD4</fn:documentID
>
[java] <pstore:displayName>Email</pstore:displayName>
[java] <fn:to>[EMAIL PROTECTED]</fn:to>
[java] <fn:action>Creation</fn:action>
[java] <fn:timeStamp>Wed, 30 Jul 2008 18:33:00</fn:timeStamp>
[java] <fn:title>Loan application 101 customer response</fn:title>
[java] <fn:systemTimeStamp>1abcde00</fn:systemTimeStamp>
[java] <fn:from>[EMAIL PROTECTED]</fn:from>
[java] <fn:documentType>email</fn:documentType>
[java] <fn:subject>RE: WeFinance Loan Application 101</fn:subject>
[java] <fn:loanID>101</fn:loanID>
[java] <fn:actor>lisa</fn:actor>
[java] </fn:filenetEvent>
[java]
[java] at ThreadInsert.insertSome(Unknown Source)
[java] at ThreadInsert.run(Unknown Source)
[java] at java.lang.Thread.run(Thread.java:810)
> Concurrent Inserts of rows with XML data results in an exception
> ----------------------------------------------------------------
>
> Key: DERBY-3870
> URL: https://issues.apache.org/jira/browse/DERBY-3870
> Project: Derby
> Issue Type: Bug
> Components: SQL
> Affects Versions: 10.4.1.3
> Environment: System: MS windows server 2003 standard edition service
> pack 2. Derby is run as a server on port 1527.
> Reporter: Royi Ronen
> Priority: Critical
>
> We insert rows into a table using the following prepared statement (through
> JDBC):
> INSERT INTO USER1.PSTORE values(?,?, XMLPARSE(document CAST (? AS CLOB)
> preserve whitespace))
> where each of the ?'s are replaced with a string.
> One thread runs fine. Two or more result in the following exception:
> org.apache.derby.client.am.SqlException: Java exception: 'FWK005 parse may
> not be called while parsing.: org.xml.sax.SAXException'.
> at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
> at org.apache.derby.client.am.SqlException.<init>(Unknown Source)
> We believe that this comes from the dBuilder.parse(InputSource) method.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.