-->
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.  [ 7 posts ] 
Author Message
 Post subject: Parsing hbm.xml file error
PostPosted: Mon Oct 13, 2003 5:22 am 
Newbie

Joined: Fri Sep 26, 2003 6:17 am
Posts: 5
Location: Sydney, Australia
Hi,

I just downloaded nightly snapshot for Hibernate Tools to see how hbm2java really works. I compiled the source code in eclipse and tried to parse Fligh.hbm.xml file generated by middlegen. But I received following error. Does anyone know why I'm receiving this?



Code:
10 [main] ERROR hbm2java.CodeGenerator  - Error parsing XML: file:/D:/Study/Programming/Java/EclipseProject/hibernate-tool/hbm/airline/Flight.hbm.xml(23)
org.xml.sax.SAXParseException: Attribute "generator-class" is not declared for element "id".
   at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
   at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1411)
.....................................
   at org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
   at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:98)
20 [main] ERROR hbm2java.CodeGenerator  - Error parsing XML: file:/D:/Study/Programming/Java/EclipseProject/hibernate-tool/hbm/airline/Flight.hbm.xml(27)
org.xml.sax.SAXParseException: Attribute "not-null" is not declared for element "id".
   at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
   at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1411)
.........................................   
at org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
   at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:98)
30 [main] ERROR hbm2java.CodeGenerator  - Error parsing XML: file:/D:/Study/Programming/Java/EclipseProject/hibernate-tool/hbm/airline/Flight.hbm.xml(28)
org.xml.sax.SAXParseException: Element "id" requires additional elements.
   at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
   at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.done(ValidatingParser.java:361)
.............................................
   at org.jdom.input.SAXBuilder.build(SAXBuilder.java:703)
   at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:98)


Thanks in advance,

Ryosuke Mori


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 5:34 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...best guess - you are using the wrong dtd for the hbm.xml...or you are using the right dtd, but have bad xml ;)

...it is a DTD validation error, not anything specific to hbm2java (or at least, it does not look like it)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 8:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
From the name you are using the standard example so unless you are using the experimental version of the plugin (which does not generate correct xml). Otherwise, I would expect the result to be accurate. The latest is release 2 from Source forge Hibernate downloads. If this is the version you are using then provide the mapping file in question.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 1:40 pm 
Newbie

Joined: Fri Sep 26, 2003 6:17 am
Posts: 5
Location: Sydney, Australia
Again it seems like I was using old version of Hibernate plugin for Middlegen. What I did was I got Middlegen's source code from its CVS and generated hbm.xml files from the code I compiled in Eclipse. However, the version of hibernate plugin source code in the Middlegen's CVS is very old and not compaible with current version of hibernate. (hibernate.vm file is totally different).

I might post this message to Middlegen's mailing list.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 3:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
No need to post they already should know. You got the experimental version of the plugin which is very broken. Middlgen CVS Head it is also a broken version of Middlegen and is not being worked on at all. The correct version is Tagged with 'VALUEOBJECT_REFACTORING_BRANCH'. This branch is the base for the version 3.0 effort.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 4:27 am 
Newbie

Joined: Fri Sep 26, 2003 6:17 am
Posts: 5
Location: Sydney, Australia
Quote:
The correct version is Tagged ith 'VALUEOBJECT_REFACTORING_BRANCH'


Does everyone have the access to the branch? I get the following error
Code:
cvs [server aborted]: "tag" requires write access to the repository
Error, CVS operation failed


I'm sorry that my question is the way too off topic and not relevent to hibernate at all. This time, I might really need to post my question to middlegen mailing list.... Thank you for your advise, David!

Ryosuke Mori


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 6:44 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
It is OK to continue it here or start a new thread. I spend most of my time here rather than on the Middlegen list. The CVS should work fine. Sourceforge has been giving all readonly CVS users hell lately and I would expect that would be the issue. The release 2 download was the latest version and I have not released any further enhancements as yet.


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