Joined: Mon May 05, 2014 10:02 pm Posts: 1
|
Hello All, while running the proram i am getting below exceptions
1. When I kept DTD as 3.0
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
I am getting below exception.
Exception in thread "main" org.hibernate.MappingException: An AnnotationConfiguration instance is required to use <mapping class="org.hibernate.dto.UserDetails"/> at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1597) at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1552) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1531) at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1505) at org.hibernate.cfg.Configuration.configure(Configuration.java:1425) at org.hibernate.cfg.Configuration.configure(Configuration.java:1411) at org.hibernate.HibernateTest.main(HibernateTest.java:19)
2. When I kept DTD as 4.0
<?xml version='1.0' encoding='utf-8'?> <hibernate-configuration xmlns="http://www.hibernate.org/xsd/hibernate-configuration" xsi:schemaLocation="http://www.hibernate.org/xsd/hibernate-configuration hibernate-configuration-4.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
I am getting below error.
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" org.hibernate.MappingException: invalid configuration at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1484) at org.hibernate.cfg.Configuration.configure(Configuration.java:1425) at org.hibernate.cfg.Configuration.configure(Configuration.java:1411) at org.hibernate.HibernateTest.main(HibernateTest.java:19) Caused by: org.xml.sax.SAXParseException: Document is invalid: no grammar found. 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.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(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.doConfigure(Configuration.java:1481) ... 3 more
Can anyone please help me to solve above issue. ? or let me know which Jar files will support to DTD 4.0.
|
|