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: Exception running First Hibernate 3 Example - please HELP
PostPosted: Wed Feb 17, 2010 2:22 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
Dear all,

I was running a Hibernate Example App in Eclipse. At run time, it immediately crashed on the first line of code:

SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();

The exception stack is below:

Looking forward to your help.
Many Thanks
------------------------------------exception stack
FirstExample (1) [Java Application]
roseindia.tutorial.hibernate.FirstExample at localhost:64348
Thread [main] (Suspended)
ClassNotFoundException(Throwable).<init>(String, Throwable) line: 217
ClassNotFoundException(Exception).<init>(String, Throwable) line: not available
ClassNotFoundException.<init>(String) line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$ExtClassLoader.findClass(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
FirstExample.main(String[]) line: 21
C:\Program Files\Java\jre6\bin\javaw.exe (Feb 17, 2010 1:24:07 PM)



Top
 Profile  
 
 Post subject: Re: Exception running First Hibernate 3 Example - please HELP
PostPosted: Thu Feb 18, 2010 9:54 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Usually a ClassNotFoundException has also a message telling which is the class that the classloader cannot find.
You must then adjust you java classpath in order that the missing class get included.


Top
 Profile  
 
 Post subject: Re: Exception running First Hibernate 3 Example - please HELP
PostPosted: Thu Feb 18, 2010 10:32 am 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
Yes, thank you.

That was the 1st thing I checked to make sure that my build path has all the jar files needed, using the FindJar utility.

I have org.hibernate.Session, org.hibernate.SessionFactory, org.hibernate.cfg.Configuration, hibernate3.jar and other common jars, their orders seem to be in place as well.

I don't know what class its complaining about and at a loss of what else to added.

Can you see from the exception stack which class is missing? I debugged it and drilled into several layers down but to no avail.

Any other ideas would be greatly appreciated.

Many Thanks...Mimi
SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();


Top
 Profile  
 
 Post subject: Re: Exception running First Hibernate 3 Example - please HELP
PostPosted: Thu Feb 18, 2010 12:14 pm 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Please take a look at the message of your ClassNotFoundException.
Is it empty?


Top
 Profile  
 
 Post subject: Re: Exception running First Hibernate 3 Example - please HELP
PostPosted: Thu Feb 18, 2010 8:06 pm 
Newbie

Joined: Tue Feb 16, 2010 6:57 pm
Posts: 17
There is no useful message except "not available". I rechecked my build path and there are many more jar files than necessary due to my attempt of guessing which might be the class in question.

Perhaps I should bring in all source necessary to debug this but I already had dug down several layers and not sure if I am barking up the wrong tree.

Here is the exception stack again:

------------------------------------exception stack
FirstExample (1) [Java Application]
[size=85]roseindia.tutorial.hibernate.FirstExample at localhost:64348
Thread [main] (Suspended)
ClassNotFoundException(Throwable).<init>(String, Throwable) line: 217
ClassNotFoundException(Exception).<init>(String, Throwable) line: not available
ClassNotFoundException.<init>(String) line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$ExtClassLoader.findClass(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
FirstExample.main(String[]) line: 21
[/size]
C:\Program Files\Java\jre6\bin\javaw.exe (Feb 17, 2010 1:24:07 PM)

Thanks.


Top
 Profile  
 
 Post subject: Re: Exception running First Hibernate 3 Example - please HELP
PostPosted: Fri Feb 19, 2010 4:21 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
Quote:
There is no useful message except "not available"


Thats very strange.
Which version of Eclipse are you using?
And how do you start your Hibernate Example App ? From Eclipse?
Can you please give more detail about your launch-configuration.


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.