-->
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.  [ 3 posts ] 
Author Message
 Post subject: Error parsing XML
PostPosted: Sun Sep 12, 2004 10:59 pm 
Newbie

Joined: Sun Sep 12, 2004 10:37 pm
Posts: 1
Hello people... The following error is showing. Anybody can help-me please?

23:24:26,482 ERROR XMLHelper:61 - Error parsing XML: XML InputStream(3) White spaces are required between publicId and systemId.
23:24:26,492 ERROR Configuration:380 - Could not configure datastore from inputstream org.dom4j.DocumentException: Error on line 3 of document : White spaces are required between publicId and systemId. Nested exception: White spaces are required between publicId and systemId.



Hibernate version: 3

Mapping documents:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE hibernate-mapping PUBLIC
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

<class name="br.com.planet.dominnio.security.model.Usuario"
table="usuario"
schema="security">

<id name="codUsuario" column="cod_usuario">
<generator class="sequence">
<param name="sequence">seq_usuario</param>
</generator>
</id>

<property name="dscLogin" column="dsc_login" length="15" not-null="true"/>

<property name="nomUsuario" column="nom_usuario" length="50" not-null="true"/>

<property name="dscSenha" column="dsc_senha" length="10" not-null="false"/>

<property name="tpoSituacao" column="tpo_situacao" length="1" not-null="true"/>

<version name="tmsAlteracao" column="tms_alteracao" type="timestamp"/>

</class>

</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():

Usuario usuario = new Usuario();
usuario.setDscLogin("marcelo");
usuario.setDscSenha("torres");
usuario.setNomUsuario("Marcelo");
usuario.setTpoSituacao("A");

Session session = HibernateUtilSimple.currentSession();

Transaction tx = session.beginTransaction();

session.save(usuario);

tx.commit();

HibernateUtilSimple.closeSession();


Full stack trace of any exception that occurs:

23:24:25,931 INFO Environment:411 - Hibernate 3.0 alpha
23:24:25,941 INFO Environment:424 - hibernate.properties not found
23:24:25,951 INFO Environment:457 - using CGLIB reflection optimizer
23:24:25,971 INFO Environment:486 - using JDK 1.4 java.sql.Timestamp handling
23:24:26,171 INFO Configuration:1019 - configuring from resource: /hibernate.cf
g.xml
23:24:26,181 INFO Configuration:990 - Configuration resource: /hibernate.cfg.xm
l
23:24:26,462 INFO Configuration:416 - Mapping resource: br/com/planet/dominnio/
security/model/Usuario.hbm.xml
23:24:26,482 ERROR XMLHelper:61 - Error parsing XML: XML InputStream(3) White sp
aces are required between publicId and systemId.
23:24:26,492 ERROR Configuration:380 - Could not configure datastore from input
stream
org.dom4j.DocumentException: Error on line 3 of document : White spaces are req
uired between publicId and systemId. Nested exception: White spaces are required
between publicId and systemId.
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:371
)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:421)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1137)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1093)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1021)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1007)
at br.com.planet.baseapp.persistence.HibernateUtilSimple.<clinit>(Hibern
ateUtilSimple.java:26)
at br.com.planet.dominnio.security.business.UsuarioBS.Insert(UsuarioBS.j
ava:33)
at br.com.planet.dominnio.security.controller.LogonAction.execute(LogonA
ction.java:48)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:115
8)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:20
6)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:688)
at java.lang.Thread.run(Thread.java:534)
Nested exception:
org.xml.sax.SAXParseException: White spaces are required between publicId and sy
stemId.
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.dom4j.io.SAXReader.read(SAXReader.java:339)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:371
)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:421)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1137)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1093)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1021)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1007)
at br.com.planet.baseapp.persistence.HibernateUtilSimple.<clinit>(Hibern
ateUtilSimple.java:26)
at br.com.planet.dominnio.security.business.UsuarioBS.Insert(UsuarioBS.j
ava:33)
at br.com.planet.dominnio.security.controller.LogonAction.execute(LogonA
ction.java:48)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:115
8)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:20
6)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:688)
at java.lang.Thread.run(Thread.java:534)
23:24:26,692 ERROR HibernateUtilSimple:29 - Initial SessionFactory creation fail
ed.
org.hibernate.MappingException: Error reading resource: br/com/planet/dominnio/s
ecurity/model/Usuario.hbm.xml
at org.hibernate.cfg.Configuration.addResource(Configuration.java:424)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1137)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1093)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1021)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1007)
at br.com.planet.baseapp.persistence.HibernateUtilSimple.<clinit>(Hibern
ateUtilSimple.java:26)
at br.com.planet.dominnio.security.business.UsuarioBS.Insert(UsuarioBS.j
ava:33)
at br.com.planet.dominnio.security.controller.LogonAction.execute(LogonA
ction.java:48)
at org.apache.struts.action.RequestProcessor.processActionPerform(Reques
tProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
va:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:115
8)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:284)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:204)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:257)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard
ContextValve.java:245)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:199)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:184)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:164)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:149)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:156)
at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv
eContext.java:151)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav
a:567)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:20
6)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:833)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ssConnection(Http11Protocol.java:732)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java
:619)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP
ool.java:688)
at java.lang.Thread.run(Thread.java:534)
Caused by: org.hibernate.MappingException: org.dom4j.DocumentException: Error on
line 3 of document : White spaces are required between publicId and systemId.
Nested exception: White spaces are required between publicId and systemId.
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:381
)
at org.hibernate.cfg.Configuration.addResource(Configuration.java:421)
... 37 more
Caused by: org.dom4j.DocumentException: Error on line 3 of document : White spa
ces are required between publicId and systemId. Nested exception: White spaces a
re required between publicId and systemId.
at org.dom4j.io.SAXReader.read(SAXReader.java:355)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:371
)
... 38 more


Name and version of the database you are using:
PostgreSQL 7.3.2

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 13, 2004 1:10 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Copy/pastle this line from a hibernate test mapping file
<!DOCTYPE hibernate-mapping PUBLIC
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 5:28 pm 
Beginner
Beginner

Joined: Sun Aug 01, 2004 5:16 am
Posts: 22
Location: BERLIN
i think its a SAX parser bug:
it would work if you at least do so:

<!DOCTYPE hibernate-mapping PUBLIC ""
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.