-->
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.  [ 21 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: SAXParseException: Attribute "extends" must be dec
PostPosted: Sun Jan 04, 2004 10:24 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
When I used hbm2java, I got the following error message:
Code:
SAXParseException: Attribute "extends" must be declared for element type "joined-subclass".

my hbm.xml file is as follows:
Code:
<hibernate-mapping>
    <joined-subclass
       name="com.hhy.cim302.BusinessUnit"
       extends="com.hhy.core.Resource"
       table="cim_302_businessunit">
      <key column="resourceId"/>
      <property name="businessUnitName"
              column="businessunitname"
              type="string"
              length="50"/>
      <property name="businessUnitDescription"
              column="businessunitdescr"
              type="string"
              length="50"/>
      <!--(1,*) to (1)-->
       <many-to-one name="companyID" column="companyid" class="com.hhy.core.Company"/>
    </joined-subclass>
</hibernate-mapping>

I once saw a similar hbm.xml file in Hibernate2.1 package:
Code:
<hibernate-mapping>
        <joined-subclass
           name="org.hibernate.test.Mono"
           extends="org.hibernate.test.Top"
           table="mono"
           dynamic-insert="true"
          dynamic-update="true">
           <key column="superid"/>
           <set name="strings" table="monostrings">
              <key column="monoid_"/>
              <element type="string" column="str_"/>
           </set>
        </joined-subclass>
</hibernate-mapping>

It's too weird that I couldn't find out even one error in my hbm.xml file !


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 10:27 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
The intact error info is as follows:
Code:
[hbm2java] (hbm2java.CodeGenerator              48  ) Error parsing XML: file:/F:/DB/hbm/gensrc/com/hhy/cim302/BusinessUnit.hbm.xml(10)
[hbm2java] org.xml.sax.SAXParseException: Attribute "extends" must be declared for element type "joined-subclass".
[hbm2java]    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
[hbm2java]    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[hbm2java]    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)
[hbm2java]    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:707)
[hbm2java]    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:689)
[hbm2java]    at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:98)
[hbm2java]    at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]    at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]    at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]    at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]    at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]    at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]    at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]    at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] (hbm2java.CodeGenerator              48  ) Error parsing XML: file:/F:/DB/hbm/gensrc/com/hhy/cim302/BusinessUnit.hbm.xml(23)
[hbm2java] org.xml.sax.SAXParseException: The content of element type "hibernate-mapping" must match "(meta*,import*,class*,query*)".
[hbm2java]    at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
[hbm2java]    at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
[hbm2java]    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
[hbm2java]    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
[hbm2java]    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:354)
[hbm2java]    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:707)
[hbm2java]    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:689)
[hbm2java]    at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:98)
[hbm2java]    at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]    at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]    at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]    at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]    at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]    at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]    at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]    at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]    at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]    at org.apache.tools.ant.Main.main(Main.java:235)


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 12:52 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
best guess you are referring to an old dtd - or have not yet updated to a recent version of hibernate.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 2:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate don't use jdom since 2.0beta6. Upgrade to latest version.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 8:35 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
I'm using hibernate 2.1 right now.
So, your advises is really good but does not work well.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 8:50 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
My computering environment is :
win2000, ant-1.5.4, j2sdk1.4.2_03, hibernate 2.1-final

_________________
/Eileen


Top
 Profile  
 
 Post subject:
PostPosted: Sun Jan 04, 2004 9:29 pm 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
ffeliza wrote:
My computering environment is :
win2000, ant-1.5.4, j2sdk1.4.2_03, hibernate 2.1-final

Sorry, I omitted something: I'm using hibernate-extensions 2.0.2

_________________
/Eileen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You are picking up an old version of the DTD from somewhere in your classpath (perhaps in hibernate-extensions)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:47 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
My .bat file is :
Code:
set JDBC_DRIVER=D:\oracle\ora92\jdbc\lib\classes12.zip
set HIBERNATE_HOME=F:\DB\hibernate-2.1

set CORELIB=%HIBERNATE_HOME%\lib
set LIB=..\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\ant.jar;%LIB%\c3p0.jar;%LIB%\commons-pool.jar;%LIB%\commons-dbcp.jar;%LIB%\commons-beanutils.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib-asm.jar;%LIB%\connector.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar;C:\j2sdk1.4.2_03\lib;C:\j2sdk1.4.2_03\bin;%JDBC_DRIVER%
set CLASSPATH=for %%i in (F:\DB\hbm\lib\*.jar) do set CLASSPATH=!CLASSPATH!;%1 %%i

