-->
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.  [ 9 posts ] 
Author Message
 Post subject: Hibernate Console - Create Session Factory fails
PostPosted: Wed Aug 10, 2005 1:41 pm 
Newbie

Joined: Fri Aug 13, 2004 12:06 pm
Posts: 15
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Mapping documents: multiple - generated by Hibernate Tools

Code between sessionFactory.openSession() and session.close(): n/a

Full stack trace of any exception that occurs:
Could not create datastore from file: <one of the mapping files it just generated>

Name and version of the database you are using: Oracle 9i

The generated SQL (show_sql=true): n/a

Debug level Hibernate log excerpt: n/a

I am trying to use eclipse to test some HQL, but it won't create the required session factory. Everything else seems to work.

Could some kind person please contact me and give a little advice on how to fix this problem? Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 12:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
look in the error log - it should tell you why it doesnt work.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 12, 2005 6:44 pm 
Newbie

Joined: Fri Aug 13, 2004 12:06 pm
Posts: 15
If we are talking about the error log in the Eclipse IDE, for the Hibernate Console, all it says it what I posted. It can't create the datastore from one of the mapping files that it generated. They shouldn't have anything to do with creating a Hibernate Session Factory and session object, should they? The Hibernate.cfg.xml is responsible for that... which I used to connect and generated the mapping files... I don't get it.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 13, 2005 4:36 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
well, to build a session factory it needs to create a configuration.

The error log should contain a full stack trace that states what is wrong - expand the line (sometimes there is more under the +) and double click on the item(s) and see what it is saying

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 13, 2005 8:45 am 
Newbie

Joined: Fri Aug 13, 2004 12:06 pm
Posts: 15
I have done that and clicked all the + icons to expand it. It just says the exact same thing in the expanded version and I don't see any full stack trace. Could you please explain what you mean by "it needs to create a configuration". I thought it already did that when it created my hibernate.cfg.xml file and then used it when it connected to the DB and created all my mapping files. I am just following the procedure it says to do in the Flash tutorial and everything works up to the point where I need to create a session factory, so I can test some HQL.

Is there another place to look for the errors besides in the Eclipse Hibernate console error window? The information there is not helping me. All it says is it can't create datastore from file: mappingfileX.hbm.xml

Is there anything else you can advice to help me?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 13, 2005 11:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
when you doubleclick eclipse should show a dialog in where a stacktrace is visible - check out what that stacktrace says.

And yes, the console had a configuration before it generated the cfg.xml etc., but now it needs a new one which include the mapping files - and for some reason it errors on that....it can be because it cannot find the files and/or there is a error in them

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Reverse generation works fine but Console fails
PostPosted: Wed Aug 17, 2005 10:42 am 
Newbie

Joined: Wed Aug 17, 2005 8:06 am
Posts: 2
Hello I think my problem is partly related to this topic here,
so I hope to get some hlep on this issue.
My setup:
Dev environment
Eclipse SDK
Version: 3.1.0
Build id: I20050627-1435
JBoss IDE 1.5.0m1
MySQL 1.4.8

Database name: cdcol
Table name: cds whith the structure

--
-- Table structure for table `cds`
--

CREATE TABLE `cds` (
`titel` varchar(200) default NULL,
`interpret` varchar(200) default NULL,
`jahr` int(11) default NULL,
`id` bigint(20) unsigned NOT NULL auto_increment,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;

--
-- Dumping data for table `cds`
--

INSERT INTO `cds` VALUES ('Beauty', 'Ryuichi Sakamoto', 1990, 1);
INSERT INTO `cds` VALUES ('Goodbye Country (Hello Nightclub)', 'Groove Armada', 2001, 4);
INSERT INTO `cds` VALUES ('Glee', 'Bran Van 3000', 1997, 5);


The reverse generator works fine.
And the Console configuration opens up the SessionFactory successfully the attributes are listed too.
Problem
The console is not able to executre properly any of the queries.

select cds.Id from Cds as cds


failes with the error log:
org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: as col_0_0_[select cds.Id from com.rtg.Cds as cds]
The Log shows following:

org.hibernate.hql.ast.QuerySyntaxError: unexpected AST node: as col_0_0_ [select cds.Id from com.rtg.Cds as cds]
at org.hibernate.hql.ast.ErrorCounter.throwQueryException(ErrorCounter.java:74)
at org.hibernate.hql.ast.QueryTranslatorImpl.generate(QueryTranslatorImpl.java:180)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:146)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:414)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:814)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:773)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)

Thanks in advance,
rtg


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 11:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
your bug is fixed in current cvs and relates only to mysql

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 2:16 pm 
Newbie

Joined: Wed Aug 17, 2005 8:06 am
Posts: 2
Hi max,
thanks for the quick reply,
I will update this thread once I checked and post the versions.
rtg


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