Maven + Spring + Hibernate: hibernate3-maven-plugin hbm2ddl fails for reason “Caused by: java.lang.NullPointerException”

前端 未结 2 1405
天命终不由人
天命终不由人 2021-01-06 21:33

I had to downgrade Hibernate from version 4 to version 3 (3.3.2.GA to be specific), due to current lack of support for Hibernate 4 within Spring, and now the project fails t

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-06 22:00

    For a large project (more than 250 Entities), I use the following pom.xml witch works fine and generate the schema during the compile phase. Note : persistence.xml specifies the database dialect.

    
    4.0.0
    
    test
    jpa
    1.0-SNAPSHOT
    
    
        
        
            javax
            javaee-api
            6.0
            provided
        
    
    
    
        
    
            
            
                org.codehaus.mojo
                hibernate3-maven-plugin
                3.0
                
                    
                        generate.database.schema.from.ejb.annotation
                        compile
                        
                            run
                        
                        
                            
                                
                                
                                    
                                
                            
                        
                    
                
                
                    
                    
                        org.hibernate
                        hibernate-core
                        3.6.10.Final
                    
                    
                        org.hibernate
                        hibernate-entitymanager
                        3.6.10.Final
                    
                    
                        org.hibernate
                        hibernate-validator
                        4.1.0.Final
                    
                    
                        javassist
                        javassist
                        3.4.GA
                    
                
            
    
        
    
    

提交回复
热议问题