-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to turn off validation with JPA 1.0
PostPosted: Sun Aug 15, 2010 1:56 pm 
Beginner
Beginner

Joined: Thu May 20, 2010 12:31 pm
Posts: 28
How do you turn off bean validation with JPA 1.0?

I tried several things with persistence.xml:

Code:
  <persistence-unit name="bbstats" transaction-type="RESOURCE_LOCAL">
    <properties>

      DB stuff
     
      <property name="javax.persistence.validation.mode" value="none" />
      <property name="hibernate.validator.autoregister_listeners" value="false" />
    </properties>
    <validation-mode>NONE</validation-mode>
  </persistence-unit>


The last one causing

org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'validation-mode'. One of '{"http://java.sun.com/xml/ns/persistence":jta-data-source, "http://java.sun.com/xml/ns/persistence":non-jta-data-source, "http://java.sun.com/xml/ns/persistence":mapping-file, "http://java.sun.com/xml/ns/persistence":jar-file, "http://java.sun.com/xml/ns/persistence":class, "http://java.sun.com/xml/ns/persistence":exclude-unlisted-classes, "http://java.sun.com/xml/ns/persistence":properties}' is expected.

But nothing of the above work. Can anyone tell me how to do it on a JPA 1.0 implementation?

Karsten


Top
 Profile  
 
 Post subject: Re: How to turn off validation with JPA 1.0
PostPosted: Mon Aug 16, 2010 5:35 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
What versions of Hibernate Core and Validator are you using? Do you want to do manual validation or do you not need validation at all?

--Hardy


Top
 Profile  
 
 Post subject: Re: How to turn off validation with JPA 1.0
PostPosted: Thu May 19, 2011 12:35 pm 
Newbie

Joined: Thu May 19, 2011 12:26 pm
Posts: 1
I am getting same problem. Can you please suggest solution for the same. Using below jars

Hibernate Core - 3.5.1-Final
Hibernate validator - 4.0.2.GA
Hibernate JPA - 2.0-api-1.0.0.Final


Top
 Profile  
 
 Post subject: Re: How to turn off validation with JPA 1.0
PostPosted: Fri May 20, 2011 3:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
With JPA2 you are setting the property javax.persis- tence.validation.mode to none.


Top
 Profile  
 
 Post subject: Re: How to turn off validation with JPA 1.0
PostPosted: Fri May 20, 2011 4:01 am 
Contributor
Contributor

Joined: Mon Feb 28, 2011 7:27 pm
Posts: 20
Location: France
Hi,

Could you provide a subset of your persistence.xml with the interesting parts (validation-mode, namespaces declaration, ...)?

I've looked at the JPA2 spec (http://www.jcp.org/en/jsr/detail?id=317) and the validation-mode is allowed in the persistence.xml file (see section 3.6.1.1). Just one thought, are you using the right xml schema (if you have this error :)?

--Kevin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.