Доступ к файлу не разрешен из-за ограничений, установленных свойством accessExternalSchema

Я пытаюсь проверить полезную нагрузку XML с помощью XSD, где этот XSD ссылается на другой, а другой ссылается на кого-то другого. Что-то вроде вложенной ссылки.

Когда я включаю все .xsdв Validate Schema путь, я все еще получаю:

Трассировка стека корневых исключений: org.xml.sax.SAXParseException; schema_reference: Не удалось прочитать документ схемы "MPProduct.xsd", поскольку доступ к "файлу" не разрешен из-за ограничений, установленных свойством accessExternalSchema. om.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) в com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerW177: atjandlerW177) com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400) в com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError (XMLErrorReporter.java6) com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4160) в com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaFatErr(XSDHandler.java:4135) на com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2172) на com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(XSDHandler.java:2100) на com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:1104) на com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:623) на com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:613) на com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:572) на com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:538) на com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:255) в org.mule.module.xml.internal.operation.SchemaValidatorOperation$2.create(SchemaValidatorOperation.java.m14le) at2..xml.internal.operation.SchemaValidatorOperation$2.create(SchemaValidatorOperation.java:132) в org.apache.commons.pool2.BasePooledObjectFactory.makeObject(BasePooledObjectFactory.java:58) в org.apache.comjectGolic.olo. создать (GenericObjectPool.java:888) в org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:432)

Любые предложения, чтобы решить эту проблему, пожалуйста?

Я пытался добавить -Djavax.xml.accessExternalSchema=all в аргументах ВМ при работе на локальном все еще остается тем же

