Java 阻止WebLogic服务器上XSD的外部引用

Java 阻止WebLogic服务器上XSD的外部引用,java,spring,weblogic,message-driven-bean,Java,Spring,Weblogic,Message Driven Bean,我有一个应用程序使用spring-config消息汇总.xmlconfig。部署到weblogic时,日志文件中有以下一系列错误: Stack trace associated with message Error in starting the MDB MyMessageConsumerEJB follows: java.lang.reflect.InvocationTargetException ... Caused by: org.springframework.beans.factor

我有一个应用程序使用
spring-config消息汇总.xml
config。部署到weblogic时,日志文件中有以下一系列错误:

Stack trace associated with message Error in starting the MDB MyMessageConsumerEJB follows:

java.lang.reflect.InvocationTargetException
...
Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 77 in XML document from class path resource [spring-config-messaging-rollup.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 77; columnNumber: 104; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'oxm:jaxb2-marshaller'.
...
10:26:00,050 WARN XmlBeanDefinitionReader - Ignored XML validation warning
org.xml.sax.SAXParseException; lineNumber: 77; columnNumber: 104; schema_reference.4: Failed to read schema document 'http://www.springframework.org/schema/oxm/spring-oxm.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
...
Caused by: java.net.ConnectException: Tried all: '2' addresses, but could not connect over HTTP to server: 'www.springframework.org', port: '80'
启动MDB MyMessageConsumerEJB时与消息错误关联的堆栈跟踪如下所示: java.lang.reflect.InvocationTargetException ... 原因:org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:类路径资源[spring config messaging rollup.xml]的xml文档中的第77行无效;嵌套异常为org.xml.sax.saxpasseeption;行号:77;栏目号:104;cvc复杂类型.2.4.c:匹配的通配符是严格的,但找不到元素“oxm:jaxb2 marshaller”的声明。 ... 10:26:00050警告XmlBeanDefinitionReader-忽略XML验证警告 org.xml.sax.SAXParseException;行号:77;栏目号:104;架构\u引用。4:未能读取架构文档'http://www.springframework.org/schema/oxm/spring-oxm.xsd,因为1)找不到该文档;2) 文件无法读取;3) 文档的根元素不是。 ... 原因:java.net.ConnectException:尝试了所有“2”地址,但无法通过HTTP连接到服务器:“www.springframework.org”,端口:“80” tl;dr服务器无法访问internet,但正在尝试下载
spring oxm.xsd


有没有办法让服务器使用本地引用来代替此文件?

我设法解决了这个问题。原来我对的引用没有在内部解析,因为从属spring oxm jar中的
spring.schemas
文件指向xsd的特定版本。这导致冲突解决程序尝试在internet上查找该文件

根据
spring.schemas
更改我的spring配置文件以引用精确版本,修复了该问题

这可能有助于补充一点,我维护的代码库使用了过时的spring版本——较新的实现可能没有同样的问题