GeeCON Prague 2014*
The moose likes Object Relational Mapping and the fly likes Eroor Parsing xml: New Error raised Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Eroor Parsing xml: New Error raised" Watch "Eroor Parsing xml: New Error raised" New topic
Author

Eroor Parsing xml: New Error raised

Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
hi,
i faced new exception hen i am trying to run my first program in hibernate in ecliipse...Please find the errors below and suggest me a solution..
Thanks in advance..
Venkat Dasari

14:24:45,531 ERROR XMLHelper:48 - Error parsing XML: /hibernate.cfg.xml(24) The content of element type "session-factory" is incomplete, it must match "(property*,mapping+,(class-cache|collection-cache|jcs-class-cache|jcs-collection-cache)*)".
14:24:45,546 ERROR Configuration:957 - problem parsing configuration/hibernate.cfg.xml
net.sf.hibernate.MappingException: invalid configuration
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:954)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at com.ats.axsis.service.workflow.demo.base._BaseRootDAO.initialize(_BaseRootDAO.java:51)
at com.ats.axsis.service.workflow.demo.base._BaseRootDAO.initialize(_BaseRootDAO.java:38)
at com.ats.axsis.service.workflow.demo.EmpTest2.main(EmpTest2.java:21)
Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" is incomplete, it must match "(property*,mapping+,(class-cache|collection-cache|jcs-class-cache|jcs-collection-cache)*)".
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.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(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 net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:953)
... 5 more
net.sf.hibernate.HibernateException: problem parsing configuration/hibernate.cfg.xml
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:958)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:897)
at net.sf.hibernate.cfg.Configuration.configure(Configuration.java:883)
at com.ats.axsis.service.workflow.demo.base._BaseRootDAO.initialize(_BaseRootDAO.java:51)
at com.ats.axsis.service.workflow.demo.base._BaseRootDAO.initialize(_BaseRootDAO.java:38)
at com.ats.axsis.service.workflow.demo.EmpTest2.main(EmpTest2.java:21)
Caused by: net.sf.hibernate.MappingException: invalid configuration
at net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:954)
... 5 more
Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" is incomplete, it must match "(property*,mapping+,(class-cache|collection-cache|jcs-class-cache|jcs-collection-cache)*)".
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.handleEndElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(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 net.sf.hibernate.cfg.Configuration.doConfigure(Configuration.java:953)
... 5 more
Exception in thread "main"


Regards,<br />Venkat Dasari<br />SCJP 1.4, SCBCD.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
Please post hibernate.cfg.xml file ..


And in <session-factory> tag is have pattern like this

(property*,mapping+,(class-cache|collection-cache|jcs-class-cache|jcs-collection-cache)*)


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
Hi,
i am giving my hibernate.cfg.xml file.please find the errors in it and please notify me if any errors...

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory name="myHibernate" >

<!-- local connection properties -->
<property name="hibernate.connection.url">jdbc racle:thin:@192.168.12.35:1521:Axsis</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.username">atsoltp</property>
<property name="hibernate.connection.password">atsoltp</property>
<!-- property name="hibernate.connection.pool_size"></property -->

<!-- dialect for Oracle (any version) -->
<property name="dialect">net.sf.hibernate.dialect.OracleDialect</property>

<property name="hibernate.show_sql">false</property>
<property name="hibernate.use_outer_join">true</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JTATransactionFactory</property>
<property name="jta.UserTransaction">java:comp/UserTransaction</property>

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

Thanks,
venkat Dasari
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
you MUST have this tag

<mapping resource="somefile.hbm.xml"/>


example


Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
HI,
thanks for helping. I had included it and it's running fine...
 
GeeCON Prague 2014
 
subject: Eroor Parsing xml: New Error raised