File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Could not read mappings from resource: previtc/model/task/PcTaskAssignee.hbm.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Could not read mappings from resource: previtc/model/task/PcTaskAssignee.hbm.xml" Watch "Could not read mappings from resource: previtc/model/task/PcTaskAssignee.hbm.xml" New topic
Author

Could not read mappings from resource: previtc/model/task/PcTaskAssignee.hbm.xml

Renato Bobbio Calogero
Greenhorn

Joined: Apr 20, 2011
Posts: 18
Hi everybody ! Nice to meet you all ! I am new to this forum, and I am new to Hibernate, which I shall use 'cause I inherited an old dirty project from another company . Long story short, I have two javabeans named PcTask.java and PcTaskAssignee.java ;

I've defined the two beans, with their getters and setters, as follows :



and its mapping in file PcTaskAssignee.hbm.xml , placed in the same directory



then , I have the same for PcTask :



and its mapping for Hibernate, which is placed under the same directory , in file PcTask.hbm.xml



I am using Oracle 10g, Java 1.4 and OC4J container, but when I try to deploy the following error happens (I'll post the full stack trace) :

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)

Any suggestion would be so much appreciated, I need help bad 'cause this is for work

Thanks again , bye!

Renato
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Could not read mappings from resource: previtc/model/task/PcTaskAssignee.hbm.xml
 
Similar Threads
Hibernate Query by Example
//question of comment
Problem with Hibernate test application
jax-ws complex nested type is killing me
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]