-->
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: tables cannot map into databases
PostPosted: Tue Feb 07, 2006 10:50 pm 
Beginner
Beginner

Joined: Tue Feb 07, 2006 10:39 pm
Posts: 46
i have create a hibernate project using eclipse wtp. i have written the model file and also mapping files as well. i have created the database manually in mysql server. i used syntax 'grant all on symis.* to 'user@127.0.0.1'. what else should i do to map the tables inti database?? thanx.


Top
 Profile  
 
 Post subject: Re: tables cannot map into databases
PostPosted: Wed Feb 08, 2006 6:46 am 
Beginner
Beginner

Joined: Mon Jan 30, 2006 2:28 am
Posts: 47
Location: INDIA
faireni wrote:
i have create a hibernate project using eclipse wtp. i have written the model file and also mapping files as well. i have created the database manually in mysql server. i used syntax 'grant all on symis.* to 'user@127.0.0.1'. what else should i do to map the tables inti database?? thanx.


Hi faireni,
First Please check which MYSQL server version you are using. I think Hibernate Community supports the below versions

MySQL 3.23, 4.0, 4.1, 5.0.

Fine. If you have a correct version then No problem.

Pls check your Database table colunm name and mapping file(*.hbm.xml file) column name should be same.

and pls check this code for mysql server
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://localhost/tm4j-test

localhost : your host name
tm4-test : db name
try to put all jar file(mysql supported) in lib file

Thanks. All the best

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 08, 2006 8:16 pm 
Beginner
Beginner

Joined: Tue Feb 07, 2006 10:39 pm
Posts: 46
yes, i have done all as mentioned. actually the database work fine inmy computer but when my partner downloaded my project, she jst can't map the tables into the database. is it anything to do with jboss??


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 1:12 am 
Beginner
Beginner

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

My Suggestion is:

1. Try to send your Database table creation query also. because your database contains different columns with different data type. So mapping files(*.hbm.xml files) data type and Data base table column names should be same.

2. Or hibernate.connection.url=jdbc:mysql://localhost/tm4j-test
in the above tm4-test is DB name. so pls check your DB Name. localhost is the host name. Pls check your host name also.

3.Or send me error description (Exception) you got.

Thanks.

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


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 09, 2006 8:14 pm 
Beginner
Beginner

Joined: Tue Feb 07, 2006 10:39 pm
Posts: 46
this is the exception stack trace shown in hibernate console.

java.lang.ClassNotFoundException: model.User
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:405)
at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:350)
at org.eclipse.osgi.framework.adaptor.core.AbstractClassLoader.loadClass(AbstractClassLoader.java:78)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:108)
at org.hibernate.mapping.PersistentClass.getMappedClass(PersistentClass.java:96)
at org.hibernate.tuple.PropertyFactory.getGetter(PropertyFactory.java:166)
at org.hibernate.tuple.PropertyFactory.buildIdentifierProperty(PropertyFactory.java:44)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:115)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1154)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:265)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:260)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:24)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
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: Mon Feb 13, 2006 1:23 am 
Beginner
Beginner

Joined: Mon Jan 30, 2006 2:28 am
Posts: 47
Location: INDIA
So User.java file is missed in your model folder. Try to place that User.java file in model folder. (CLASS NOT FOUND EXCEPTION)

_________________
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.  [ 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.