-->
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: Hibernate Eclipse !!!
PostPosted: Sun Dec 18, 2005 9:19 pm 
Beginner
Beginner

Joined: Sun Dec 04, 2005 4:28 pm
Posts: 24
org.hibernate.MappingException: Resource: *.hbm.xml not found
at org.hibernate.cfg.Configuration.addResource(Configuration.java:465)
at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1404)
at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1372)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1353)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1329)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1283)
at org.hibernate.console.ConsoleConfiguration$1.execute(ConsoleConfiguration.java:133)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.buildWith(ConsoleConfiguration.java:123)
at org.hibernate.console.ConsoleConfiguration.build(ConsoleConfiguration.java:107)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:19)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:68)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 7:42 am 
Beginner
Beginner

Joined: Mon Jan 30, 2006 2:28 am
Posts: 47
Location: INDIA
Hi,

if u use 1 database table. you should have mapping files (.hbm.xml files) and java files

for e.g;

i have userlogin table. it contains username and password. both are string type.

so the hbm file name is userlogin.hbm.xml.(this file name and Database file name same and all the colunm name should be same)

userlogin.hbm.xml file looks like


<hibernate-mapping package="hibernate.loginDB">

<class name="Userlogin" table="userlogin">
<id name="username" column="username" type="string">
<generator class="native"/>
</id>

<property name="password" column="password" type="string" not-null="true" />

</class>
</hibernate-mapping>

So u should create this .hbm file.
and configure this file in hibernate.cfg.xml file

eg.,
<mapping resource="/Userlogin.hbm.xml" />

_________________
A.Edward Durai
"The things which are impossible with men are possible with God."


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 10:54 am 
Newbie

Joined: Wed Feb 08, 2006 3:57 pm
Posts: 16
Please specify more details.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 5:38 pm 
Regular
Regular

Joined: Fri Sep 09, 2005 11:35 am
Posts: 101
please post your cfg.xml file.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 13, 2006 1:28 am 
Beginner
Beginner

Joined: Mon Jan 30, 2006 2:28 am
Posts: 47
Location: INDIA
This is My hibernate.cfg.xml file
***********************************************************
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">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="myeclipse.connection.profile">serverSybase</property>
<property name="connection.url">jdbc:sybase:Tds:192.168.102.100:2638/vrmdb</property>
<property name="connection.username">admin</property>
<property name="connection.password">admin</property>
<property name="connection.driver_class">com.sybase.jdbc3.jdbc.SybDataSource</property>
<property name="dialect">org.hibernate.dialect.SybaseDialect</property>
<mapping resource="hibernate/loginDB/Userlogin.hbm.xml" />

</session-factory>
</hibernate-configuration>
**********************************************************

Here I am using Sybase database. Thank you.

_________________
A.Edward Durai
"The things which are impossible with men are possible with God."


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.