I’m experiencing the same problem when trying to use the latest Hibernate Tools for browsing an already existing project. (hibernate-tools-3.0alpha1.tar.gz)
When creating the SessionFactory under ‘Hibernate Configurations’ I’ll get the described MappingException.
Code:
Caused by: org.hibernate.MappingException: invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:391)
at org.hibernate.cfg.Configuration.addFile(Configuration.java:238)
... 27 more
Caused by: org.xml.sax.SAXParseException: Attribute "lazy" is not declared for element "many-to-one".
at org.apache.crimson.parser.Parser2.error(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.content(Unknown Source)
at org.apache.crimson.parser.Parser2.maybeElement(Unknown Source)
at org.apache.crimson.parser.Parser2.parseInternal(Unknown Source)
at org.apache.crimson.parser.Parser2.parse(Unknown Source)
at org.apache.crimson.parser.XMLReaderImpl.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:334)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:390)
... 28 more
The Hibernate mappings work fine in the existing project.