Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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!
 
Ever since I found this suit I've felt strange new needs. And a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic