this is my config.xml
this is my main class
in this main class line AnnotationConfiguration().configure().buildSessionFactory(); gives this error
Samanthi perera wrote:AnnotationConfiguration().configure().buildSessionFactory()
AnnotationConfiguration is a class. How do you create a new object from a class?
Samanthi perera wrote:i am using this exaple
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.
anyway when i run the example it gives this error.
I think it is not creating sessionfactory ?
Come on: we've been over this stuff many times: TellTheDetails.
anyway my Configuration.cfx.xml file in the project folderr
I creatred the config file using
File -> New->Other ->Hibernate -> Hibernate Configuration File
Still have errors.
i add a debug line in
after debug pointer come to this line i press F5.
then this error comes.
the error is still there
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?
Mark Spritzler wrote:The answer must be 42
Samanthi perera wrote:i don't understand what is mean by 42.
42 is the answer to the ultimate question (life the universe and everything) in the Hitchhikers Guide to the Galaxy. It is used as a joke.
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.