When I used hbm2java the first time, I put mapping definitions of all classes in one .hbm.xml file. And the .bat file mentioned above did work very well.

Now, I seperate the terribly large .hbm.xml file into several files, that is one class-one file. And I get the error message above.

_________________
/Eileen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 2:02 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
All jars in F:\DB\hbm\lib are:
Code:
ant.jar
c3p0.jar
cglib-asm.jar
cglib2.jar
commons-beanutils.jar
commons-collections.jar
commons-dbcp.jar
commons-lang.jar
commons-logging.jar
commons-pool.jar
concurrent.jar
connector.jar
dom4j.jar
ehcache.jar
hibern8ide.jar
hibernate-tools.jar
hibernate2.jar
hsqldb.jar
jaas.jar
jboss-cache.jar
jboss-common.jar
jboss-jmx.jar
jboss-system.jar
jcs.jar
jdbc2_0-stdext.jar
jdom.jar
jgroups.jar
joi-ext.jar
jta.jar
junit.jar
log4j-1.2.8.jar
log4j.jar
maven-xdoclet-plugin-1.2b4.jar
middlegen-2.0-b2-dev.jar
middlegen-hibernate-plugin-2.0-b2-dev.jar
odmg.jar
optional.jar
oscache.jar
pf-joi-full.jar
proxool.jar
swarmcache.jar
tools.jar
velocity-1.4-dev.jar
xalan.jar
xdoclet-1.2b4.jar
xdoclet-hibernate-module-1.2b4.jar
xdoclet-xdoclet-module-1.2b4.jar
xerces.jar
xjavadoc-1.0.jar
xml-apis.jar

_________________
/Eileen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 2:21 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
Code:
set JDBC_DRIVER=D:\oracle\ora92\jdbc\lib\classes12.zip
set HIBERNATE_HOME=F:\DB\hibernate-2.1

set CORELIB=%HIBERNATE_HOME%\lib
set LIB=..\lib
set PROPS=%HIBERNATE_HOME%\src
set CP=%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\ant.jar;%LIB%\c3p0.jar;%LIB%\commons-pool.jar;%LIB%\commons-dbcp.jar;%LIB%\commons-beanutils.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib-asm.jar;%LIB%\connector.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar;C:\j2sdk1.4.2_03\lib;C:\j2sdk1.4.2_03\bin;%JDBC_DRIVER%
set CLASSPATH=for %%i in (F:\DB\hbm\lib\*.jar) do set CLASSPATH=!CLASSPATH!;%1 %%i

