-->
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.  [ 4 posts ] 
Author Message
 Post subject: Attribute "role" is required and must be specified
PostPosted: Wed Oct 01, 2003 4:25 pm 
Newbie

Joined: Wed Oct 01, 2003 10:51 am
Posts: 5
type set.

Why is this happening, I don't see that requeriement in any of the examples.

[INFO] Environment - -Hibernate 2.0.2
[INFO] Environment - -loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect, hibernate.connection.username=db2admin, hibernate.connection.url=jdbc:db2:strutsdb, hibernate.show_sql=true, hibernate.connection.password=db2admin, hibernate.connection.pool_size=20, hibernate.statement_cache.size=6}
[INFO] Environment - -using CGLIB reflection optimizer
[INFO] Environment - -JVM proxy support: true
[INFO] Configuration - -Mapping file: Job.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Job -> JOB
[INFO] Configuration - -Mapping file: Product.hbm.xml
[ERROR] XMLHelper - -Error parsing XML: Product.hbm.xml(46) <org.xml.sax.SAXParseException: Attribute "role" is required and must be specified for element type "set".>org.xml.sax.SAXParseException: Attribute "role" is required and must be specified for element type "set".
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.dom4j.io.SAXReader.read(SAXReader.java:219)
at net.sf.hibernate.cfg.Configuration.addFile(Configuration.java:155)
at com.ibm.hibernate_article.HibernateTest.<clinit>(HibernateTest.java:43)
at java.lang.reflect.Constructor.newInstance(Native Method)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:102)
at junit.framework.TestSuite.<init>(TestSuite.java:66)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.getTest(RemoteTestRunner.java:270)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:307)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2003 4:51 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You're using hibernate 2.x and your xml file refet to the 1.1 DTD.
In Product.hbm.xml, change the DTD to
Code:
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 9:41 am 
Newbie

Joined: Thu Feb 26, 2004 9:37 am
Posts: 5
Location: Brussels
I had a similar problem, for similar reasons.
I tried the fix and it didn't work. Then I looked best and smiled.

I suggest you try the following instead

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

It worked for me.

_________________
Phil


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 26, 2004 9:44 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Typo :)

_________________
Emmanuel


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