ERROR: HHH000299: Could not complete schema update java.lang.NullPointerException

后端 未结 4 1711
庸人自扰
庸人自扰 2021-01-06 06:05

I have a web application in the following environment.

  • JPA 2.0
  • Spring 3.2.2
  • MySQL 5.6.11
  • Hibernate 4.2.0 CR1
  • Apache Tomca
4条回答
  •  感情败类
    2021-01-06 06:09

    The problem in question vanished, when I insisted upon using a JNDI lookup. Accordingly, in the context.xml file, I have defined a resource like,

    
    
        
    
    

    The resource reference needs to be defined in the web.xml file like,

    
        jdbc/social_networking
        javax.sql.DataSource
        Container
    
    

    This datasource is referenced in the the persistence.xml file as follows.

    
    
      
      
        org.hibernate.ejb.HibernatePersistence
        java:comp/env/jdbc/social_networking
        model.Test
        false
    
        
          
                
          
          
          
        
      
    
    

    And finally the application-context.xml file has been modified as follows.

    
    
    
        
            
              
        
        
        
    
                    
        
            
                
                    false
                    
                
            
    
            
                
                  
                
            
    
            
                
            
        
    
        
            
        
    
        
    
        
            
        
    
        
        
    
    

提交回复
热议问题