These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Failed to read schema document persistence_2_0.xsd
PostPosted: Tue Nov 16, 2010 1:27 am 
Newbie

Joined: Tue Nov 16, 2010 1:14 am
Posts: 2
I receive a warning message when attempting to load entity manager.

WARN : org.hibernate.ejb.packaging.PersistenceXmlLoader - Warning parsing XML: XML InputStream(4) 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 <xsd:schema>.


My persistence.xml is as below. I browsed through net but could find very little info on this error. I am using the latest Hibernate Core.

Code:
<persistence 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"
   version="2.0">
   <persistence-unit name="manager1">

      <jta-data-source>jdbc/postgres</jta-data-source>
      
      <!-- By default, Bean Validation (and Hibernate Validator) is activated -->
      
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="validate"/>
         <property name="hibernate.id.new_generator_mappings" value="true"/>
         
           <!-- Enable c3p0 connection pool management -->
           <property name="hibernate.c3p0.min_size" value="5"/>
           <property name="hibernate.c3p0.max_size" value="20"/>
           <property name="hibernate.c3p0.timeout" value="1800"/>
           <property name="hibernate.c3p0.max_statements" value="50"/>
          
           <!-- Enable Hibernate's automatic session context management -->
         <property name="current_session_context_class" value="thread"/>

      </properties>
   
   </persistence-unit>
</persistence>


Thanks for your help in advance,


Top
 Profile  
 
 Post subject: Re: Failed to read schema document persistence_2_0.xsd
PostPosted: Thu Jan 27, 2011 7:04 am 
Newbie

Joined: Thu Jan 27, 2011 6:59 am
Posts: 1
Hi
Did u solved the problem? I am also facing the same problem. Please let me know if got any solution.
Thanks
sekhar


Top
 Profile  
 
 Post subject: Re: Failed to read schema document persistence_2_0.xsd
PostPosted: Thu Jun 30, 2011 11:49 am 
Newbie

Joined: Thu Jun 30, 2011 11:46 am
Posts: 1
Add this directory to the schema location:

http://svn.apache.org/repos/asf/geronim ... ce_2_0.xsd


Top
 Profile  
 
 Post subject: Re: Failed to read schema document persistence_2_0.xsd
PostPosted: Thu Jun 30, 2011 12:43 pm 
Newbie

Joined: Thu Jun 30, 2011 12:33 pm
Posts: 2
What also works (while sun java.net is down) is to remove all schema attributes from the persistence tag...you lose the validation..but rest works fine.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.