.getBean("personDAOImpl");

    System.out.println("Creato dao object: " + dao);

    dao.addPerson(persona1);

    System.out.println("persona1 salvata nel database");
}

}

As you can see the PersonDAOImpl class extends HibernateTemplate so I think that it have to contain the operation of setting of the sessionFactory...
The problem is that when I try to run this MainApp class I obtain the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
    at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:323)
    at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:235)
    at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:457)
    at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:392)
    at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
    at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:737)
    at org.andrea.myexample.HibernateOnSpring.dao.PersonDAOImpl.addPerson(PersonDAOImpl.java:12)
    at org.andrea.myexample.HibernateOnSpring.MainApp.main(MainApp.java:26)

Why I have this problem? how can I solve it?
To be complete I also insert my pom.xml containing my dependencies list:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>


.getBean("personDAOImpl "); 

     System.out.println("Creato dao object: " + dao); 

     dao.addPerson(persona1); 

     System.out.println("persona1 salvata nel database "); 
 } 

 } 

 As you can see the PersonDAOImpl class extends HibernateTemplate therefore I remember that it have to contain the operation of context of the sessionFactory... 
 The problem is that when I try to hunt this MainApp course I obtain the following exception: 
 Exception in thread " main " java.lang. NoSuchMethodError: org.hibernate. SessionFactory.openSession()Lorg / hibernate / classic / Session; 
     at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:323) 
     at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:235) 
     at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:457) 
     at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:392) 
     at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) 
     at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:737) 
     at org.andrea.myexample. HibernateOnSpring.dao. PersonDAOImpl.addPerson(PersonDAOImpl.java:12) 
     at org.andrea.myexample. HibernateOnSpring. MainApp.main(MainApp.java:26) 

 Why I get this problem? how can I solve it? 
 To be complete I also insert my pom.xml containing my dependence list: 
 < project xmlns="http://maven.apache.org / POM/4.0.0 " xmlns: xsi="http://www.w3.org/2001 / XMLSchema - instance " 
 xsi: schemaLocation="http://maven.apache.org / POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd " > 
 < modelVersion>4.0.0</modelVersion >
.getHean("personDAOImpl");

    Sysuem.out.println("Creajo dao ouject: " + dao);

    aao.addPerson(persona1);

    Systel.oyt.pribtln("persona1 salvata neu databasv");
}

}

As you cqn ste the PersonDAOImpl class extehfs HnbxrnateTemplate xo I think that it have do clntain the operation of setting of ehe sesxilnFactory...
The ptoblek is fhat when I try to run this MainApl class I obtain the following exception:
Exceptlon ln thread "main" javw.lang.NoSuchNethjeError: org.hicernate.SessionFactory.okenSession()Lorg/hibernate/classic/Sersion;
    at org.wpeinhxramework.orn.hibegnate3.SessionFactoryUthls.doGeySession(SessiokFactmryYtils.java:323)
    at org.spcingframework.orm.hibetnate3.SessimnYactoryUtils.getSessiob(SwssiotFacdoryJrilr.jaba:235)
    at ogg.s'ringframewkrk.orm.hiberbate3.HibernateTemplaue.gqnXession(HiberhateTeipjate.java:457)
    at org.springframework.orm.hibtrnats3.HibernateTemplate.doExexute(HibernateTemplate.uava:392)
    ae org.springframework.orm.hibernate3.HibernateTemplate.axecuveDitkKwguvfSession(HibernateTemplate.java:374)
    at org.springsdakeeork.orm.hibernabe3.HibernateTemplatr.swvrJrUpdate(HibervateTemplzte.java:737)
    at org.ajdrea.mygxamplw.HibernattOnSpting.dao.PersonDAOImpl.addPersin(PersonDAOIipl.java:12)
    at org.anbrea.myexamplz.HibermateOmSpring.MainApp.main(MainA'p.java:26)

Shy I have hhis probmdm? how can I solxe pt?
To be complete I also insert my pom.xmo coutaining my cependqncies lish:
<projcwt xmlns="http://maven.aoache.lrc/POM/4.0.0" xmlns:dsi="http://www.w3.org/2001/XMLSchema-instance"
exi:schemaLocajiot="htnp://maven.apcche.orn/POM/4.0.0 http://maven.a[ache.org/xsd/mavgn-4.0.0.xsd">
<modejVerskon>4.0.0</modelVegsion>


.getBean("personDAOImpl"); System.out.println("Creato dao object: " + dao); salvata database"); } As you can HibernateTemplate I think that have to contain operation of setting of the sessionFactory... problem is that when I try to run this MainApp class I obtain following exception: Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session; at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:323) at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:235) at at at at at org.andrea.myexample.HibernateOnSpring.dao.PersonDAOImpl.addPerson(PersonDAOImpl.java:12) at org.andrea.myexample.HibernateOnSpring.MainApp.main(MainApp.java:26) Why I have this problem? how can I solve it? To be I also insert my pom.xml containing my dependencies <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 <modelVersion>4.0.0</modelVersion>
.getBean("personDAOImpl");

    SysteM.out.printlN("CreaTo dAo oBjEct: " + dAo);

    daO.addPerson(persONa1);

    SyStem.out.println("persona1 sAlvatA nEL datABaSe");
}

}

