File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Attribute "value" must be declared for element type "property"???" Watch "Attribute "value" must be declared for element type "property"???" New topic
Author

Attribute "value" must be declared for element type "property"???

Angus McIntosh
Greenhorn

Joined: Jan 28, 2009
Posts: 12
I don't understand where this exception comes from!

This is my hibernate.cfg.xml



and then I get this from my webapp when I try to persist:



But I don't see a "value" attribute anywhere to complain about!

Help me please!
Kadle Rajesh
Greenhorn

Joined: Jan 16, 2007
Posts: 11
Please validate your XML. You can validate it online at : http://tools.decisionsoft.com/schemaValidate/
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

The XML looks valid. The DTD doesn't specify a value attribute for the property element (hence the error), however no property element in Angus's xml file has a value attribute. Which leads me to think that perhaps there is another invalid hibernate.cfg.xml file kicking around in your deployment maybe?

(In addition to the online tool you suggest you can just use IE to validate XML against schemas).


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Angus McIntosh
Greenhorn

Joined: Jan 28, 2009
Posts: 12
I feel silly

I was editing the hibernate.cfg.xml in my sources directory and not the one in my classes directory.

Sorry for wasting your time!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Attribute "value" must be declared for element type "property"???