Getting No bean named 'sessionFactory' error when using OpenSessionInViewFilter

前端 未结 1 1856
南旧
南旧 2021-01-14 06:38

I am using Hibernate\'s lazy loading, and after adding OpenSessionInViewFilter to my web.xml I started to get sessionFactory missing exception, even after defining the sessi

1条回答
  •  爱一瞬间的悲伤
    2021-01-14 07:01

    Try moving the following configuration to applicationContext.xml

        
    
        
    
    
        
            
            
                classpath:hibernate.cfg.xml
            
            
                org.hibernate.cfg.AnnotationConfiguration
            
            
                
                    ${jdbc.dialect}
                    true
                    update
                
            
            
                
                    net.crawler.dao.model.ScrapingProperties
                
            
        
    
        
    
        
            
        
    

    0 讨论(0)
提交回复
热议问题