Announcement Announcement Module
Collapse
No announcement yet.
LazyLoadingException with Spring, Hibernate, Teneo and HttpInvoker Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • LazyLoadingException with Spring, Hibernate, Teneo and HttpInvoker

    Dear All,

    the title say all. I try to use the OpenSessionInViewFilter but I alway receive the org.springframework.beans.factory.BeanNotOfRequire dTypeException: Bean named 'idMeinRemoteDienst' must be of type [org.hibernate.SessionFactory], but was actually of type [meinremotepckg.server.GenericDaoImpl] exception.

    Ok now about the facts:

    I developed a web application and run it on the tomcat server.
    The transport is made by the httpinvoker.
    Because I use EMF, I use Teneo to make the persistence via hibernate and EMF.

    Code:
    String hbName = "hibernate"; 
    
    // create the HbDataStore
    HbDataStore hbds = (HbDataStore)HbHelper.INSTANCE.createRegisterDataStore(hbName);
    
    // sets its epackages stored in this datastore
    hbds.setEPackages(new EPackage[]{ModelPackage.eINSTANCE});
    
    ApplicationContext appContext =	new ClassPathXmlApplicationContext( "meinremotepckg/client/remote-client.xml" );
    
    //    MeinRemoteDienstIf hi = (MeinRemoteDienstIf) appContext.getBean( "idMeinRemoteDienstHttpInvoker" );
    GenericDaoI <Land> hiLand = (GenericDaoI <Land>) appContext.getBean( "idMeinRemoteDienstHttpInvoker" );				
    Collection cLand = hiLand.hole("Land");
    			
    GenericDaoI <Mitarbeiter> hiMitarbeiter = (GenericDaoI <Mitarbeiter>) appContext.getBean( "idMeinRemoteDienstHttpInvoker" );
    Collection <Mitarbeiter> cMitarbeiter = hiMitarbeiter.hole("Mitarbeiter");
    		
    for (Iterator <Mitarbeiter> iterator = cMitarbeiter.iterator(); iterator.hasNext();) {
    	Mitarbeiter mitarbeiter = iterator.next();
    	if (mitarbeiter.getName().equals("Kern")) {
    		System.out.println(mitarbeiter.getName());
    		mitarbeiter.getStaatsangehoerigkeit().add((Land)cLand.iterator().next());
    	}
    }
    The LazyLoadingException exception occoured when I try to add the staatsangehörigkeit (Nationality) to the mitarbeiter (worker).

    Can you help me? Need you any configuration files? I can post you all.

    Thanks in advance

    Waldi
Working...
X