<flow name="mytestingFlow" doc:id="4efe5074-da20-4164-843a-06ca9a2a9979" >
        <http:listener doc:name="Listener" doc:id="74f4f199-00cb-460d-b72f-df3497f26e6a" config-ref="HTTP_Listener_config" path="/service/path/one"/>
        <set-payload value="#[&quot;&lt;MPItemFeed xmlns=\&quot;http://walmart.com/\&quot;&gt;&lt;MPItemFeedHeader&gt;&lt;version&gt;3.2&lt;/version&gt;&lt;/MPItemFeedHeader&gt;&lt;MPItem&gt;&lt;processMode&gt;CREATE&lt;/processMode&gt;&lt;sku&gt;10145802&lt;/sku&gt;&lt;productIdentifiers&gt;&lt;productIdentifier&gt;&lt;productIdType&gt;UPC&lt;/productIdType&gt;&lt;productId&gt;123456789123&lt;/productId&gt;&lt;/productIdentifier&gt;&lt;/productIdentifiers&gt;&lt;MPProduct&gt;&lt;SkuUpdate&gt;NO&lt;/SkuUpdate&gt;&lt;msrp&gt;183.99&lt;/msrp&gt;&lt;productName&gt;CARQUEST Platinum Professional Ceramic Brake Pads - Front (4-Pad Set)&lt;/productName&gt;&lt;ProductIdUpdate&gt;YES&lt;/ProductIdUpdate&gt;&lt;category&gt;&lt;Vehicle&gt;&lt;VehiclePartsAndAccessories&gt;&lt;shortDescription&gt;Ceramic Brake Pads - Front (4-Pad Set)&lt;/shortDescription&gt;&lt;keyFeatures&gt;&lt;keyFeaturesValue&gt;Premium brake pad underlayer reduces vibration for silent braking Industry leading number of application specific formulations for maximum performance Revolutionary burnishing compound strip allows for proper break-in of pads and rotors.&lt;/keyFeaturesValue&gt;&lt;/keyFeatures&gt;&lt;brand&gt;CARQUEST Platinum Professional&lt;/brand&gt;&lt;manufacturer&gt;CARQUEST Platinum Professional&lt;/manufacturer&gt;&lt;manufacturerPartNumber&gt;PXD1210H&lt;/manufacturerPartNumber&gt;&lt;mainImageUrl&gt;http://pdfifsvcprd.corp.advancestores.com/assets/epc50x50/std.lang.all/1012147531.jpg&lt;/mainImageUrl&gt;&lt;isProp65WarningRequired&gt;Yes&lt;/isProp65WarningRequired&gt;&lt;prop65WarningText&gt;cancer and reproductive&lt;/prop65WarningText&gt;&lt;hasWarranty&gt;YES&lt;/hasWarranty&gt;&lt;warrantyText&gt;LIMITED LIFETIME REPLACEMENT&lt;/warrantyText&gt;&lt;/VehiclePartsAndAccessories&gt;&lt;/Vehicle&gt;&lt;/category&gt;&lt;/MPProduct&gt;&lt;MPOffer&gt;&lt;price&gt;182.99&lt;/price&gt;&lt;ShippingWeight&gt;&lt;measure&gt;4&lt;/measure&gt;&lt;unit&gt;lb&lt;/unit&gt;&lt;/ShippingWeight&gt;&lt;ProductTaxCode&gt;2038710&lt;/ProductTaxCode&gt;&lt;/MPOffer&gt;&lt;/MPItem&gt;&lt;MPItem&gt;&lt;processMode&gt;CREATE&lt;/processMode&gt;&lt;sku&gt;11395545&lt;/sku&gt;&lt;productIdentifiers&gt;&lt;productIdentifier&gt;&lt;productIdType&gt;UPC&lt;/productIdType&gt;&lt;productId&gt;123456789123&lt;/productId&gt;&lt;/productIdentifier&gt;&lt;/productIdentifiers&gt;&lt;MPProduct&gt;&lt;SkuUpdate&gt;NO&lt;/SkuUpdate&gt;&lt;msrp&gt;183.99&lt;/msrp&gt;&lt;productName&gt;CARQUEST Platinum Brake Rotor - Front&lt;/productName&gt;&lt;ProductIdUpdate&gt;YES&lt;/ProductIdUpdate&gt;&lt;category&gt;&lt;Vehicle&gt;&lt;VehiclePartsAndAccessories&gt;&lt;shortDescription&gt;Brake Rotor - Front&lt;/shortDescription&gt;&lt;keyFeatures&gt;&lt;keyFeaturesValue&gt;Engineered to withstand 120 hours of salt spray testing Manufactured to exacting quality and dimensional specifications for Superior Stopping Power Exceeds ISO manufacturing guidelines (International Organization for Standardization)&lt;/keyFeaturesValue&gt;&lt;/keyFeatures&gt;&lt;brand&gt;CARQUEST Platinum&lt;/brand&gt;&lt;manufacturer&gt;CARQUEST Platinum&lt;/manufacturer&gt;&lt;manufacturerPartNumber&gt;YH145232P&lt;/manufacturerPartNumber&gt;&lt;mainImageUrl&gt;http://pdfifsvcprd.corp.advancestores.com/assets/epc50x50/std.lang.all/1017931756.jpg&lt;/mainImageUrl&gt;&lt;isProp65WarningRequired&gt;No&lt;/isProp65WarningRequired&gt;&lt;prop65WarningText/&gt;&lt;hasWarranty&gt;YES&lt;/hasWarranty&gt;&lt;warrantyText&gt;2 YR REPLACEMENT IF DEFECTIVE&lt;/warrantyText&gt;&lt;/VehiclePartsAndAccessories&gt;&lt;/Vehicle&gt;&lt;/category&gt;&lt;/MPProduct&gt;&lt;MPOffer&gt;&lt;price&gt;182.99&lt;/price&gt;&lt;ShippingWeight&gt;&lt;measure&gt;4&lt;/measure&gt;&lt;unit&gt;lb&lt;/unit&gt;&lt;/ShippingWeight&gt;&lt;ProductTaxCode&gt;2038710&lt;/ProductTaxCode&gt;&lt;/MPOffer&gt;&lt;/MPItem&gt;&lt;MPItem&gt;&lt;processMode&gt;CREATE&lt;/processMode&gt;&lt;sku&gt;10556036&lt;/sku&gt;&lt;productIdentifiers&gt;&lt;productIdentifier&gt;&lt;productIdType&gt;UPC&lt;/productIdType&gt;&lt;productId&gt;123456789123&lt;/productId&gt;&lt;/productIdentifier&gt;&lt;/productIdentifiers&gt;&lt;MPProduct&gt;&lt;SkuUpdate&gt;NO&lt;/SkuUpdate&gt;&lt;msrp&gt;183.99&lt;/msrp&gt;&lt;productName&gt;CARQUEST Premium Lube Element with Lid&lt;/productName&gt;&lt;ProductIdUpdate&gt;YES&lt;/ProductIdUpdate&gt;&lt;category&gt;&lt;Vehicle&gt;&lt;VehiclePartsAndAccessories&gt;&lt;shortDescription&gt;Lube Element with Lid&lt;/shortDescription&gt;&lt;keyFeatures&gt;&lt;keyFeaturesValue&gt;Environmental cartridge lube filter High efficiency and durable cellulose/synthetic blended media for longer drain intervals Silicone anti-drain back valve has 3X the durability verses nitrile for engine start-up protection&lt;/keyFeaturesValue&gt;&lt;/keyFeatures&gt;&lt;brand&gt;CARQUEST Premium&lt;/brand&gt;&lt;manufacturer&gt;CARQUEST Premium&lt;/manufacturer&gt;&lt;manufacturerPartNumber&gt;84312&lt;/manufacturerPartNumber&gt;&lt;mainImageUrl&gt;http://pdfifsvcprd.corp.advancestores.com/assets/epc50x50/std.lang.all/1015772990.jpg&lt;/mainImageUrl&gt;&lt;isProp65WarningRequired&gt;Yes&lt;/isProp65WarningRequired&gt;&lt;prop65WarningText&gt;cancer and reproductive&lt;/prop65WarningText&gt;&lt;hasWarranty&gt;YES&lt;/hasWarranty&gt;&lt;warrantyText&gt;REPLACE OR REFUND AT MGR DISCRETION&lt;/warrantyText&gt;&lt;/VehiclePartsAndAccessories&gt;&lt;/Vehicle&gt;&lt;/category&gt;&lt;/MPProduct&gt;&lt;MPOffer&gt;&lt;price&gt;182.99&lt;/price&gt;&lt;ShippingWeight&gt;&lt;measure&gt;4&lt;/measure&gt;&lt;unit&gt;lb&lt;/unit&gt;&lt;/ShippingWeight&gt;&lt;ProductTaxCode&gt;2038710&lt;/ProductTaxCode&gt;&lt;/MPOffer&gt;&lt;/MPItem&gt;&lt;MPItem&gt;&lt;processMode&gt;CREATE&lt;/processMode&gt;&lt;sku&gt;20471798&lt;/sku&gt;&lt;productIdentifiers&gt;&lt;productIdentifier&gt;&lt;productIdType&gt;UPC&lt;/productIdType&gt;&lt;productId&gt;123456789123&lt;/productId&gt;&lt;/productIdentifier&gt;&lt;/productIdentifiers&gt;&lt;MPProduct&gt;&lt;SkuUpdate&gt;NO&lt;/SkuUpdate&gt;&lt;msrp&gt;183.99&lt;/msrp&gt;&lt;productName&gt;Denso Air-Fuel Ratio Sensor 4 Wire, Direct Fit, Heated, Wire Length: 10.63&lt;/productName&gt;&lt;ProductIdUpdate&gt;YES&lt;/ProductIdUpdate&gt;&lt;category&gt;&lt;Vehicle&gt;&lt;VehiclePartsAndAccessories&gt;&lt;shortDescription&gt;Air-Fuel Ratio Sensor 4 Wire, Direct Fit, Heated, Wire Length: 10.63&lt;/shortDescription&gt;&lt;keyFeatures&gt;&lt;keyFeaturesValue&gt;Specifically designed to meet the increasing demands of today's engines 100% checked for high temperature signal output, air tightness, continuity, and heat resistance for optimal efficiency and performance Double protection cover helps maintain proper unit temperature for quicker response times, which is critical to your vehicle's fuel efficiency&lt;/keyFeaturesValue&gt;&lt;/keyFeatures&gt;&lt;brand&gt;Denso&lt;/brand&gt;&lt;manufacturer&gt;Denso&lt;/manufacturer&gt;&lt;manufacturerPartNumber&gt;234-9001&lt;/manufacturerPartNumber&gt;&lt;mainImageUrl&gt;http://pdfifsvcprd.corp.advancestores.com/assets/epc50x50/std.lang.all/524891.jpg&lt;/mainImageUrl&gt;&lt;isProp65WarningRequired&gt;No&lt;/isProp65WarningRequired&gt;&lt;prop65WarningText/&gt;&lt;hasWarranty&gt;YES&lt;/hasWarranty&gt;&lt;warrantyText&gt;1 YR REPLACEMENT IF DEFECTIVE&lt;/warrantyText&gt;&lt;/VehiclePartsAndAccessories&gt;&lt;/Vehicle&gt;&lt;/category&gt;&lt;/MPProduct&gt;&lt;MPOffer&gt;&lt;price&gt;182.99&lt;/price&gt;&lt;ShippingWeight&gt;&lt;measure&gt;4&lt;/measure&gt;&lt;unit&gt;lb&lt;/unit&gt;&lt;/ShippingWeight&gt;&lt;ProductTaxCode&gt;2038710&lt;/ProductTaxCode&gt;&lt;/MPOffer&gt;&lt;/MPItem&gt;&lt;/MPItemFeed&gt;