After I delete the sixth line of "set CP=%PROPS%;%HIBERNATE_HOME%\hibernate2.jar;%LIB%\ant.jar;%LIB%\c3p0.jar;%LIB%\commons-pool.jar;%LIB%\commons-dbcp.jar;%LIB%\commons-beanutils.jar;%LIB%\commons-logging.jar;%LIB%\commons-collections.jar;%LIB%\commons-lang.jar;%LIB%\cglib-asm.jar;%LIB%\connector.jar;%LIB%\dom4j.jar;%LIB%\odmg.jar;%LIB%\jdom.jar;%LIB%\xml-apis.jar;%LIB%\xerces.jar;%LIB%\xalan.jar;C:\j2sdk1.4.2_03\lib;C:\j2sdk1.4.2_03\bin;%JDBC_DRIVER%", the error message changes to :
Code:
h2j:
[hbm2java] Processing 12 files.
[hbm2java] Building hibernate objects
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.PowerSystem
Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.PowerSystem
Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.PowerSystem
Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.Resource
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
[hbm2java] net.sf.hibernate.MappingException: Cannot extend unmapped class com.hhy.core.EquipmentCo
ntainer
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.handleClass(CodeGenerator.java:137)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:109)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.processFile(Hbm2JavaTask.java:145)
[hbm2java]     at net.sf.hibernate.tool.hbm2java.Hbm2JavaTask.execute(Hbm2JavaTask.java:95)
[hbm2java]     at org.apache.tools.ant.Task.perform(Task.java:341)
[hbm2java]     at org.apache.tools.ant.Target.execute(Target.java:309)
[hbm2java]     at org.apache.tools.ant.Target.performTasks(Target.java:336)
[hbm2java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[hbm2java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[hbm2java]     at org.apache.tools.ant.Main.runBuild(Main.java:609)
[hbm2java]     at org.apache.tools.ant.Main.start(Main.java:196)
[hbm2java]     at org.apache.tools.ant.Main.main(Main.java:235)
     [copy] Copying 4 files to F:\DB\hbm\src
     [copy] Copying 12 files to F:\DB\hbm\src

Actually, Class "Resource" has already been mapped so succefully that I can find Resource.java file in the "src" directory.

_________________
/Eileen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 3:09 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
That's probably just because hbm2java write all those java files it can do without problems. Resource.hbm.xml is probably processed AFTER those errors.

When using the extends attribute (as per documentation) then the sequence of the hbm.xml's matters! So, list the superclasses first then later the subclasses.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 3:45 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
max wrote:
That's probably just because hbm2java write all those java files it can do without problems. Resource.hbm.xml is probably processed AFTER those errors.

When using the extends attribute (as per documentation) then the sequence of the hbm.xml's matters! So, list the superclasses first then later the subclasses.

God! I forgot listing my .cfg.xml file here!
Thank you for your advise, Max. But my .cfg.xml is really perfect !
Code:
<hibernate-configuration>

    <session-factory>
        <property name="connection.url">jdbc:oracle:thin@xzy:1521:grid</property>
        <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
        <property name="connection.username">cim</property>
        <property name="connection.password">cim</property>
        <property name="show_sql">true</property>
        <property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>

        <mapping resource="/com/hhy/core/CimClass.hbm.xml"/>
        <mapping resource="/com/hhy/core/Resource.hbm.xml"/>
        <mapping resource="/com/hhy/core/CimProperty.hbm.xml"/>
        <mapping resource="/com/hhy/core/PowerSystemResource.hbm.xml"/>
        <mapping resource="/com/hhy/cim302/BusinessUnit.hbm.xml"/>
        <mapping resource="/com/hhy/core/BaseVoltage.hbm.xml"/>
        <mapping resource="/com/hhy/core/ProtectionEquipment.hbm.xml"/>
        <mapping resource="/com/hhy/core/EquipmentContainer.hbm.xml"/>
        <mapping resource="/com/hhy/core/ConductingEquipment.hbm.xml"/>
        <mapping resource="/com/hhy/core/VoltageLevel.hbm.xml"/>
        <mapping resource="/com/hhy/core/Company.hbm.xml"/>
        <mapping resource="/com/hhy/core/PSRType.hbm.xml"/>

    </session-factory>
</hibernate-configuration>

_________________
/Eileen


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 4:23 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ffeliza wrote:
max wrote:
That's probably just because hbm2java write all those java files it can do without problems. Resource.hbm.xml is probably processed AFTER those errors.

When using the extends attribute (as per documentation) then the sequence of the hbm.xml's matters! So, list the superclasses first then later the subclasses.

God! I forgot listing my .cfg.xml file here!
Thank you for your advise, Max. But my .cfg.xml is really perfect !


Unfortunately does hbm2java not use cfg.xml yet!
It is the sequence of parameters given to hbm2java that matters.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 4:46 am 
Beginner
Beginner

Joined: Wed Oct 29, 2003 5:27 am
Posts: 30
max wrote:
Unfortunately does hbm2java not use cfg.xml yet!
It is the sequence of parameters given to hbm2java that matters.

Oh, How stupid am I !!!

Can I set the sequence of those parameters in my build.xml ?
Like:
Code:
<target name="h2j"
        description="Generate .java from .hbm files.">

        <hbm2java config="${build.dir}/hibernate.cfg.xml"
            output="${gendes.dir}">

            <fileset dir="${gensrc.dir}">
               <include name="com/hhy/core/CimClass.hbm.xml"/>
                <include name="com/hhy/core/Resource.hbm.xml"/>
                <include name="com/hhy/core/CimProperty.hbm.xml"/>
                <include name="com/hhy/core/PowerSystemResource.hbm.xml"/>
                <include name="com/hhy/cim302/BusinessUnit.hbm.xml"/>
                <include name="com/hhy/core/BaseVoltage.hbm.xml"/>
                <include name="com/hhy/core/ProtectionEquipment.hbm.xml"/>
                <include name="com/hhy/core/EquipmentContainer.hbm.xml"/>
                <include name="com/hhy/core/ConductingEquipment.hbm.xml"/>
                <include name="com/hhy/core/VoltageLevel.hbm.xml"/>
                <include name="com/hhy/core/Company.hbm.xml"/>
                <include name="com/hhy/core/PSRType.hbm.xml"/>
            </fileset>
        </hbm2java>

When I set parameters like above, I still got the same error message. And I don't want to set thest long long long parameters in command line!

Thank you, max!

_________________
/Eileen


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 21 posts ]  Go to page 1, 2  Next

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.