Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please validate your XML. You can validate it online at : http://tools.decisionsoft.com/schemaValidate/
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
Angus McIntosh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic