-->
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: Hibernate Console Eclipse - unexpected end of subtree
PostPosted: Thu Jul 14, 2005 6:16 pm 
Newbie

Joined: Thu Jul 14, 2005 5:54 pm
Posts: 3
Hi,

Eclipse version: 3.1M6 (is this ok, JBossIDE forum has it as the last working Eclipse version and I have been using it with the JBoss tools for weeks now)
JBoss-IDE version: JBossIDE-1.5M1
JDK: 1.5.0_03
DB: HSQLDB 1.8.0

New to the hibernate part of the tools. Have managed to follow the video tutorial (javascript:popup_window('/hib_docs/tools/viewlets/createcfgxml_viewlet_swf.html','createcfgxml',1048,816);) for creating the connection and reverse engineering the classes. However when I try and look at the hibernate console mapped entries (after create session factory) I get "unexpected end of subtree" exceptions reported in the error log. Stack details at the end of the post. To clarify there is no subtree of Mapped Entities available!

The data am I using is just test data generated by HSQLDB database management tool. The source files and mappings look fine. My next step is to go and bundle this all up as an app and to try and make HQL calls directly from application code rather than eclipse to see if there is really a non-tool related query issue.

I am probably missing something obvious, any help appreciated!

Regards,

John

Here is the contents of the exception.

<AST>:0:0: unexpected end of subtree
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:2237)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:498)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:356)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:184)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:140)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:189)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:130)
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)
at org.hibernate.console.HQLQueryPage.getList(HQLQueryPage.java:30)
at org.hibernate.eclipse.console.views.QueryPageViewer$ContentProviderImpl.getElements(QueryPageViewer.java:80)
at org.eclipse.jface.viewers.StructuredViewer.getRawChildren(StructuredViewer.java:765)
...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 4:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
workaround: dont double click on the Mapped entities, just click the +

does the generator not generate any output ? Do you have any tables in your database ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 7:19 am 
Newbie

Joined: Thu Jul 14, 2005 5:54 pm
Posts: 3
Yes the Database has tables. The "Hibernate Artifact Generator" has happilly reversed them into a set of classes for me. The tool has generated an appropriate hibernate.cfg.xml and mapping files.

I have used the generated mapping files and data objects it has created against the database through hibernate in unit tests this morning and all is well. I can query successfully. So it looks like the DB, Hibernate and Mapping files are all good.

Its just the console that is giving trouble.

Thanks for the suggestion but it doesn't help, there is no + next to the mapping entry, thats the problem, the console doesn't seem be getting the meta data when I "Create Session Factory".

It am trying to use the same console that I used for the "Hibernate Artifact Generator" step which executed succesfully.

Any other suggestions welcomed.

John


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 9:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
the console should report some error if it fails in reading the specified mappings ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 15, 2005 12:55 pm 
Newbie

Joined: Thu Jul 14, 2005 5:54 pm
Posts: 3
Ok, have worked out what the problem was. I followed the on-line video-tutorial. It doesn't show (I just returned and rewatched it to make sure I wasn't going crazy) the adding of the mapping files to the "Mapping Files" section of the console configuration.

Without mapping files set you get no errors or exceptions when "Create Session Factory", however there are no Mapped Entities, and then double click on the Mapped Entities gives the exception I listed earlier.

Once I added the mapping files (yes I know its a big blank space on the console dialog and I should have tried it earlier) all is well.

Sorry for the wasted time (especially mine :-)).

John


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 11:34 am 
Beginner
Beginner

Joined: Sun Jan 22, 2006 8:47 pm
Posts: 31
can u pls give me the url of the tutorial,
thnx


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