-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 
Author Message
 Post subject: dtd validation problems
PostPosted: Thu Jan 20, 2005 1:52 pm 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
I got this error when starting tomcat.It looks it try to validate the xml with
some remote dtd. I have in my xxxx.hbm.xml some strange dtd that throws this error.help!!!
I post u the dtd in my xxx.hbm.xml and the error starting tomcat:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

and the error

net.sf.hibernate.MappingException: Error reading resource: rt11000/printdocument/hibernate/StampeComunicazioni.hbm.xml
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:357)
at rt11000.common.ServiceLocator.createHibernateConnection(ServiceLocator.java:111)
at org.apache.jsp.login_jsp._jspService(login_jsp.java:123)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:793)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:702)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:571)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:644)
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:287)
at net.sf.hibernate.cfg.Configuration.addClass(Configuration.java:354)
... 32 more
Caused by: org.xml.sax.SAXParseException: Document root element "hibernate-mapping", must match DOCTYPE root "hibernate-configuration".
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.rootElementSpecified(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(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.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.addInputStream(Configuration.java:286)
... 33 more


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 2:22 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Read the documentation, a hbm.xml is not a cfg.xml.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 2:28 pm 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
Actuallu I do not how to solve the problem even after the documentation.
Any help could be appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 2:35 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Did you understand the second part of my sentence?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 2:40 pm 
Regular
Regular

Joined: Tue Nov 30, 2004 4:23 pm
Posts: 62
dilembo...

If you ever have problems with a dtd, just put the dtd path in a url and actually view the file. If you did, you would see that the elements being described are the elements found in the *.cfg.xml files not the *.hbm.xml files.

*.hbm.xml should refer to the following dtd
Code:
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd"


*.cfg.xml should refer to the following dtd
Code:
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"


Your *.hbm.xml file is pointing to the wrong dtd.

Hope that helps,

-jay


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 2:51 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Now he will come back when he has the next trivial problem instead of learning to read...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 20, 2005 3:11 pm 
Regular
Regular

Joined: Tue Nov 30, 2004 4:23 pm
Posts: 62
True...probably another case of RTFM.

newbies should have a basic understanding of XML and DTDs even when working just with config files...

-jay


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 8:23 am 
Beginner
Beginner

Joined: Thu Jan 20, 2005 1:45 pm
Posts: 49
I fix it....Regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.