Search code examples
javajakarta-eejbossjavabeans

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

Solution

  • 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.