Just to make it work, I had removed the mapping and focused on other use cases . Result : I've broken my web app, and I really can't see why. The original problem is not the problem anymore: my OC4J won't start , saying
11/04/20 10:13:47 InitServlet - org.hibernate.
MappingException: Could not read mappings from resource: previtc/model/task/PcTaskAssignee.hbm.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:484)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1443)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1411)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1392)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1368)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1288)
at previtc.Resources.init(Resources.java:156)
at previtc.controller.InitServlet.init(InitServlet.java:34)
at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2354)
at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4795)
at com.evermind.server.http.HttpApplication.initPreloadServlets(HttpApplication.java:4889)
at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1015)
at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)
at com.evermind.server.Application.getHttpApplication(Application.java:890)
at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)
at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)
at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)
at oracle.oc4j.admin.internal.WebApplicationBinder.bindWebApp(WebApplicationBinder.java:173)
at com.evermind.server.administration.DefaultApplicationServerAdministrator.bindWebApp(DefaultApplicationServerAdministrator.java:415)
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 com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.hibernate.MappingException: invalid mapping
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:424)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:481)
... 26 more
Caused by: org.xml.sax.SAXParseException:
Attribute "insert" must be declared for element type "key-property". 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:465)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:421)
it is mandatory to fix the problem before worrying about the many-to-one stuff! :( as long as you've been the only one giving me some hints, I'm telling you, I'm wondering why this exception raised , considering the same things said before, apart from removing the one to many mapping we said, putting my xml back to the roots :
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="previtc.model.task">
<class name="previtc.model.task.PcTaskAssignee" table="PC_TASKASSIGNEE" dynamic-update="true" dynamic-insert="true">
<composite-id>
<key-property name="taskId" type="string" column="TASKID" />
<key-property name="version" type="double" column="VERSION" />
<key-property name="assignee" type="string" column="ASSIGNEE"/>
</composite-id>
<property name="phone" type="string" column="PHONE" />
<property name="email" type="string" column="EMAIL" />
<property name="guid" type="string" column="GUID" />
<property name="isGroup" type="string" column="ISGROUP"/>
</class>
</hibernate-mapping>
and
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="previtc.model.task">
<class name="PcTask" table="PC_TASK" dynamic-update="true" dynamic-insert="true">
<id name="taskId" column="TASKID" type="string">
<generator class="sequence">
<param name="sequence">PC_TASK_ID_SEQ</param>
</generator>
</id>
<property name="taskNumber" column="TASKNUMBER" type="double" />
<property name="acquiredBy" column="ACQUIREDBY" type="string" />
<property name="approvers" column="APPROVERS" type="string" />
<property name="comment1" column="COMMENT1" type="string" />
<property name="comment2" column="COMMENT2" type="string" />
<property name="comment3" column="COMMENT3" type="string" />
<property name="comment4" column="COMMENT4" type="string" />
<property name="comment5" column="COMMENT5" type="string" />
<property name="conclusion" column="CONCLUSION" type="string" />
<property name="createdDate" column="CREATEDDATE" type="date" />
<property name="creator" column="CREATOR" type="string" />
<property name="domainId" column="DOMAINID" type="string" />
<property name="expirationDate" column="EXPIRATIONDATE" type="date" />
<property name="expirationDuration" column="EXPIRATIONDURATION" type="string" />
<property name="flexDate1" column="FLEXDATE1" type="date" />
<property name="flexDate2" column="FLEXDATE2" type="date" />
<property name="flexDate3" column="FLEXDATE3" type="date" />
<property name="flexDouble1" column="FLEXDOUBLE1" type="double" />
<property name="flexDouble2" column="FLEXDOUBLE2" type="double" />
<property name="flexLong1" column="FLEXLONG1" type="double" />
<property name="flexLong2" column="FLEXLONG2" type="double" />
<property name="flexString1" column="FLEXSTRING1" type="string" />
<property name="flexString2" column="FLEXSTRING2" type="string" />
<property name="flexString3" column="FLEXSTRING3" type="string" />
<property name="flexString4" column="FLEXSTRING4" type="string" />
<property name="identificationKey" column="IDENTIFICATIONKEY" type="string" />
<property name="instanceId" column="INSTANCEID" type="string" />
<property name="isGroup" column="ISGROUP" type="string" />
<property name="isHassubTask" column="ISHASSUBTASK" type="string" />
<property name="modifyDate" column="MODIFYDATE" type="date" />
<property name="notm" column="NOTM" type="integer"/>
<property name="owner" column="OWNER" type="string" />
<property name="pattern" column="PATTERN" type="string" />
<property name="priority" column="PRIORITY" type="integer"/>
<property name="processId" column="PROCESSID" type="string" />
<property name="processName" column="PROCESSNAME" type="string" />
<property name="processOwner" column="PROCESSOWNER" type="string" />
<property name="processVersion" column="PROCESSVERSION" type="string" />
<property name="state" column="STATE" type="string" />
<property name="substate" column="SUBSTATE" type="string" />
<property name="systemString1" column="SYSTEMSTRING1" type="string" />
<property name="systemString2" column="SYSTEMSTRING2" type="string" />
<property name="systemString3" column="SYSTEMSTRING3" type="string" />
<property name="taskGroupId" column="TASKGROUPID" type="string" />
<property name="taskType" column="TASKTYPE" type="string" />
<property name="title" column="TITLE" type="string" />
<property name="updatedBy" column="UPDATEDBY" type="string" />
<property name="version" column="VERSION" type="integer" />
<property name="versionReason" column="VERSIONREASON" type="string" />
</class>
</hibernate-mapping>
do you have any ideas ? I'm sorry to bother you, but I'm really stuck!