-->
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.  [ 2 posts ] 
Author Message
 Post subject: Error with Hibernate Config File - Element Type
PostPosted: Fri Aug 08, 2008 12:11 pm 
Newbie

Joined: Fri Aug 08, 2008 12:00 pm
Posts: 2
Hi Everyone,

I'm using MyEclipse IDE on Windows X/P against an Oracle database.
Also, I'm trying to use Hibernate 3.1.

I have a problem with an error that is appearing in my
hibernate.cfg.xml file. So it's not even running or getting
anything going yet.

Somehow the file flags the <hibernate-configuration> line with
an error that reads:

"The content of element type "hibernate configuration" must match
"session-factory, security?)". "

Can someone please help? Below is the hibernate.cfg.xml.
Just in case, I'm also including the Location.hbm.xml file.

By the way, does anyone know when using MyEclipse why
the Hibernate 3.1 Core Libraries sometimes appear in the
package explorer and when making new projects sometimes
there're not there? How can one make them part of the project
and appear in the Project on the Package Explorer?

Thanks,

Rudi


Hibernate version: 3.1

Mapping documents:


The hibernate.cfg.xml:

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

<hibernate-configuration>

<session-factory>
<property name="connection.username">admin</property>
<property name="connection.url">jdbc:oracle:thin:@test:1521:testdb</property>
<property name="dialect">org.hibernate.dialect.OracleDialect</property>
<property name="myeclipse.connection.profile">Oracle</property>
<property name="connection.password">test2</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>

</session-factory>

<mapping resource="Location.hbm.xml" />

</hibernate-configuration>



The Location.hbm.xml:

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

<hibernate-mapping>
<class name="com.myproject.Location" table="admin.Location">

<id name="location_id" column="location_id">
<generator class="native"/>
</id>

<property name="location" column="location"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 08, 2008 1:23 pm 
Newbie

Joined: Fri Aug 08, 2008 12:00 pm
Posts: 2
Hi All,

I found the problem. It was the position of the mapping resource in the file. It should be before the session factory end tag.

Thanks

Moderator: Please close this topic. Thanks.


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