Spring PayloadValidatingInterceptor XsdSchemaCollection: 'zip' access is not allowed due to restriction set by the accessExternalSchema property

huangapple go评论64阅读模式
英文:

Spring PayloadValidatingInterceptor XsdSchemaCollection: 'zip' access is not allowed due to restriction set by the accessExternalSchema property

问题

以下是翻译好的部分:

我有以下配置:

- WebLogic 12
- Spring Boot:2.0.9.RELEASE
- spring-boot-starter-web:2.0.9.RELEASE
- spring-ws-core:3.0.7.RELEASE,其中包含 PayloadValidatingInterceptor
- spring-xml-3.0.7.RELEASE,其中包含 XsdSchemaCollection

我尝试像这样添加 PayloadValidatingInterceptor 与 XsdSchemaCollection:

```java
@Bean("allSchemas")
public XsdSchemaCollection getAllXsdSchemaCollection() {
    return getXsdSchemaCollection(BASE_XSD_PATH + "allSchemas_index.xsd");
}

@Bean
@DependsOn("allSchemas")
@Autowired
public PayloadValidatingInterceptor payloadLoggingInterceptor(XsdSchemaCollection allSchemas) {
    PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor();
    interceptor.setXsdSchemaCollection(allSchemas);
    interceptor.setValidateRequest(true);
    interceptor.setValidateResponse(true);
    return interceptor;
}

private XsdSchemaCollection getXsdSchemaCollection(String path) {
    CommonsXsdSchemaCollection xsds = new CommonsXsdSchemaCollection(new ClassPathResource(path));
    xsds.setInline(true);
    return xsds;
}

我尝试将以下内容添加到 startWebLogic.cmd 作为启动参数:-Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=all

但仍然会抛出以下异常:
org.xml.sax.SAXParseException: schema_reference: 由于accessExternalSchema属性的限制,无法读取模式文档 'allSchemas_index.xsd',因为不允许进行 'zip' 访问。

有什么想法吗?

以下是完整的堆栈跟踪:

org.springframework.beans.factory.BeanCreationException: 在类路径资源[mgmt/web/soap/WebServiceConfig.class]中定义的名为 'payloadLoggingInterceptor' 的bean创建失败;通过工厂方法实例化bean,嵌套异常是org.springframework.beans.BeanInstantiationException:工厂方法 'payloadLoggingInterceptor' 抛出异常,嵌套异常是org.springframework.xml.validation.XmlValidationException:无法创建模式:schema_reference: 由于accessExternalSchema属性的限制,无法读取模式文档 'allSchemas_index.xsd';嵌套异常是org.xml.sax.SAXParseException;systemId:zip:C:/PGM/Dev/wls12213/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/soap-ws/be9jik/war/WEB-INF/lib/xsd-schemas-1.4.0.jar!/xsd/service/index.xsd;行号:26;列号:72;schema_reference: 由于accessExternalSchema属性的限制,无法读取模式文档 'allSchemas_index.xsd'。
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591)
...

(以下部分省略)
英文:
  1. I have the following configuration:

    • weblogic12
    • Spring boot: 2.0.9.RELEASE
    • spring-boot-starter-web: 2.0.9.RELEASE
    • spring-ws-core: 3.0.7.RELEASE which contains PayloadValidatingInterceptor
    • spring-xml-3.0.7.RELEASE which contains XsdSchemaCollection

I tried to add a PayloadValidatingInterceptor in conjuction with XsdSchemaCollection
like this:

@Bean("allSchemas")
public XsdSchemaCollection getAllXsdSchemaCollection() {
    return getXsdSchemaCollection(BASE_XSD_PATH+"allSchemas_index.xsd");
}

@Bean
@DependsOn("allSchemas")
@Autowired
public PayloadValidatingInterceptor payloadLoggingInterceptor(XsdSchemaCollection allSchemas) {
    PayloadValidatingInterceptor interceptor = new PayloadValidatingInterceptor();
    interceptor.setXsdSchemaCollection(allSchemas);
    interceptor.setValidateRequest(true);
    interceptor.setValidateResponse(true);
    return interceptor;
}

private XsdSchemaCollection getXsdSchemaCollection(String path) {
    CommonsXsdSchemaCollection xsds = new CommonsXsdSchemaCollection(new ClassPathResource(path));
    xsds.setInline(true);
    return xsds;
}

I try to add into startWebLogic.cmd as startup param's: -Djavax.xml.accessExternalSchema=all -Djavax.xml.accessExternalDTD=all

but still the exception thrown is:
org.xml.sax.SAXParseException: schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property.

Any Ideas?

Below is the full stack trace:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'payloadLoggingInterceptor' defined in class path resource [mgmt/web/soap/WebServiceConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor]: Factory method 'payloadLoggingInterceptor' threw exception; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. ; nested exception is org.xml.sax.SAXParseException; systemId: zip:C:/PGM/Dev/wls12213/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/soap-ws/be9jik/war/WEB-INF/lib/xsd-schemas-1.4.0.jar!/xsd/service/index.xsd; lineNumber: 26; columnNumber: 72; schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. 
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1246)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1096)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:881)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:386)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:307)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.run(SpringBootServletInitializer.java:157)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:137)
at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:91)
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
at weblogic.servlet.internal.WebAppServletContext.initContainerInitializer(WebAppServletContext.java:1425)
at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1364)
at weblogic.servlet.internal.WebAppServletContext.initContainerInitializers(WebAppServletContext.java:1345)
at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:1917)
at weblogic.servlet.internal.WebAppServletContext.start(WebAppServletContext.java:3101)
at weblogic.servlet.internal.WebAppModule.startContexts(WebAppModule.java:1843)
at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:884)
at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:360)
at weblogic.application.internal.ExtensibleModuleWrapper$StartStateChange.next(ExtensibleModuleWrapper.java:356)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.ExtensibleModuleWrapper.start(ExtensibleModuleWrapper.java:138)
at weblogic.application.internal.flow.ModuleListenerInvoker.start(ModuleListenerInvoker.java:124)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:233)
at weblogic.application.internal.flow.ModuleStateDriver$3.next(ModuleStateDriver.java:228)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.flow.ModuleStateDriver.start(ModuleStateDriver.java:78)
at weblogic.application.internal.flow.StartModulesFlow.activate(StartModulesFlow.java:52)
at weblogic.application.internal.BaseDeployment$2.next(BaseDeployment.java:752)
at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:45)
at weblogic.application.internal.BaseDeployment.activate(BaseDeployment.java:262)
at weblogic.application.internal.SingleModuleDeployment.activate(SingleModuleDeployment.java:52)
at weblogic.application.internal.DeploymentStateChecker.activate(DeploymentStateChecker.java:165)
at weblogic.deploy.internal.targetserver.AppContainerInvoker.activate(AppContainerInvoker.java:90)
at weblogic.deploy.internal.targetserver.BasicDeployment.activate(BasicDeployment.java:274)
at weblogic.deploy.internal.targetserver.BasicDeployment.activateFromServerLifecycle(BasicDeployment.java:507)
at weblogic.management.deploy.internal.DeploymentAdapter$1.doActivate(DeploymentAdapter.java:53)
at weblogic.management.deploy.internal.DeploymentAdapter.activate(DeploymentAdapter.java:202)
at weblogic.management.deploy.internal.AppTransition$2.transitionApp(AppTransition.java:52)
at weblogic.management.deploy.internal.ConfiguredDeployments$2.doItem(ConfiguredDeployments.java:741)
at weblogic.management.deploy.internal.parallel.BucketInvoker.invoke(BucketInvoker.java:138)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionAppsParallel(ConfiguredDeployments.java:749)
at weblogic.management.deploy.internal.ConfiguredDeployments.transitionAppsParallel(ConfiguredDeployments.java:702)
at weblogic.management.deploy.internal.ConfiguredDeployments.activate(ConfiguredDeployments.java:381)
at weblogic.management.deploy.internal.ConfiguredDeployments.deploy(ConfiguredDeployments.java:233)
at weblogic.management.deploy.internal.DeploymentServerService.resume(DeploymentServerService.java:219)
at weblogic.management.deploy.internal.DeploymentServerService.start(DeploymentServerService.java:133)
at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1287)
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:333)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:375)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:305)
at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:698)
at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:78)
at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:212)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:235)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:358)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:487)
at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:305)
at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:85)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2126)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:116)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:90)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1237)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1168)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:670)
at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:352)
at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:337)
at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:57)
at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:644)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:415)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:355)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.soap.server.endpoint.interceptor.PayloadValidatingInterceptor]: Factory method 'payloadLoggingInterceptor' threw exception; nested exception is org.springframework.xml.validation.XmlValidationException: Could not create Schema: schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. ; nested exception is org.xml.sax.SAXParseException; systemId: zip:C:/PGM/Dev/wls12213/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/soap-ws/be9jik/war/WEB-INF/lib/allSchemas_index-1.4.0.jar!/xsd/service/soap/index_soap.xsd; lineNumber: 26; columnNumber: 72; schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. 
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:583)
... 88 common frames omitted
Caused by: org.springframework.xml.validation.XmlValidationException: Could not create Schema: schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. ; nested exception is org.xml.sax.SAXParseException; systemId: zip:C:/PGM/Dev/wls12213/user_projects/domains/base_domain/servers/AdminServer/tmp/_WL_user/soap-ws/be9jik/war/WEB-INF/lib/allSchemas_index-1.4.0.jar!/xsd/service/soap/index_soap.xsd; lineNumber: 26; columnNumber: 72; schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. 
at org.springframework.xml.validation.Jaxp15ValidatorFactory.createValidator(Jaxp15ValidatorFactory.java:55)
at org.springframework.xml.validation.XmlValidatorFactory.createValidator(XmlValidatorFactory.java:93)
at org.springframework.xml.xsd.commons.CommonsXsdSchemaCollection.createValidator(CommonsXsdSchemaCollection.java:180)
at org.springframework.ws.server.endpoint.interceptor.AbstractValidatingInterceptor.setXsdSchemaCollection(AbstractValidatingInterceptor.java:134)
at mgmt.web.soap.WebServiceConfig.payloadLoggingInterceptor(WebServiceConfig.java:455)
at mgmt.web.soap.WebServiceConfig$$EnhancerBySpringCGLIB$$a3bcf37e.CGLIB$payloadLoggingInterceptor$35(<generated>)
at mgmt.web.soap.WebServiceConfig$$EnhancerBySpringCGLIB$$a3bcf37e$$FastClassBySpringCGLIB$$631529cc.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:365)
at mgmt.web.soap.WebServiceConfig$$EnhancerBySpringCGLIB$$a3bcf37e.payloadLoggingInterceptor(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
... 89 common frames omitted
Caused by: org.xml.sax.SAXParseException: schema_reference: Failed to read schema document 'allSchemas_index.xsd', because 'zip' access is not allowed due to restriction set by the accessExternalSchema property. 
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:400)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4154)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaFatalError(XSDHandler.java:4133)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.getSchemaDocument(XSDHandler.java:2174)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.resolveSchema(XSDHandler.java:2084)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:1014)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:625)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:610)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:569)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:535)
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:254)
at weblogic.xml.jaxp.WebLogicSchemaFactory.newSchema(WebLogicSchemaFactory.java:118)
at weblogic.xml.jaxp.RegistrySchemaFactory.newSchema(RegistrySchemaFactory.java:111)
at org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(SchemaLoaderUtils.java:77)
at org.springframework.xml.validation.Jaxp15ValidatorFactory.createValidator(Jaxp15ValidatorFactory.java:51)
... 103 common frames omitted

答案1

得分: 3

经过一些调查我发现 WLS 在 URI 地址 xsd 前使用了错误的 'zip:' 模式预期的模式应为 'jar:file:'。我通过实现调整后的 FixedCommonsXsdSchemaCollection 解决了这个问题如下所示

public class FixedCommonsXsdSchemaCollection extends CommonsXsdSchemaCollection {
    private static final String ZIP_SCHEMA = "zip:";
    private static final String JAR_FILE_SCHEMA = "jar:file:";

    public FixedCommonsXsdSchemaCollection(final Resource[] schemas) {
        super(schemas);
    }

    @Override
    public XmlValidator createValidator() {
        try {
            XsdSchema[] schs = this.getXsdSchemas();
            Resource[] resources = new Resource[schs.length];
            for (int i = schs.length - 1; i >= 0; i--) {
                if (schs[i] instanceof CommonsXsdSchema) {
                    XmlSchema xmlSchema = ((CommonsXsdSchema) schs[i]).getSchema();
                    String sourceUri = xmlSchema.getSourceURI();
                    if (StringUtils.hasLength(sourceUri)) {
                        String fixedUri = sourceUri.replace(ZIP_SCHEMA, JAR_FILE_SCHEMA);
                        log.info("Fixing uri, original={}, fixed={}", sourceUri, fixedUri);
                        resources[i] = new UrlResource(fixedUri);
                    }
                }
            }
            return XmlValidatorFactory.createValidator(resources, XmlValidatorFactory.SCHEMA_W3C_XML);
        } catch (IOException ex) {
            throw new CommonsXsdSchemaException(ex.getMessage(), ex);
        }
    }
}
英文:

After some investigation I found out that WLS uses incorrect 'zip:' schema in front of URI addressing xsd, expected schema is 'jar:file:'. I solved it by implementing tweaked version of CommonsXsdSchemaCollection as following:

public class FixedCommonsXsdSchemaCollection extends CommonsXsdSchemaCollection {
private static final String ZIP_SCHEMA = "zip:";
private static final String JAR_FILE_SCHEMA = "jar:file:";
public FixedCommonsXsdSchemaCollection(final Resource[] schemas) {
super(schemas);
}
@Override
public XmlValidator createValidator() {
try {
XsdSchema[] schs = this.getXsdSchemas();
Resource[] resources = new Resource[schs.length];
for (int i = schs.length - 1; i >= 0; i--) {
if (schs[i] instanceof CommonsXsdSchema) {
XmlSchema xmlSchema = ((CommonsXsdSchema) schs[i]).getSchema();
String sourceUri = xmlSchema.getSourceURI();
if (StringUtils.hasLength(sourceUri)) {
String fixedUri = sourceUri.replace(ZIP_SCHEMA, JAR_FILE_SCHEMA);
log.info("Fixing uri, original={}, fixed={}", sourceUri, fixedUri);
resources[i] = new UrlResource(fixedUri);
}
}
}
return XmlValidatorFactory.createValidator(resources, XmlValidatorFactory.SCHEMA_W3C_XML);
} catch (IOException ex) {
throw new CommonsXsdSchemaException(ex.getMessage(), ex);
}
}
}

huangapple
  • 本文由 发表于 2020年10月22日 20:56:42
  • 转载请务必保留本文链接:https://go.coder-hub.com/64482719.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定