-->
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.  [ 6 posts ] 
Author Message
 Post subject: Add ability to disable XML Validation
PostPosted: Mon Mar 06, 2006 2:02 pm 
Newbie

Joined: Mon Mar 06, 2006 1:43 pm
Posts: 1
My problem is that there is no way to have Hibernate not call setValidate(true) on the Dom4J SAXReader created in the org.hibernate.util.XMLHelper, line 39 which is needed to use the non-validating XML parser Piccolo.

To see the problem, get a system working with Xerces. Then download Piccolo from http://piccolo.sourceforge.net/index.html and add -Djavax.xml.parsers.SAXParserFactory=com.bluecast.xml.JAXPSAXParserFactory to your startup parameters.

I've patched the local copy of my source to set validation to false and am not seeing any negative impacts of this change.

Two questions:
1. Are there any negative side effects to this that I'm not seeing? Is validation required for some feature I'm not using?

2. What would be the Hibernate-appropriate way to pass the validation flag as a parameter? Seems like Configuration.setProperty would be the most approriate way. Any conventions on property names?


Thanks for your time,

Randy


Hibernate version: 3.0.5

Mapping documents: Any

Code between sessionFactory.openSession() and session.close(): Error occurs on configure, before openSession

Full stack trace of any exception that occurs:

Code:
Nested exception:
org.xml.sax.SAXNotSupportedException: validation is not supported
        at com.bluecast.xml.Piccolo.setFeature(Piccolo.java:922)
        at org.dom4j.io.SAXReader.configureReader(SAXReader.java:944)
        at org.dom4j.io.SAXReader.read(SAXReader.java:463)
        at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1168)
        at org.hibernate.cfg.Configuration.configure(Configuration.java:1146)



Name and version of the database you are using: Any (seen with HSML and MySQL)

The generated SQL (show_sql=true): None.

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 07, 2006 1:41 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
hbm xml files might be screwed up and users would raise ununderstandable questions on the forum. The validation is left intentionaly

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 24, 2006 7:08 am 
Newbie

Joined: Mon Jul 26, 2004 4:55 am
Posts: 4
Hi,

I'm behind a proxy. Sax is trying to validate the hibernate config by downloading the dtd which fails.

It would be really interesting to disable the xml validation !!

Is there another way of make it work?

Thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 10:29 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
well you can define a proxy to the vm.
But I don't understand why your parser tries to access the internet. Hibernate preven that by defining a EntityREsolver which tries locally to look up hibernate dtd and schemas

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 27, 2006 11:15 pm 
Pro
Pro

Joined: Tue Aug 26, 2003 8:07 pm
Posts: 229
Location: Brisbane, Australia
http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html for info on how to define a proxy, but if you do that you're just being lazy.

Hibernate provides a custom EntityResolver in order to solve the issue of resolving the DTD without network access, but that doesn't do squat unless your parser actually supports custom EntityResolver objects.

The problem is with the parser you're using. Either use a different one, or upgrade the version of the one you're using.

_________________
Cheers,
Shorn.


Top
 Profile  
 
 Post subject: Re: Add ability to disable XML Validation
PostPosted: Tue May 31, 2011 10:18 am 
Newbie

Joined: Tue May 31, 2011 10:12 am
Posts: 4
In my case, I need Piccolo for performance reasons, but this lib replaces de jaxp. So I need some low level disabling option for xml parsing.

Please note the the error mentioned occurs even if you use a properties file instead the xml.

I'm using hibernate 3.6.2.Final.

Tx in advance


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