Premature end of file on beans.xml

Viewed 928

The contents of the 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
2 Answers

Change your xsd file location to: 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.

Because Oracle site is recently very unstable, I ended with local beans_1_1.xsd, bundled along with XML file:

<?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>
Related