-->
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: session-factory in hibernate.cfg.xml
PostPosted: Fri Mar 25, 2005 3:26 pm 
Newbie

Joined: Fri Mar 25, 2005 3:07 pm
Posts: 11
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0

Mapping documents:


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

Full stack trace of any exception that occurs:

ERROR [main] (XMLHelper.java:59) - Error parsing XML: /hibernate.cfg.xml(36) The content of element type "hibernate-configuration" must match "(session-factory,security?)".
ERROR [main] (Configuration.java:1290) - problem parsing configuration/hibernate.cfg.xml
org.hibernate.MappingException: invalid configuration


Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Hi - was hoping someone could help me with this query.

Accoring to the docs, its says that when using xml config file for hibernate the session-factory element is optional. However when I tried to compile the code i got the above error, and also when I look at the DTD it does not seem to be made optional. Pls can someone advise?

Many Thanks

naz


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 3:54 pm 
Regular
Regular

Joined: Thu Dec 11, 2003 4:14 pm
Posts: 86
Location: Hibernate 3 + annotations, Oracle 9i, PostgreSQL 8.0, Java 1.5.0
Have you tried to add a empty session-factory?

<session-factory />

From the dtd this should work but dunno if the configuration parser likes it.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 4:05 pm 
Newbie

Joined: Fri Mar 25, 2005 3:07 pm
Posts: 11
many thanks for the reply.

Yes I am using a variant to that, but I think the DTD is wrong, the element should be made optional. (basically accoring to the DTD a config file is made up of a session factory with zeor or one of another element (can't remember at the top my head).

The actual work around is

Code:
<hibernate-configuration>
   <session-factory>
              <property.....

         </session-factory>
<hibernate-configuration>


Once again thanks for a speedy response.

Naz


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.