Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Premature end of file on beans.xml

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
like image 565
hEngi Avatar asked Sep 19 '25 08:09

hEngi


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.

like image 177
Mateusz Avatar answered Sep 20 '25 21:09

Mateusz


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>
like image 45
Jacek Grobelny Avatar answered Sep 20 '25 21:09

Jacek Grobelny