Did you recheck the code with the example that you took it from? Clearly it's not the same. And Devaka already told you what the problem is with that piece of code.
I'm skeptical, because the error *clearly* indicates which class isn't found.
Samanthi perera
Ranch Hand
Joined: Jan 08, 2010
Posts: 510
posted
0
now it is change the error
anyway my Configuration.cfx.xml file in the project folderr
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
It should be on the classpath. I don't understand why you have to make this so difficult, over and over.
Samanthi perera
Ranch Hand
Joined: Jan 08, 2010
Posts: 510
posted
0
I am using Eclips IDE.
I creatred the config file using
File -> New->Other ->Hibernate -> Hibernate Configuration File
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
So what? It needs to be on the classpath.
Samanthi perera
Ranch Hand
Joined: Jan 08, 2010
Posts: 510
posted
0
How to add it to classpath?
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12612
posted
0
Put it in your source directory?
Samanthi perera
Ranch Hand
Joined: Jan 08, 2010
Posts: 510
posted
0
i have added.
Still have errors.
i add a debug line in
session=new AnnotationConfiguration().configure().buildSessionFactory();
after debug pointer come to this line i press F5.
then this error comes.
I think if you don't know how to figure that out you should take a step back before trying to deal with an ORM, because if you can't figure out how to fix the *simple* things when something goes wrong fixing the *complicated* stuff that can happen in Hibernate is going to be a pretty tall order.
- What class is missing?
- What jar is it in (and how do you know)?
- If you *think* you're deploying that jar, how can you find out if you're right?
This message was edited 1 time. Last update was at by David Newton
I tried this in Netbeans 6.8 & I hope it will work in Eclipse.
Another thing please create one HibernateUtil.java in Project as shown at Vaannilla Tutorial.
Don't try to create SessionFactory at main class.Use HibernateUtil class getSessionFactory() Method.
This message was edited 1 time. Last update was at by Shashank Acharya