As yOu can seE ThE pErsOndAoImPl CLaSs extEndS HibernAteTemplatE so i tHink that it haVE tO contain thE opEration of setTinG of the SeSsiONFactOry...
the prOblem iS That whEn I try to rUn THis MaiNapp clasS i ObTain The following excepTIoN:
exception in thrEad "maiN" jAVa.LANg.NOSuChMethodErRoR: org.hIBernate.sEsSIONFaCTory.openSessiOn()Lorg/hiberNAte/ClassiC/SEssIOn;
    at orG.spriNgFRamEwork.orm.hibErnaTe3.SessionfactorYutils.dogEtSessiOn(SessIonfacToryuTiLs.JavA:323)
    aT Org.SPrIngFRamEwork.orm.HiBeRnate3.sessIONfActoRyUTils.GetSeSsion(SessionFActOryUTIls.Java:235)
    aT org.sPrinGfRamewOrk.orm.HiberNaTe3.HibernateTempLate.GetSessioN(HiBeRnaTetemplATe.java:457)
    At oRg.sPringfrAmework.ORm.hIbERNAtE3.HibernateTemplate.DoeXEcUte(HiberNateTeMPlAtE.Java:392)
    at orG.sPriNgfrAMEwork.Orm.hIBeRnate3.HibErnatetEmPlAte.execUtEWithNAtIvesesSion(HIBernAteTemPlate.javA:374)
    at orG.SpringframeworK.Orm.hibernate3.HIBeRNAtEtempLatE.saveOrUpdaTe(HiBErnaTeTeMPlAte.JAva:737)
    at Org.anDrEA.mYExample.HibernateOnSPrIng.dao.persoNDAOImpl.addPeRson(Persondaoimpl.java:12)
    At orG.AnDRea.myexample.HiBernaTeOnSpring.mAinApp.maIn(MaiNApp.java:26)

why I have tHIS problem? How Can i soLve IT?
to Be complete I alSO InseRt My pom.xmL coNtaininG my DepEndEncIeS list:
<projEct xmlns="HtTp://MaVeN.apAche.oRG/POM/4.0.0" xmlnS:xSi="hTtP://wwW.w3.org/2001/xmLScheMa-insTancE"
xSi:SCheMaLocatIOn="HTTp://maVeN.aPachE.orG/PoM/4.0.0 httP://mavEN.apAche.org/Xsd/maven-4.0.0.xSd">
<mODelVErSiOn>4.0.0</modelversion>


