-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problem with tutoriale, first caption.
PostPosted: Mon Mar 17, 2008 12:47 pm 
Newbie

Joined: Mon Mar 17, 2008 12:28 pm
Posts: 3
Hello, i have any problem with tutorial. I'm a new Hibernet's user.
When i run: "ant run -Daction=store" give me this results


Buildfile: build.xml

clean:
[delete] Deleting directory /home/developer/capitolo1/bin
[mkdir] Created dir: /home/developer/capitolo1/bin

copy-resources:
[copy] Copying 3 files to /home/developer/capitolo1/bin
[copy] Copied 2 empty directories to 1 empty directory under /home/developer/capitolo1/bin

compile:
[javac] Compiling 4 source files to /home/developer/capitolo1/bin
[javac] Note: /home/developer/capitolo1/src/events/EventManager.java uses unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.

run:
[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Initial SessionFactory creation failed.org.hibernate.InvalidMappingException: Could not parse mapping document from resource events/Person.hbm.xml
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at util.HibernateUtil.<clinit>(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from resource events/Person.hbm.xml
[java] at org.hibernate.cfg.Configuration.addResource(Configuration.java:575)
[java] at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1593)
[java] at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1561)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1540)
[java] at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1514)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:1434)
[java] at org.hibernate.cfg.Configuration.configure(Configuration.java:1420)
[java] ... 3 more
[java] Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
[java] at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:514)
[java] at org.hibernate.cfg.Configuration.addResource(Configuration.java:572)
[java] ... 9 more
[java] Caused by: org.dom4j.DocumentException: Error on line 14 of document : The content of elements must consist of well-formed character data or markup. Nested exception: The content of elements must consist of well-formed character data or markup.
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:482)
[java] at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:505)
[java] ... 10 more
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 9 seconds


I don't understand what is the problem? Before add a collection of events to the person class, i hadn't problem!
Please help me.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 1:08 pm 
Beginner
Beginner

Joined: Fri Aug 24, 2007 4:46 am
Posts: 36
Location: Bielefeld / Germany
Please check events/Person.hbm.xml.

Maybe there's an invalid character or a misformed tag somewhere near line 14 as your error log states:

"""Error on line 14 of document : The content of elements must consist of well-formed character data or markup."""

Otherwise post your Person.hbm.xml.

-mj


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 1:25 pm 
Newbie

Joined: Mon Mar 17, 2008 12:28 pm
Posts: 3
I don't see anything,...
This is my Person.hbm.xml file:

<hibernate-mapping>

<class name="events.Person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="native"/>
</id>

<property name="age"/>

<property name="firstname"/>

<property name="lastname"/>

<set name="events" table="PERSON_EVENT">
<key column="PERSON_ID"/>
<many-to-many column="EVENT_ID" class="events.Event"/>
</set>
</class>

</hibernate-mapping>

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 1:37 pm 
Beginner
Beginner

Joined: Fri Aug 24, 2007 4:46 am
Posts: 36
Location: Bielefeld / Germany
Please add the declarations below on top of your mapping-file.

HTH, Maik

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 17, 2008 1:45 pm 
Newbie

Joined: Mon Mar 17, 2008 12:28 pm
Posts: 3
Thanks, very kind.
I'm very stupid!
thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.