&quot;]" doc:name="Set Payload" doc:id="b16a5f07-fa58-4c36-837a-3533eecdcccd" mimeType="application/xml"/>
        <ee:transform doc:name="Transform Message" doc:id="a6d22ddb-1e3a-4519-a22f-41987f9b5049" >
            <ee:message >
                <ee:set-payload ><![CDATA[%dw 2.0
output application/xml  
---
payload]]></ee:set-payload>
            </ee:message>
        </ee:transform>
        <xml-module:validate-schema doc:name="Validate schema" doc:id="c5dbaef9-d4f3-4aeb-b15a-516aa0eb2479" schemas="Animal.xsd,ArtAndCraftCategory.xsd,Baby.xsd,CarriersAndAccessoriesCategory.xsd,ClothingCategory.xsd,Electronics.xsd,FoodAndBeverageCategory.xsd,FootwearCategory.xsd,FurnitureCategory.xsd,GardenAndPatioCategory.xsd,HealthAndBeauty.xsd,Home.xsd,JewelryCategory.xsd,Media.xsd,MPCommons.xsd,MPItem.xsd,MPItemFeed.xsd,MPItemFeedHeader.xsd,MPOffer.xsd,MPProduct.xsd,MusicalInstrument.xsd,OccasionAndSeasonal.xsd,OfficeCategory.xsd,OtherCategory.xsd,Photography.xsd,SportAndRecreation.xsd,ToolsAndHardware.xsd,ToysCategory.xsd,Vehicle.xsd,WatchesCategory.xsd" config-ref="XML_Config"/>
        <logger level="INFO" doc:name="Logger" doc:id="a74dbf49-d111-4eb3-84c3-598845ecaf48" />
    </flow>

1 ответ

В каком месте находятся XSD-файлы? Путь должен быть указан для XSD, как упомянуто здесь

Чтение файла является проблемой. С аналогичной проблемой сталкиваются и при чтении входного файла mUnit. В этих случаях файлы могут быть прочитаны как: getResourceAsString или же getResourceAsStream

Это должно быть полезно.

Другие вопросы по тегам