简体   繁体   English

beans.xml 上的文件过早结束

[英]Premature end of file on beans.xml

The contents of the xml内容xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
                       http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
   version="1.1" bean-discovery-mode="none">
</beans>

It started to fail with the error:它开始因错误而失败:

Caused by: org.xml.sax.SAXParseException; Premature end of file

Change your xsd file location to: http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/beans_1_1.xsd . 将您的xsd文件位置更改为: http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/beans_1_1.xsd : http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/beans_1_1.xsd It seems that they enforced https, and added redirect, which is not supported. 看来他们实施了https,并添加了重定向,但不支持该重定向。

Because Oracle site is recently very unstable, I ended with local beans_1_1.xsd, bundled along with XML file:由于 Oracle 站点最近非常不稳定,我以本地 beans_1_1.xsd 结束,与 XML 文件一起捆绑:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
                       ./beans_1_1.xsd"
   version="1.1" bean-discovery-mode="none">
</beans>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM