-->
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.  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Problem with Hibernate 2 and eclipse RCP
PostPosted: Tue Nov 29, 2005 11:14 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
Hello!

I'm using Hibernate 2 in a Java application, which is based on eclipse RCP framework (http://www.eclipse.org/rcp/).

When I run the application from eclipse, everything works fine.

However, when I create a stand-alone application (i. e. a Java application, which runs without eclipse), I'm getting a strange error.

When Configuration is initialized, there is a statement like

configuration.addClass(MyClass.class).

As soon as this stamenent is executed, the application "hangs". I get no error message (last message before the program hangs is "mapping resource from file X.hbm.xml"), no exceptions and nothing happens.

The same application runs without problems, if I execute it from eclipse.

I did following:

1) Verified that the classpaths in the stand-alone application are OK
2) Compared mapping documents, which work and those, which don't and found no differences in their structure. There are two classes, both of which contain only primitive properties. But one of these classes can be configured and the other not.
3) Tried to use configuration.addURL(...) instead of addClass. The mapping document can be read by the class loader, i. e. it is not null.
4) Tried to put all mappings into one XML file (instead of separate mapping file for each class).

None of these measures helped.

Please tell me

a) how I can solve, or, at least,
b) diagnose this problem (see the error, which causes configuration.addClass(...) to hang).

I appreciate any hint.

TIA

Dmitri Pissarenko

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 11:16 am 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
Does it ever return? I've seen this happen when the XML parser is unable to resolve the [remote] DTD reference - although I thought that timed out after 30 seconds?

Can you do a thread dump or break into the program in a debugger?

Any Hibernate logs?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 11:23 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
Hello!

Thanks for your answer!

pmularien wrote:
Does it ever return?


No.

pmularien wrote:
Can you do a thread dump or break into the program in a debugger?


I could do it, if the application ran in eclipse. But when it runs in eclipse, this error doesn't occur.

pmularien wrote:
Any Hibernate logs?


Well, I set show_sql to true and the log4j message level to debug. But this does not help - in addURL(...) method there is only one log.info message at the start ("mapping resource ....hbm.xml").

This message is printed.

Dmitri Pissarenko

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 11:29 am 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
dapissarenko wrote:
pmularien wrote:
Can you do a thread dump or break into the program in a debugger?


I could do it, if the application ran in eclipse. But when it runs in eclipse, this error doesn't occur.


Control-Break in the console on Windows, kill -QUIT on Unix will provide a thread dump of a running java program.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 11:31 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
pmularien wrote:
Control-Break in the console on Windows, kill -QUIT on Unix will provide a thread dump of a running java program.


I'll try it. Thanks for this hint!

Dmitri

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 29, 2005 12:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
go read about buddy classloading in eclipse since its probably because of some classcastexception or classnotfoundexception that you get an error that for some reasons brings stuff to a halt.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 6:36 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
Hello!

pmularien wrote:
Can you do a thread dump or break into the program in a debugger?


Now I tried to press Ctrl-Break after Configuration.addClass(...).

Several stack traces were printed. I conclude that the program is not crashed (at least not all of its threads).

After Configuration.addClass(...) I can still close the dialog box, so the UI is responding.

Best regards

Dmitri

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 6:43 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
Hello!

Thanks for your hint!

max wrote:
go read about buddy classloading in eclipse


In which version of eclipse does this buddy class loading exist?

TIA

Dmitri Pissarenko

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 6:47 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
Hello!

max wrote:
go read about buddy classloading in eclipse


I've looked at

http://www.hibernate.org/311.html

and there read

Quote:
In the MANIFEST.MF file of the Hibernate plugin...


What does Hibernate plugin mean:

a) the plug-in of my application, which uses hibernate, or
b) hibernate packaged as a plug-in

?

TIA

Dmitri Pissarenko

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 6:49 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eclipse 3.1

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 6:51 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
max wrote:
eclipse 3.1


And what can I do if I use eclipse 3.0.x?

TIA

Dmitri

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 7:00 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
This is more a eclipse RCP classloading issue than it is hibernate related and it has been answered many times on this forum and on eclipse newsgroups.

I recommend you go read about eclipse RCP classloading since that is what is the issue here.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 7:18 am 
Newbie

Joined: Thu May 20, 2004 7:39 am
Posts: 12
Hello!

Thanks for your help!

max wrote:
This is more a eclipse RCP classloading issue


Do you think that simply upgrading to eclipse 3.1 can fix the problem?

Is it, in your opinion, necessary to upgrade to a later version of hibernate, too (at the moment I use hibernate 2.1) ?

TIA

Dmitri Pissarenko

_________________
Dmitri Pissarenko
Software Engineer
http://dapissarenko.com


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 7:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
as i said, the issue here has nothing to do with hibernate - it has to do with eclipse.

I do not know of any reason why you should not upgrade to eclipse 3.1; its much better than 3.0.

The same goes for Hibernate, if you can then upgrade to the latest version; but it will not help you solve your current problem.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 30, 2005 8:14 am 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
I do not know of any reason why you should not upgrade to eclipse 3.1; its much better than 3.0.

special for rcp development


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page 1, 2  Next

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.