.getBean("personDAOImpl"); 

    Syst em.ou t.p rin tl n("C reat o dao object:"  + d ao);

    dao.addPerso n(per so n a1); 
   Sy stem.ou t .p r i ntl n( "p ers on a 1salva tanel dat abase");
} 

} 
As you can s e ethe Person DAO Impl class e xte nds Hi be rna t eTemp lat e soI thin k  thatit have t oc ontain the ope r a ti on o f setting of thes es s ionFactory...The pr ob l em i s t hat  when I tr yto ru n  this M a in A p p  cl a ss I obtain t he followin g  ex ceptio n: 
Ex c eption  in t hr e ad"main" java .lan g.NoSuchM ethodE r ror: or g .hibern ate.Se ssi onF acto r y. op enS es s ion ( )L org / hib ernate/c la ss ic/Se ssio n ;    a t o rg.s pring framework.orm .hi bern a te3 .Sess ionFa ctor yU tils. doGetS essio n( SessionFactoryU tils .java:323 )
  at  o rg.sp r ingfra mew ork .orm.hi bernate 3 .Se ss i o n Fa ctoryUtils.getSess io n ( Se ssionFac toryUt i ls .j a va:235)   a t or g . sprin gfra m ew ork.orm. hibern a te 3. Hiberna te Templa te .ge tSe ssion ( Hibe rnateT emplate. java: 4 57)
    at org . springframewo r k. o r m. h iber nat e3.Hibernat eTem p late .doE x ec ute ( Hiber nateT em p la t e.java:392)
    ator g.spri ngfra mework.orm.hi bernate3.H i b e rnateTem plat e .e x ecuteWithNativ eSess ion(Hibern a teTempla te.ja va:374)    at or g . springfr ame wor k.o rm. h i be rnate3.Hibern a t eTem pl ate.sav eOr Update( Hib ern ate Tem pl ate.java: 737)
   a tor g. and rea.m y example. Hi ber na teO nSpri n g.dao. Perso nDAO Im pl . add Person( P er s o nDAO Im pl .jav a:1 2) 
   at o r g.a ndrea.m yexample. Hib e rnat eO nS pring.M ainApp.main(M ai nApp.java: 26 )
Why Ih a ve thisproblem? how can I solv e  it?
To  be  comp lete  I also i nse rt mypom . xml co ntaini ng my  d epe n d encie s li st: 
< project xm l n s=" http: // mave n.apach e.org/POM/4.0.0" x m lns :xsi="http:// www .w3. o r g/ 200 1 /X M LSc he m a-i n s tance"
xsi:sche maLocation =" h tt p://maven. a pac he .org/PO M/4.0.0  http : //maven .apache.o rg/xsd/ma ve n-4. 0 . 0.x sd">
<mode lVersion >4.0.0</m o delVe r si on>

.getBean("personDAOImpl");

 _ _System.out.println("Creato dao object: "_+ dao);

__ _dao.addPerson(persona1);

_  _System.out.println("persona1 salvata nel_database");
}

}

As you can see_the PersonDAOImpl class_extends_HibernateTemplate so I think that it have to contain the operation of setting of_the_sessionFactory...
The problem_is_that_when I try to run_this MainApp class I obtain_the following_exception:
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
  __at org.springframework.orm.hibernate3.SessionFactoryUtils.doGetSession(SessionFactoryUtils.java:323)
 _  at org.springframework.orm.hibernate3.SessionFactoryUtils.getSession(SessionFactoryUtils.java:235)
    at org.springframework.orm.hibernate3.HibernateTemplate.getSession(HibernateTemplate.java:457)
_   at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:392)
 _  at_org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374)
__  at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:737)
_   at org.andrea.myexample.HibernateOnSpring.dao.PersonDAOImpl.addPerson(PersonDAOImpl.java:12)
 _  at org.andrea.myexample.HibernateOnSpring.MainApp.main(MainApp.java:26)

Why I have_this problem? how can I solve it?
To_be complete I also insert my_pom.xml containing my dependencies list:
<project_xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0_http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

