Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to read schema document 'http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd
    text
    copied!<p>I'm writing a simple Swing app for university and using Hibernate and Oracle XE.</p> <p>I'm stuck with that error:</p> <pre><code> 29.06.2011 14:54:10 org.hibernate.cfg.annotations.Version &lt;clinit&gt; INFO: Hibernate Annotations 3.3.1.GA 29.06.2011 14:54:10 org.hibernate.cfg.Environment &lt;clinit&gt; INFO: Hibernate 3.2.5 29.06.2011 14:54:10 org.hibernate.cfg.Environment &lt;clinit&gt; INFO: hibernate.properties not found 29.06.2011 14:54:10 org.hibernate.cfg.Environment buildBytecodeProvider INFO: Bytecode provider name : cglib 29.06.2011 14:54:10 org.hibernate.cfg.Environment &lt;clinit&gt; INFO: using JDK 1.4 java.sql.Timestamp handling 29.06.2011 14:54:10 org.hibernate.ejb.Version &lt;clinit&gt; INFO: Hibernate EntityManager 3.3.2.GA 29.06.2011 14:54:31 org.hibernate.ejb.packaging.PersistenceXmlLoader$ErrorLogger warning WARNING: Warning parsing XML: XML InputStream(2) schema_reference.4: Failed to read schema document 'http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not &lt;xsd:schema&gt;. 29.06.2011 14:54:52 org.hibernate.ejb.packaging.PersistenceXmlLoader$ErrorLogger warning </code></pre> <p>my persistence.xml:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt; &lt;persistence-unit name="airportPU"&gt; &lt;provider&gt;org.hibernate.ejb.HibernatePersistence&lt;/provider&gt; &lt;class&gt;my.airport.model.Crew&lt;/class&gt; &lt;class&gt;my.airport.model.Country&lt;/class&gt; &lt;class&gt;my.airport.model.City&lt;/class&gt; &lt;class&gt;my.airport.model.Plane&lt;/class&gt; &lt;class&gt;my.airport.model.Model&lt;/class&gt; &lt;class&gt;my.airport.model.Passenger&lt;/class&gt; &lt;class&gt;my.airport.model.Role&lt;/class&gt; &lt;class&gt;my.airport.model.Airport&lt;/class&gt; &lt;class&gt;my.airport.model.Spec&lt;/class&gt; &lt;class&gt;my.airport.model.AverageFlightTime&lt;/class&gt; &lt;class&gt;my.airport.model.CrewInTheRoleOnTheFlight&lt;/class&gt; &lt;class&gt;my.airport.model.Flight&lt;/class&gt; &lt;class&gt;my.airport.model.PassengersOnTheFlight&lt;/class&gt; &lt;properties&gt; &lt;property name="javax.persistence.jdbc.url" value="jdbc:oracle:thin:@172.16.0.3:1521:XE"/&gt; &lt;property name="javax.persistence.jdbc.password" value="AIRPORT"/&gt; &lt;property name="javax.persistence.jdbc.driver" value="oracle.jdbc.OracleDriver"/&gt; &lt;property name="javax.persistence.jdbc.user" value="AIRPORT"/&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p>Creating entity manager factory:</p> <pre><code>public static EntityManagerFactory emf; public static EntityManager em; static { try { emf = Persistence.createEntityManagerFactory("airportPU"); em = emf.createEntityManager(); } catch (Exception e) { System.exit(1); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload