Hibernate version: 2.1.7c
Mapping documents: Field.hbm.xml
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="common.backend.vo.FieldVO" table="FIELD" discriminator-value="field">
<id name="id" type="long" unsaved-value="null">
<column name="ID" not-null="true"/>
<generator class="native">
<param name="sequence">SEQ_FIELD</param>
</generator>
</id>
<discriminator column="LAYOUTTYPE" type="string" insert="false" />
<many-to-one name="pageId" column="PAGEID"
class="common.backend.vo.PageVO"/>
<property name="title" type="string"/>
<property name="ml" type="yes_no"/>
<property name="value" type="string" not-null="false"/>
<property name="editable" type="yes_no"/>
<property name="mandatory" type="yes_no"/>
<property name="inFormula" type="yes_no"/>
<property name="formulaRuleId" type="long"/>
<property name="formulaReferenceFiledId" type="long"/>
<property name="pdvfe" type="yes_no"/>
<property name="size" type="long" column="`SIZE`"/>
<property name="decimalNo" type="long"/>
<property name="valueType" type="string"/>
<property name="isTCO" type="yes_no"/>
<property name="moveToTable" type="string"/>
<property name="moveToColumn" type="string"/>
<property name="comment" type="string" column="`COMMENT`"/>
<property name="showCommentAsToolTip" type="yes_no"/>
<property name="haveCurrency" type="yes_no"/>
<property name="showCurrency" type="string"/>
<property name="haveUnit" type="yes_no"/>
<property name="showUnit" type="string"/>
<many-to-one name="insUserId" column="INSUSERID"
class="common.backend.vo.UserVO"/>
<many-to-one name="updUserId" column="UPDUSERID"
class="common.backend.vo.UserVO"/>
<property name="insDate" type="common.backend.util.CustomDateType"/>
<property name="updDate" type="common.backend.util.CustomDateType"/>
<property name="FilterGroup" type="yes_no"/>
<subclass name="common.backend.vo.layoutTypes.TextVO" discriminator-value="text">
</subclass>
<subclass name="common.backend.vo.layoutTypes.FileVO" discriminator-value="file">
</subclass>
<subclass name="common.backend.vo.layoutTypes.RadioButtonVO" discriminator-value="radioButton">
</subclass>
<subclass name="common.backend.vo.layoutTypes.ComboboxVO" discriminator-value="combobox">
</subclass>
<subclass name="common.backend.vo.layoutTypes.CheckboxVO" discriminator-value="checkbox">
</subclass>
<subclass name="common.backend.vo.layoutTypes.TextareaVO" discriminator-value="textarea">
</subclass>
<subclass name="common.backend.vo.layoutTypes.EmailVO" discriminator-value="email">
</subclass>
<subclass name="common.backend.vo.layoutTypes.PasswordVO" discriminator-value="password">
</subclass>
<subclass name="common.backend.vo.layoutTypes.DateAndTimeVO" discriminator-value="dateAndTime">
</subclass>
<subclass name="common.backend.vo.layoutTypes.ChooseVO" discriminator-value="choose">
</subclass>
</class>
</hibernate-mapping>
Name and version of the database you are using:Oracle 9.2
Debug level Hibernate log excerpt:Code:
net.sf.hibernate.MappingException: Error reading resource: Field.hbm.xml
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:336)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:990)
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:946)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:874)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:860)
at common.backend.util.HibernateUtil.<clinit>(HibernateUtil.java:41)
at common.backend.dao.DictionaryDAO.<init>(DictionaryDAO.java:39)
at common.backend.bu.dictionary.Dictionary.<init>(Dictionary.java:43)
at common.util.SecurityFilter.init(SecurityFilter.java:60)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:225)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:308)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:79)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3698)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4349)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:823)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.apache.catalina.core.StandardContext.init(StandardContext.java:5441)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:149)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:316)
at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:76)
at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:320)
at org.jboss.web.WebModule.startModule(WebModule.java:62)
at org.jboss.web.WebModule.startService(WebModule.java:40)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
at $Proxy18.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:414)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy35.start(Unknown Source)
at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:363)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:821)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy8.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:304)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:478)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:201)
at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:274)
at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:884)
at $Proxy0.start(Unknown Source)
at org.jboss.system.ServiceController.start(ServiceController.java:414)
at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy4.start(Unknown Source)
at org.jboss.deployment.SARDeployer.start(SARDeployer.java:251)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:829)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:641)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:604)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:588)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:62)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:54)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:82)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:197)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
at $Proxy5.deploy(Unknown Source)
at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:407)
at org.jboss.system.server.ServerImpl.start(ServerImpl.java:311)
at org.jboss.Main.boot(Main.java:145)
at org.jboss.Main$1.run(Main.java:399)
at java.lang.Thread.run(Thread.java:534)
Caused by: net.sf.hibernate.MappingException: invalid mapping
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:284)
at net.sf.hibernate.cfg.Configuration.addResource(Configuration.java:333)
... 130 more
Caused by: org.xml.sax.SAXParseException: Attribute "insert" must be declared for element type "discriminator".
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.emptyElement(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.XML11Configuration.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:334)
at net.sf.hibernate.cfg.Configuration.addInputStream(Configuration.java:283)
... 131 more
The error appears on deployment of the ear-file on JBoss 3.2.6. The application doesn't give any errors if I remove
insert="false" from the discriminator tag. The insert attribute of discriminator element is in conformity with the associated dtd. What is the problem? What is the solution?