DB2 - Problem description
Problem IC73876 | Status: Closed |
DB2XML-CE: DB2 FAILS WITH SQL16196N WHEN VALIDATIING XML TO A SCHEMA WITH LOOP REFERENCE | |
product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problem description: | |
From an external's point of view the problem behaviour would be something like: Schema validation errors during validating parse such as "Base type could not be found" or "Type not found" are incorrectly generated when there are multiple complexTypes that have the same base complexType which resides in a different namespace. For example: complexType "A" in namespace1 has a base complexType called "base" in namespace 2. "base" complexType contains elements one of which is a complexType "B" in namespace 1 that has a base complexType of "base" in namespace 2. DB2 Error messages could be like this: CALL XSR_GET_PARSING_DIAGNOSTICS( blob('<?xml version="1.0" encoding="UTF-8"?> <xsd_1:site xmlns:xsd_1="http://pivot/" xmlns:xsd_11="http://pivot/systems/" xmlns:xsd_12="http://pivot/dataTypes/" xmlns:xsd_13="http://pivot/spatialElements/" xmlns:xsd_14="http://pivot/savings/" xmlns:xsd_15="http://pivot/controlElements/" xmlns:xsd_16="http://pivot/distributionElements/" xmlns:xsd_17="http://pivot/buildingElements/" xmlns:xsd_18="http://pivot/buildingElements/buildingElementsEner getics/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pivot/ http://pivot/"> <geographicLocation>rue de la vieille poste</geographicLocation> <globalID>1</globalID> </xsd_1:site> '),'RIDER_DATA','PIVOT','',0 ,?,?); ---------------------------------------------------------------- -------------- CALL XSR_GET_PARSING_DIAGNOSTICS( blob('<?xml version="1.0" encoding="UTF-8"?> <xsd_1:site xmlns:xsd_1="http://pivot/" xmlns:xsd_11="http://pivot/systems/" xmlns:xsd_12="http://pivot/dataTypes/" xmlns:xsd_13="http://pivot/spatialElements/" xmlns:xsd_14="http://pivot/savings/" xmlns:xsd_15="http://pivot/controlElements/" xmlns:xsd_16="http://pivot/distributionElements/" xmlns:xsd_17="http://pivot/buildingElements/" xmlns:xsd_18="http://pivot/buildingElements/buildingElementsEner getics/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pivot/ http://pivot/"> <geographicLocation>rue de la vieille poste</geographicLocation> <globalID>1</globalID> </xsd_1:site> '),'RIDER_DATA','PIVOT','',0 ,?,?) Value of output parameters -------------------------- Parameter Name : ERRORDIALOG Parameter Value : <ErrorLog> <XML_Error parser="XML4C"> <errCode>2</errCode> <errDomain>http://apache.org/xml/messages/XMLValidity</errDomain > <errText>Unknown element 'globalID'</errText> <lineNum>1</lineNum> <colNum>631</colNum> <location>/xsd_1:site</location> <schemaType>http://www.w3.org/2001/XMLSchema:string</schemaType> <tokenCount>2</tokenCount> <token1>globalID</token1> <token2>37</token2> </XML_Error> <XML_Error parser="XML4C"> <errCode>7</errCode> <errDomain>http://apache.org/xml/messages/XMLValidity</errDomain > <errText>Element 'globalID' is not valid for content model: '(hasService,hasSaving,(hasBuilding,spacialZone,geographicLocati on),siteSpace)'</errText> <lineNum>1</lineNum> <colNum>657</colNum> <location>/xsd_1:site</location> <schemaType>http://www.w3.org/2001/XMLSchema:anyType</schemaType > <tokenCount>2</tokenCount> <token1>globalID</token1> <token2>31</token2> </XML_Error> <DB2_Error> <sqlstate>2200M</sqlstate> <sqlcode>-16196</sqlcode> <errText> [IBM][CLI Driver][DB2/NT64] SQL16196N XML document contains an element "globalID" that is not correctly specified. Reason code = "37" SQLSTATE=2200M </errText> </DB2_Error> </ErrorLog> Parameter Name : ERRORCOUNT Parameter Value : 2 Return Status = 0 | |
Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * It occurs on DB2 version earlier than v97fp4 * **************************************************************** * PROBLEM DESCRIPTION: * * Schema validation errors during validating parse such as * * "Base type could not be found" or "Type not found" are * * incorrectly generated when there are multiple complexTypes * * that have the same base complexType which resides in a * * different namespace. * * For example: * * complexType "A" in namespace1 has a base complexType called * * "base" in namespace 2. * * "base" complexType contains elements one of which is a * * complexType "B" in namespace 1 that has a base complexType * * of "base" in namespace 2. * * * * DB2 Error messages could be like this: * * * * CALL XSR_GET_PARSING_DIAGNOSTICS( * * blob('<?xml version="1.0" encoding="UTF-8"?> * * <xsd_1:site xmlns:xsd_1="http://pivot/" * * xmlns:xsd_11="http://pivot/systems/" * * xmlns:xsd_12="http://pivot/dataTypes/" * * xmlns:xsd_13="http://pivot/spatialElements/" * * xmlns:xsd_14="http://pivot/savings/" * * xmlns:xsd_15="http://pivot/controlElements/" * * xmlns:xsd_16="http://pivot/distributionElements/" * * xmlns:xsd_17="http://pivot/buildingElements/" * * xmlns:xsd_18="http://pivot/buildingElements/buildingElementsEn * xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" * * xsi:schemaLocation="http://pivot/ http://pivot/"> * * <geographicLocation>rue de la vieille * * poste</geographicLocation> * * <globalID>1</globalID> * * </xsd_1:site> * * * * '),'RIDER_DATA','PIVOT','',0 ,?,?); * * -------------------------------------------------------------- * * * CALL XSR_GET_PARSING_DIAGNOSTICS( blob('<?xml version="1.0" * * encoding="UTF-8"?> <xsd_1:site xmlns:xsd_1="http://pivot/" * * xmlns:xsd_11="http://pivot/systems/" * * xmlns:xsd_12="http://pivot/dataTypes/" * * xmlns:xsd_13="http://pivot/spatialElements/" * * xmlns:xsd_14="http://pivot/savings/" * * xmlns:xsd_15="http://pivot/controlElements/" * * xmlns:xsd_16="http://pivot/distributionElements/" * * xmlns:xsd_17="http://pivot/buildingElements/" * * xmlns:xsd_18="http://pivot/buildingElements/buildingElementsEn * xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" * * xsi:schemaLocation="http://pivot/ http://pivot/"> * * <geographicLocation>rue de la vieille * * poste</geographicLocation> <globalID>1</globalID> * * </xsd_1:site> '),'RIDER_DATA','PIVOT','',0 ,?,?) * * * * Value of output parameters * * -------------------------- * * Parameter Name : ERRORDIALOG * * Parameter Value : <ErrorLog> * * <XML_Error parser="XML4C"> * * <errCode>2</errCode> * * * * <errDomain>http://apache.org/xml/messages/XMLValidity</errDoma * * * <errText>Unknown element 'globalID'</errText> * * <lineNum>1</lineNum> * * <colNum>631</colNum> * * <location>/xsd_1:site</location> * * * * <schemaType>http://www.w3.org/2001/XMLSchema:string</schemaTyp * * * <tokenCount>2</tokenCount> * * <token1>globalID</token1> * * <token2>37</token2> * * </XML_Error> * * <XML_Error parser="XML4C"> * * <errCode>7</errCode> * * * * <errDomain>http://apache.org/xml/messages/XMLValidity</errDoma * * * <errText>Element 'globalID' is not valid for content * * model: * * '(hasService,hasSaving,(hasBuilding,spacialZone,geographicLoca * * * <lineNum>1</lineNum> * * <colNum>657</colNum> * * <location>/xsd_1:site</location> * * * * <schemaType>http://www.w3.org/2001/XMLSchema:anyType</schemaTy * * * <tokenCount>2</tokenCount> * * <token1>globalID</token1> * * <token2>31</token2> * * </XML_Error> * * <DB2_Error> * * <sqlstate>2200M</sqlstate> * * <sqlcode>-16196</sqlcode> * * <errText> * * [IBM][CLI Driver][DB2/NT64] SQL16196N XML document contains * * an element "globalID" that is not correctly specified. * * Reason code = "37" SQLSTATE=2200M * * </errText> * * </DB2_Error> * * </ErrorLog> * * * * * * Parameter Name : ERRORCOUNT * * Parameter Value : 2 * * * * Return Status = 0 * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 version 9.7.4 * **************************************************************** | |
Local Fix: | |
available fix packs: | |
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows | |
Solution | |
DB2 can register schema successfully for which there are multiple complexTypes that have the same base complexType which resides in a different namespace as we mentioned above. | |
Workaround | |
not known / see Local fix | |
Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 14.01.2011 01.05.2011 01.05.2011 |
Problem solved at the following versions (IBM BugInfos) | |
9.7.4 | |
Problem solved according to the fixlist(s) of the following version(s) | |
9.7.0.4 |