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.  [ 6 posts ] 
Author Message
 Post subject: session-factory,security? error
PostPosted: Tue Feb 26, 2008 4:10 am 
Newbie

Joined: Tue Feb 26, 2008 3:06 am
Posts: 3
Location: sacramento
Hi,
I'm working on this hibernate tutorial and am getting an error in the hibernate.cfg.xml file which says:
The content of element type "hibernate-configuration" must match "session-factory,security?".
Can someone explain me what that means?

Thanks,
Karthik


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 26, 2008 12:21 pm 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
The hibernate configuration DTD http://hibernate.sourceforge.net/hibern ... on-3.0.dtd
mentions the following synatx.

Quote:
<!ELEMENT hibernate-configuration (session-factory,security?)>


It means there should be only session-factory element and one or more security elements.

So check your hibernate.cfg.xml file. When edit this file using any Java IDE like Eclipse, it should report the error in XML.

If you have still issues, pl post your hibernate configuration file (XML) here.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 27, 2008 1:00 am 
Newbie

Joined: Tue Feb 26, 2008 3:06 am
Posts: 3
Location: sacramento
here's my XML document.

<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD //EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<sesion-factory>
<property name="show_sql">true</property>
<!-- <property name="connection.datasource">java:/comp/env/jdbc/AuctionDB
</property> -->
<property name="dialect">net.sf.hibernate.dialect.PostgresSQLDialect
</property>
<!-- Settings for a local PostgreSQL database. -->
<property name="query.substitutions">yes 'Y', no 'N'</property>
<property name="connection.driver_class">org.postgresql.Driver</property>
<property name="connection.url">jdbc:postgresql://localhost/project</property>
<property name="connection.username">postgres</property>
<property name="connection.password">postgres</property>

<mapping resource="org/store/events/Users.hbm.xml"/>
</sesion-factory>
</hibernate-configuration>


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 27, 2008 10:49 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
check for the type sesion-factory. It should be session-factory


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 4:51 am 
Newbie

Joined: Tue Feb 26, 2008 3:06 am
Posts: 3
Location: sacramento
ooops....thanx :).now i'm getting a new error though, i get a message on my IDE across the DTD that says, "NETWORK IS UNREACHABLE:CONNECT" . I hope I'm not missing something again.

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 9:11 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
Check this:

http://www.hibernate.org/116.html#A35

Quote:
Hibernate tries to connect to http://hibernate.sourceforge.net at startup!

Usually you use the wrong DTD declaration in your XML mapping/configuration files. Or, this means that your XML parser does not support the EntityResolver callback that Hibernate uses to resolve the mapping DTD from inside hibernate3.jar. Either use a different XML parser, such as a recent version of Xerces, or edit your mapping documents to use a SYSTEM id instead of the PUBLIC id that we recommend in the documentation.


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